Creating generic secret - using literal method kubectl create secret generic literalsecret --from-literal=pass=P455W0RD Creating generic secret - using file method kubectl create secret generic filesecret --from-file=./credentials.yml View secret using CLI kubectl get secret literalsecret -o yaml vi secret-encoded.yaml apiVersion: v1 data: pass: UDQ1NVcwUkQ= user: YWRtaW4= kind: Secret metadata: creationTimestamp: "2021-11-12T17:12:55Z" name: literalsecret namespace: default type: Opaque vi secret-string.yaml apiVersion: v1 kind: Secret metadata: name: literalsecret type: Opaque stringData: username: admin password: P455W0RD