Kubectl get secrets 디코딩

Jmnote (토론 | 기여)님의 2019년 3월 29일 (금) 19:23 판 (새 문서: ==개요== ==#== <source lang='console'> $ cat secret.yaml apiVersion: v1 kind: Secret metadata: name: test-secret type: Opaque data: username: YWRtaW4= password: YTYyZmpiZDM3O...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

2 #

$ cat secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: test-secret
type: Opaque
data:
  username: YWRtaW4=
  password: YTYyZmpiZDM3OTQyZGNz
$ kubectl create -f secret.yaml
secret/test-secret created
$ kubectl get secrets test-secret
NAME          TYPE      DATA      AGE
test-secret   Opaque    2         36s
$ kubectl get secrets test-secret
NAME          TYPE      DATA      AGE
test-secret   Opaque    2         36s
$ kubectl get secrets test-secret -oyaml
apiVersion: v1
data:
  password: YTYyZmpiZDM3OTQyZGNz
  username: YWRtaW4=
kind: Secret
metadata:
  creationTimestamp: 2019-03-29T10:18:34Z
  name: test-secret
  namespace: default
  resourceVersion: "414"
  selfLink: /api/v1/namespaces/default/secrets/test-secret
  uid: 02495370-520c-11e9-8865-0242ac11000d
type: Opaque
$ kubectl get secrets test-secret -ojson |jq -r '.data[]'|while IFS=$'\n' read -r l; do echo $l|base64 -d;echo;done
a62fjbd37942dcs
admin
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}