kubernetesイメージ権限取得プロセス

2107 ワード

[wgpark-pcg@wgpark-bastion ~]$ kubectl create secret docker-registry test2 \
> --docker-server=asia-northeast3-docker.pkg.dev/ba040-324206/pcg-repository/catalogue \
> --docker-username=_json_key \
> --docker-password="$(cat ./ba040-324206-4557a7e0cee6.json)" \
> --docker-email=[email protected]
secret/test2 created
[wgpark-pcg@wgpark-bastion ~]$ kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "test2"}]}'
serviceaccount/default patched
[wgpark-pcg@wgpark-bastion ~]$ kubectl get serviceaccount default
NAME      SECRETS   AGE
default   1         26m
[wgpark-pcg@wgpark-bastion ~]$ kubectl get serviceaccount default -o yaml
apiVersion: v1
imagePullSecrets:
- name: test2
kind: ServiceAccount
metadata:
  creationTimestamp: "2021-12-01T09:04:34Z"
  name: default
  namespace: sock-shop
  resourceVersion: "75645"
  uid: 3161bd0f-5fc2-4d6c-bd3c-5107341a82cd
secrets:
- name: default-token-cxmjp