Short note about creating the secret in kubernetes.

First you got to encode the text

echo sample-secret |base64

Next create secret.yaml file with the following contexts:

apiVersion: v1
kind: Secret
metadata:
  name: my-secret-name
type: Opaque
data:
  secret-key1: c2FtcGxlLXNlY3JldAo=
  secret-key2: c2FtcGxlLXNlY3JldAo=
  secret-key2: c2FtcGxlLXNlY3JldAo=

Next run kubectl to apply the change:

kubectl apply -f secret.yaml