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

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

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.

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

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

50+ Useful Kubernetes Tools for 2020 - Part 2

Our original Kubernetes tool list was so popular that we've curated another great list of tools to help you improve your functionality with the platform.

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

Kubernetes in the Cloud: Strategies for Effective Multi Cloud Implementations

This article explains how you can leverage Kubernetes to reduce multi cloud complexities and improve stability, scalability, and velocity.

Multi-cloud Spending: 8 Tips To Lower Cost

Mismanagement of multi-cloud expense costs an arm and leg to business and its management has become a major pain point. Here we break down some crucial tips to take some of the management challenges off your plate and help you optimize your cloud spend.

Kubernetes Cost Savings By Reducing The Number Of Clusters

Reducing the number of clusters can save a lot of cost without affecting the stability of your system. Finding the right answer to this question is as not easy as having many clusters has advantages and disadvantages compared to running only one or a few clusters, as discussed in this article.