Difference between revisions of "Kind: Secret"

From wikieduonline
Jump to navigation Jump to search
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
  
 
+
== Types ==
https://kubernetes.io/docs/concepts/configuration/secret/#secret-types
 
[[type: Opaque]]
 
[[type: kubernetes.io/service-account-token]]
 
 
 
 
 
 
https://kubernetes.io/docs/concepts/configuration/secret/#secret-types
 
https://kubernetes.io/docs/concepts/configuration/secret/#secret-types
  Opaque                                 arbitrary user-defined data
+
  {{secret types TOC}}
[[kubernetes.io/service-account-token]] ServiceAccount token
 
kubernetes.io/dockercfg                 serialized ~/.dockercfg file
 
kubernetes.io/dockerconfigjson         serialized ~/.docker/config.json file
 
[[kubernetes.io/basic-auth]]         credentials for basic authentication
 
kubernetes.io/ssh-auth                 credentials for SSH authentication
 
kubernetes.io/tls                 data for a TLS client or server
 
bootstrap.kubernetes.io/token         bootstrap token data
 
  
  
== Example ==
+
== Examples ==
 
https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/
 
https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/
 
  kubectl apply -f - <<EOF
 
  kubectl apply -f - <<EOF
Line 27: Line 15:
 
   annotations:
 
   annotations:
 
     kubernetes.io/service-account.name: default
 
     kubernetes.io/service-account.name: default
  type: kubernetes.io/service-account-token
+
  type: [[kubernetes.io/service-account-token]]
 
  EOF
 
  EOF
 +
 +
 +
https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#create-a-secret
 +
apiVersion: v1
 +
kind: Secret
 +
metadata:
 +
  name: test-secret
 +
[[data:]]
 +
  username: bXktYXBw
 +
  password: Mzk1MjgkdmRnN0pi
  
 
== Related ==
 
== Related ==
 
* <code>[[secret.yml]]</code>
 
* <code>[[secret.yml]]</code>
 
* <code>[[kubectl create secret]]</code>
 
* <code>[[kubectl create secret]]</code>
 +
* [[Pull an Image from a Private Registry in Kubernetes]]
 +
* [[1password Kubernetes operator]]
  
 
== See also ==
 
== See also ==

Latest revision as of 11:08, 15 October 2024

Types[edit]

https://kubernetes.io/docs/concepts/configuration/secret/#secret-types

 Opaque	                                 arbitrary user-defined data
kubernetes.io/service-account-token	ServiceAccount token
kubernetes.io/dockercfg	                serialized ~/.dockercfg file
kubernetes.io/dockerconfigjson	        serialized ~/.docker/config.json file
kubernetes.io/basic-auth	        credentials for basic authentication
kubernetes.io/ssh-auth	                credentials for SSH authentication
kubernetes.io/tls	                data for a TLS client or server
bootstrap.kubernetes.io/token	        bootstrap token data
istio.io/key-and-cert


Examples[edit]

https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/

kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
  name: default-token
  annotations:
    kubernetes.io/service-account.name: default
type: kubernetes.io/service-account-token
EOF


https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#create-a-secret

apiVersion: v1
kind: Secret
metadata:
  name: test-secret
data:
  username: bXktYXBw
  password: Mzk1MjgkdmRnN0pi

Related[edit]

See also[edit]

Advertising: