1、创建docker秘钥
kubectl create secret docker-registry testharbor --docker-server=http://harbor.lianhang.jetair --docker-username=flycua --docker-password=Jetair0com --docker-email=zhangshangbj@163.com
2、创建serviceAccount
创建方法1
# 使用命令行创建serviceAccount
kubectl create serviceaccount mobile -n mobile
# 修改serviceaccount 清单配置
kubect edit serviceaccount mobile -n mobile
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: "2019-07-23T08:53:28Z"
name: mobile
namespace: mobile
resourceVersion: "91050"
selfLink: /api/v1/namespaces/mobile/serviceaccounts/mobile
uid: 569d7624-ad27-11e9-943e-0af46e9414b9
secrets:
- name: mobile-token-t7kzp
#在metadata平级下添加
imagePullSecrets:
- name: testharbor
创建方法2
#使用配置清单
vim mobile_serviceaccount.yml
apiVersion: v1
kind: ServiceAccount
metadata:
name: mobile
namespace: mobile
imagePullSecrets:
- name: testharbor
# 应用配置清单
kubectl apply -f mobile_serviceaccount.yml
文档更新时间: 2019-08-06 15:37 作者:张尚