0% found this document useful (0 votes)
12 views12 pages

Manage Application Configuration in K8s

The document discusses different ways to manage application configuration in Kubernetes including ConfigMaps, Secrets, environment variables, and configuration volumes. ConfigMaps are used to store non-sensitive configuration data in key-value pairs, while Secrets store sensitive data like passwords. Configuration can be passed to containers via environment variables or by mounting ConfigMaps and Secrets as volumes.

Uploaded by

Ajit W
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views12 pages

Manage Application Configuration in K8s

The document discusses different ways to manage application configuration in Kubernetes including ConfigMaps, Secrets, environment variables, and configuration volumes. ConfigMaps are used to store non-sensitive configuration data in key-value pairs, while Secrets store sensitive data like passwords. Configuration can be passed to containers via environment variables or by mounting ConfigMaps and Secrets as volumes.

Uploaded by

Ajit W
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Application Config.

in
Kubernetes
Manage Application Configuration
Application Config.

➔ What is Application
Configuration

➔ ConfigMaps

➔ Secrets

➔ Environment Variables

➔ Configuration Volumes

➔ Hands On Lab
Application Configuration
➢ Most people already understand "configuration" as settings
that influence the operation of an application.

➢ Kubernetes allows user to pass dynamic configuration


values to application at Runtime.

➢ These dynamic Configuration helps user to control the


Application Flow.
ConfigMap
➢ Keep the Non-Sensitive Data in ConfigMap, which can be passed
to Container Application.

➢ Config Map Store Data in Key-Value format.

➢ ConfigMaps allow you to separate your configurations from your


Pods and components.

➢ ConfigMap helps to makes configurations easier to change and


manage, and prevents hardcoding configuration data to Pod
specifications.
ConfigMap Commands
➢ Config Map via Config File.

kubectl create configmap [NAME] --from-file [/PATH/TO/ FILE.PROPERTIES] --from-file


[/PATH/TO/FILE2.PROPERTIES]

kubectl create configmap [NAME] --from-file [/PATH/TO/ DIRECTORY]

➢ Get ConfigMap via CLI.

kubectl get configmap <Config_map_name> -o yaml/json


Secrets
➢ Secrets are similar to ConfigMap but designed to keep the
Sensitive Data.

➢ Create Secrets from file.


kubectl create secret generic db-user-pass --from-file=./username.txt
—from-file=./password.txt

➢ Note : Special characters such as $, \, *, and ! require


escaping.
Secrets
➢ Get Secrets.
kubectl get secrets

➢ Describe Secrets.

kubectl describe secrets <Secret_name>


K8s Secrets
➢ Sample Secrets YAML file.

apiVersion: v1
kind: Secret
metadata:
name: mysecret-manifest
type: Opaque
data:
username: YW5zaHVsY2hhdWhhbg==
password: VGVzdGt1VybmV0ZXMxMjM0NQ==
Pass ConfigMap and Secrets to Containers

➢ User can pass Secrets and Config Map spec:


containers:
to Container using Environment
- ...
Variables. env:
- name: SPECIAL_LEVEL_KEY
valueFrom:
configMapKeyRef:
name: special-config
$ENV_VARAIABLE key: special.how

Container Process
Pass ConfigMap and Secrets to Containers

➢ Config Mount Volume is another way volumes:


- name: config-volume
to pass Config Data and Secrets to
configMap:
Containers. name: special-config
➢ Using this Config Data will be
available in Files to Container File
System.
Hands On Demonstration
Thank You...
Don’t be the Same! Be Better!!!

You might also like