k8s 拉取私有库镜像

首先配置私有仓库harbor的secret:

# kubectl create secret docker-registry registry-secret --namespace=default \

--docker-server=https://private-registry.domain.com --docker-username=username \

--docker-password=password [email protected]

配置文件调用:

kind: Deployment

apiVersion: extensions/v1beta1

metadata:

  name: service-test

  namespace: default

  labels:

    app: service-test

spec:

  replicas: 2

  template:

    metadata:

      labels:

        app: service-test

    spec:

      containers:

      - image: private-registry.domain.com/test-private/service-test:1

        name: service-test

        ports:

        - containerPort: 80

      imagePullSecrets:

      - name: registry-secret

你可能感兴趣的:(k8s 拉取私有库镜像)