- try creating using imperative command using --from-literal option
- try creating declaratively
- As an ENV ( All secrets as an env variable )
- As a Single ENV
- As Volume
Step1.
kubectl create secret generic imperative-secret \
--from-literal=username=admin \
--from-literal=password='changeme'
Step2.
kubectl apply -f Secret-declaratively.yml
NOTE: You can only put base64 value in yml file for username and password.
Step3.
kubectl apply -f secret-for-all-env-pod.yml
Setp4.
kubectl apply -f secret-for-one-env-pod.yml
Setp5.
kubectl apply -f secret-as-volume-for-pod.yml