一、创建 Service Account
root@k8s-master pv]
serviceaccount/xjy created
[root@k8s-master pv]
apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: "2021-11-16T02:17:24Z"
name: xjy
namespace: default
resourceVersion: "236090"
uid: a43c6d88-1633-4cc2-ac03-059f6767a197
secrets:
- name: xjy-token-l4cnc
[root@k8s-master pv]
apiVersion: v1
data:
ca.crt: (BASE64)
token: (BASE64)
kind: Secret
metadata:
annotations:
kubernetes.io/service-account.name: xjy
kubernetes.io/service-account.uid: a43c6d88-1633-4cc2-ac03-059f6767a197
creationTimestamp: "2021-11-16T02:17:24Z"
name: xjy-token-l4cnc
namespace: default
resourceVersion: "236089"
uid: ff3f307e-0d3c-4380-bbd5-2e7a42e197ac
type: kubernetes.io/service-account-token
二、添加 ImagePullSecrets
apiVersion: v1
imagePullSecrets:
- name: xiejiayi-secret
kind: ServiceAccount
metadata:
creationTimestamp: "2021-11-16T02:17:24Z"
name: xjy
namespace: default
resourceVersion: "236738"
uid: a43c6d88-1633-4cc2-ac03-059f6767a197
secrets:
- name: xjy-token-l4c