Skip to content

Can ArgoCD read base64 encoded Cluster Secret? #5428

Answered by jannfis
0xDones asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @dpolicastro,

stringData is really just a helping shortcut that lets you create a secret without having to base64 encode the secret's data first. When you create a Secret with stringData instead of data, Kubernetes will base64 encode all values and replace stringData with data.

A simple example:

$ cat test-secret.yaml 
apiVersion: v1
kind: Secret
metadata:
  name: test-secret
stringData:
  testkey: testdata
$ kubectl apply -f test-secret.yaml 
secret/test-secret created
$ kubectl get secret test-secret -o jsonpath='{.data.testkey}' | base64 -d && echo
testdata

So long story, short answer: Yes, what you want to do is possible :)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@0xDones
Comment options

Answer selected by 0xDones
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants