Creating secrets and config maps
You can use the Secret object type to provide a mechanism to hold sensitive information such as passwords, Red Hat OpenShift Container Platform client configuration files, dockercfg files, and private source repository credentials. Secrets decouple sensitive content from pods.
You can mount secrets into containers by using a volume plugin or the system can use secrets to perform actions on behalf of a pod.
Config maps are similar to secrets, but are designed to support working with strings that do not contain sensitive information. The ConfigMap object holds key-value pairs of configuration data that can be consumed in pods or used to store configuration data for system components such as controllers.
For example, to add a secret to your deployment so that it can access a private image repository, use the following procedure.
-
Log in to the Red Hat OpenShift Container Platform web console.
-
Create a new project.
-
Navigate to Resources → Secrets and create a new secret. Set
Secret TypetoImage SecretandAuthentication TypetoImage Registry Credentialsto enter credentials for accessing a private image repository. -
When creating a deployment (for example, from the Add to Project → Deploy Image page), set the
Pull Secretto your new secret.