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