Chuyển tới nội dung chính
kitlocal.dev

Trình tạo Kubernetes YAML

Chạy cục bộ

Xử lý 100% ngay trong trình duyệt. Dữ liệu đầu vào và kết quả không rời khỏi thiết bị.

Tạo tệp manifest Kubernetes YAML cho Deployment, Service và cấu hình triển khai

Cấu hình Manifest
Kubernetes Manifest (YAML)
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kitlocal-app-deployment
  namespace: default
  labels:
    app: kitlocal-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: kitlocal-app
  template:
    metadata:
      labels:
        app: kitlocal-app
    spec:
      containers:
      - name: kitlocal-app-container
        image: nginx:latest
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: kitlocal-app-service
  namespace: default
spec:
  type: ClusterIP
  selector:
    app: kitlocal-app
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80