1:先创建secret

kubectl create secret docker-registry myregistrykey --docker-server=192.168.1.222 --docker-username=admin --docker-password=Harbor12345 --docker-email=DOCKER_EMAIL

 

2:在yaml中加入secret

apiVersion: extensions/v1beta1

kind: Deployment

metadata:

  name: kube-node

spec:

  replicas: 2

  template:

    metadata:

      labels:

        app: springboot

    spec:

      containers:

        - name: springboot-node

          image: 192.168.1.222/hudechun/springboot

          ports:

            - containerPort: 8081
      imagePullSecrets:
       - name: myregistrykey

Logo

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

更多推荐