Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit f048e2e6 authored by Marc Beninca's avatar Marc Beninca
Browse files

kube/secrets

parent 2f235cd4
No related branches found
No related tags found
No related merge requests found
......@@ -411,8 +411,8 @@ Pod YAML configurations
- name: my-container
image: my-image
volumeMounts:
- name: my-volumemounts
mountPath: /etc/my-volumemounts.txt
- name: my-volume
mountPath: /var/lib/my-volume
volumes:
- name: my-volume
configMap:
......@@ -448,3 +448,91 @@ Pod YAML configurations
envFrom:
- configMapRef:
name: my-configmap
Secrets
=======
* generic
* docker-registry
* tls
From:
* environment variables file
* file
* key and value
Read
----
.. code:: shell
kubectl \
get secrets \
-n my-namespace
Write
-----
.. code:: shell
kubectl \
create secret generic my-secret \
--from-literal 'username=user' \
--from-literal 'password=1234' \
-n my-namespace
.. code:: shell
kubectl \
create secret generic my-secret \
--from-file 'my-secret.txt' \
-n my-namespace
.. code:: shell
kubectl \
create secret generic my-secret \
--from-env-file 'my-secret.env' \
-n my-namespace
.. code:: shell
kubectl \
delete secret my-secret \
-n my-namespace
.. code:: yaml
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: my-image
volumeMounts:
- name: my-secret-volume
mountPath: /var/lib/my-secret-volume
volumes:
- name: my-secret-volume
secret:
secretName: my-secret
.. code:: yaml
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: my-image
env:
- name: username
valueFrom:
secretKeyRef:
name: username
key: username
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment