K8S/Kubernetes k8s 通过 yaml 文件创建 deployment

k8s 通过 yaml 文件创建 deployment

cat k8s-test-deploy.yamlapiVersion: apps/v1kind: Deploymentmetadata: name: auth-server namespace: k8s-testspec: replicas: 1 selector: matchLabels: erp: k8s-test app: auth-s...

cat k8s-test-deploy.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: auth-server
  namespace: k8s-test
spec:
  replicas: 1
  selector:
    matchLabels:
      erp: k8s-test

      app: auth-server
  template:
    metadata:
      labels:
        erp: k8s-test
        app: auth-server
    spec:
      containers:
      - name: auth-server
        image: xxxx/auth-server:latest
        imagePullPolicy: Always
        envFrom:
        - secretRef:
            name: k8s-test-secret
            optional: true
        ports:
        - name: auth-server
          containerPort: 8100
      imagePullSecrets:
      - name: k8s-test-registry



部署

kubectl apply -f k8s-test-deploy.yaml

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐

  • 浏览量 903
  • 收藏 0
  • 0

所有评论(0)

查看更多评论 
已为社区贡献5条内容