Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes secret types

Tags:

kubernetes

Where are documented the "types" of secrets that you can create in kubernetes?

looking at different samples I have found "generic" and "docker-registry" but I have no been able to find a pointer to documentation where the different type of secrets are documented.

I always end in the k8s doc: https://kubernetes.io/docs/concepts/configuration/secret/ https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/

Thank you.

like image 722
Jxadro Avatar asked Apr 02 '18 15:04

Jxadro


People also ask

What types of secrets can be created in Kubernetes?

There are several options to create a Secret: create Secret using kubectl command. create Secret from config file. create Secret using kustomize.

What is Type opaque in Kubernetes secrets?

type: Opaque means that from kubernetes's point of view the contents of this Secret is unstructured, it can contain arbitrary key-value pairs. In contrast, there is the Secret storing ServiceAccount credentials, or the ones used as ImagePullSecret . These have a constrained contents.

What are Kubernetes secrets used for?

A Kubernetes secret is an object storing sensitive pieces of data such as usernames, passwords, tokens, and keys. Secrets are created by the system during an app installation or by users whenever they need to store sensitive information and make it available to a pod.


2 Answers

Here is a list of 'types' from the source code:

SecretTypeOpaque SecretType = "Opaque" [...] SecretTypeServiceAccountToken SecretType = "kubernetes.io/service-account-token" [...] SecretTypeDockercfg SecretType = "kubernetes.io/dockercfg" [...] SecretTypeDockerConfigJson SecretType = "kubernetes.io/dockerconfigjson" [...] SecretTypeBasicAuth SecretType = "kubernetes.io/basic-auth" [...] SecretTypeSSHAuth SecretType = "kubernetes.io/ssh-auth" [...] SecretTypeTLS SecretType = "kubernetes.io/tls" [...] SecretTypeBootstrapToken SecretType = "bootstrap.kubernetes.io/token" 
like image 65
Eyal Levin Avatar answered Sep 19 '22 15:09

Eyal Levin


In the kubectl docs you can see some of the available types. Also, in the command line

$ kubectl create secret --help Create a secret using specified subcommand.  Available Commands:   docker-registry Create a secret for use with a Docker registry   generic         Create a secret from a local file, directory or literal value   tls             Create a TLS secret  Usage:   kubectl create secret [flags] [options]  Use "kubectl <command> --help" for more information about a given command. Use "kubectl options" for a list of global command-line options (applies to all commands). 
like image 36
Jose Armesto Avatar answered Sep 22 '22 15:09

Jose Armesto