diff --git a/rtfd/public/kubernetes/index.rst b/rtfd/public/kubernetes/index.rst index 83f083d..79038d3 100644 --- a/rtfd/public/kubernetes/index.rst +++ b/rtfd/public/kubernetes/index.rst @@ -339,3 +339,110 @@ Write kubectl \ delete cronjob my-cronjob \ -n my-namespace + +ConfigMaps +========== + +From: +* environment variables file +* file +* key and value + +Read +---- + +.. code:: shell + + kubectl \ + get configmap \ + -n my-namespace + +.. code:: shell + + kubectl \ + get configmap my-configmap \ + -o yaml \ + -n my-namespace + +Write +----- + +.. code:: shell + + kubectl \ + create configmap my-configmap \ + --from-literal 'uid=1000' \ + -n my-namespace + +.. code:: shell + + kubectl \ + create configmap my-configmap \ + --from-file 'my-configmap.txt' \ + -n my-namespace + +.. code:: shell + + kubectl \ + create configmap my-configmap \ + --from-env-file 'my-configmap.env' \ + -n my-namespace + +.. code:: shell + + kubectl \ + delete configmap my-configmap \ + -n my-namespace + +Pod YAML configurations +^^^^^^^^^^^^^^^^^^^^^^^ + +.. code:: yaml + + apiVersion: v1 + kind: Pod + metadata: + name: my-pod + spec: + containers: + - name: my-container + image: my-image + volumeMounts: + - name: my-volumemounts + mountPath: /etc/my-volumemounts.txt + volumes: + - name: my-volume + configMap: + name: my-configmap + +.. code:: yaml + + apiVersion: v1 + kind: Pod + metadata: + name: my-pod + spec: + containers: + - name: my-container + image: my-image + env: + - name: my-env + valueFrom: + configMapKeyRef: + name: my-configmap + key: my-key + +.. code:: yaml + + apiVersion: v1 + kind: Pod + metadata: + name: my-pod + spec: + containers: + - name: my-container + image: my-image + envFrom: + - configMapRef: + name: my-configmap +