This is one of the numerous posts by TechCommanders in a series for studying for the Certified Kubernetes Administrator (CKA) Exam.

Become a Certified Kubernetes Administrator (CKA)!

We need to configure applications and that need a reference to some special bits such as our API Keys, secret keys, and some tokens. Our project like a website or app might be tunable using configuration settings. For example: We can have a PHP.ini file or we can have environment variables and flags that change logic in your app.

If you are developing for a long time then you have always wished or tried to hardcode these references in your code. In small applications, this can be acceptable but in a large application, it is not acceptable as well as becomes unmanageable very quickly.

This problem is easily solved with the help of environment variable and configuration files. You can easily store your references in these and your application can extract these from the central location. Even if they are changed you need to make changes in only one file rather than digging up every place where you added these variables or values.

So, this problem comes back when we are using dockers or building a microservice with containers. Docker allows you to specify the environment variables in Dockerfile but what if you want to use the same variable in two different docker file. If you try to use the host environment what will be your comeback in case you are running a cluster with multiple machines?

To understand this more clearly we will take examples of multiple ways we can store environment variables and keep on upgrading them as we move forward.

The first way is to take the hardcoded file which means you will hardcode all the variables, references in a file, and access them whenever needed.

#kubernetes-cluster #cloud-native #devops #kubernetes #devops-training

Understand ConfigMaps = Configure a Pod to Use a ConfigMap — CKA Exam Preparation Series
1.40 GEEK