Hi Folks, what is the imperative command for adding more secrets into existing s . . .

Anil:
Hi Folks, what is the imperative command for adding more secrets into existing secret name as I forgot to add one more secret while using this: kubectl create secret generic db-secret --from-literal=DB_Host=sql01

Vasile Cristescu:
kubectl edit secret <secret> … for an existing one … or --from-literal as many times as needed

1 Like

Anil:
it did not work using imperative: kubectl edit secret db-secret --from-literal=DB_User=root
Error: unknown flag: --from-literal

Vasile Cristescu:
when you edit the existing secret (kubectl edit secret whatever> you don’t add any other argument

Vasile Cristescu:
you just enter into edit mode and add your new key and value

Vasile Cristescu:
–from-literal is used when you create the secret

Anil:
I got your point but I was trying to edit on the fly without opening the editor

Anil:
Thank you

Matthew Robinson:
In the time crunch of the exam it might be quicker to delete the secret, use the command history to get the create command back and then add additional --from-literal options.