Difference between revisions of "Secret.yml"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<pre>
+
{{lc}}
echo -n 'admin' | base64
+
[[apiVersion]]: v1
YWRtaW4=
+
[[kind: Secret]]
echo -n '1f2d1e2e67df' | base64
+
metadata:
MWYyZDFlMmU2N2Rm
+
  name: mysecret
Write a Secret that looks like this:
+
type: [[Opaque]]
</pre>
+
data:
 +
  username: YWRtaW4=
 +
  password: MWYyZDFlMmU2N2Rm
  
 
  apiVersion: v1
 
  apiVersion: v1
  '''kind: Secret'''
+
  kind: Secret
 
  metadata:
 
  metadata:
 
   name: mysecret
 
   name: mysecret
 +
  namespace: mynamespace
 
  type: Opaque
 
  type: Opaque
 
  data:
 
  data:
Line 16: Line 19:
 
   password: MWYyZDFlMmU2N2Rm
 
   password: MWYyZDFlMmU2N2Rm
  
 +
Create secret:
 +
* <code>[[kubectl apply -f secret.yml]]</code>
  
<code>[[kubectl apply]] -f secret.yml</code>
+
== Related commands ==
 
+
* <code>[[kubectl create secret]]</code>
 
+
* <code>[[kubectl apply -f ./secret.yaml]]</code>
 +
* [[Helm]] [[redis]] [[redis/templates/secret.yaml]]
  
 
== See also ==
 
== See also ==
* [[secrets]]
+
* {{Kubernetes secrets}}
 
 
  
 
[[Category:Kubernetes]]
 
[[Category:Kubernetes]]

Latest revision as of 07:21, 10 March 2023

apiVersion: v1
kind: Secret
metadata:
  name: mysecret
type: Opaque
data:
  username: YWRtaW4=
  password: MWYyZDFlMmU2N2Rm
apiVersion: v1
kind: Secret
metadata:
  name: mysecret
  namespace: mynamespace
type: Opaque
data:
  username: YWRtaW4=
  password: MWYyZDFlMmU2N2Rm

Create secret:

Related commands[edit]

See also[edit]

Advertising: