Search code examples
containersairflowkubectlkubernetes-secretsmicrok8s

Edit a microk8s secret using kubectl in airflow


I am trying to edit a secret that we have stored in airflow server using microk8s kubectl.

At the moment all I can do is find the coded secret using:

microk8s kubectl get secrets/MySecret -o jsonpath='{data}'

I want to edit the secret called 'host' within MySecret. Any advice on how to do this using the command line? I have tried edit secret command but I can't seem to interact and amend the code. I know I have done this before using the command line but can't remember how unfortunately.

Thanks in advance for any help on this!


Solution

  • Solution:

    kubectl get secret mysecret -o json | jq '.data["secrect_to_change"] = "base64-encoded_password"' | kubectl apply -f