Bootstrap FreeKB - OpenShift - Edit Config Map using the oc edit command
OpenShift - Edit Config Map using the oc edit command

Updated:   |  OpenShift articles

If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.

There are different ways to configure a container with environment variables.

Config Maps are used to:

  • mount configuration files in a container
  • create environment variables in a container
  • create command line option arguments in a container

Secrets are similar, used to create variables that contain encoded data (e.g. passwords). In this way, if a change is needed to a configuration file, variable, or command line option argument, you just need to update the config map or secret as opposed to having to make the change to your applications or deployments.

 

 

The oc get configmaps command can be used to list the config maps in a namespace.

~]$ oc get configmaps --namespace default
NAME        DATA      AGE
krb5-conf   1         44d

 

The oc describe configmap command can be used to show the files, variables, and command line options that are defined in the config map.

~]$ oc describe configmap krb5-conf   
Name:         krb5-conf
Namespace:    myproject
Labels:       <none>
Annotations:  <none>

Data
====
krb5.conf:
----
[libdefaults]
 default_realm = DEFAULT.EXAMPLE.COM
 
[realms]
 DEFAULT.EXAMPLE.COM = {
  kdc = server1.default.example.com
  kdc = server2.default.example.com
 }
  
[domain_realm]
 default.example.com = DEFAULT.EXAMPLE.COM
 .default.example.com = DEFAULT.EXAMPLE.COM

Events:  <none>

 

The oc edit command can be used to edit the config map.

oc edit configmap krb5-conf 

 

If the edit is successful, meaning there are no syntax errors, something like this should be returned.

configmap/krb5-conf edited

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter eb2079 in the box below so that we can be sure you are a human.