You want to look at the size of the configuration files. which command would you use?
OverviewMany applications require configuration using some combination of configuration files, command line arguments, and environment variables. These configuration artifacts should be decoupled from image content in order to keep containerized applications portable. Show
The The For example: ConfigMap Object Definition
Configuration data can be consumed in pods in a variety of ways. A
Both users and system components may store configuration data in a Creating ConfigMapsYou can use the following command to create a $ oc create configmap The following sections cover the different ways you can create a Creating from DirectoriesConsider a directory with some files that already contain the data with which you want to populate a $ ls example-files game.properties ui.properties $ cat example-files/game.properties enemies=aliens lives=3 enemies.cheat=true enemies.cheat.level=noGoodRotten secret.code.passphrase=UUDDLRLRBABAS secret.code.allowed=true secret.code.lives=30 $ cat example-files/ui.properties color.good=purple color.bad=yellow allow.textmode=true how.nice.to.look=fairlyNice You can use the following command to create a $ oc create configmap game-config \ --from-file=example-files/ When the For example, the above command creates the following $ oc describe configmaps game-config Name: game-config Namespace: default Labels: You can see the two keys in the map are created from the file names in the directory specified in the command. Because the content of those keys may be large, the output of If
you want to see the values of the keys, you can $ oc get configmaps game-config -o yaml apiVersion: v1 data: game.properties: |- enemies=aliens lives=3 enemies.cheat=true enemies.cheat.level=noGoodRotten secret.code.passphrase=UUDDLRLRBABAS secret.code.allowed=true secret.code.lives=30 ui.properties: | color.good=purple color.bad=yellow allow.textmode=true how.nice.to.look=fairlyNice kind: ConfigMap metadata: creationTimestamp: 2016-02-18T18:34:05Z name: game-config namespace: default resourceVersion: "407"- selflink: /api/v1/namespaces/default/configmaps/game-config uid: 30944725-d66e-11e5-8cd0-68f728db1985 Creating from FilesYou can also pass the
You can also set the key to use for an individual file with the
Creating from Literal ValuesYou can also supply literal values for a
Use Cases: Consuming ConfigMaps in PodsThe following sections describe some uses cases when consuming Consuming in Environment Variables
ConfigMap with two environment variables
ConfigMap with one environment variable
You can consume the keys of this Sample pod specification configured to inject specific environment variables
When this pod is run, its output will include the following lines: SPECIAL_LEVEL_KEY=very log_level=INFO Setting Command-line ArgumentsA
To inject values into the command line, you must consume the keys you want to use as environment variables, as in the Consuming in Environment Variables use case. Then you can refer to them in a container’s command using the Sample pod specification configured to inject specific environment variables apiVersion: v1 kind: Pod metadata: name: dapi-test-pod spec: containers: - name: test-container image: gcr.io/google_containers/busybox command: [ "/bin/sh", "-c", "echo $(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ] env: - name: SPECIAL_LEVEL_KEY valueFrom: configMapKeyRef: name: special-config key: special.how - name: SPECIAL_TYPE_KEY valueFrom: configMapKeyRef: name: special-config key: special.type restartPolicy: Never When this pod is run, the output from the test-container container will be: Consuming in VolumesA
You have a couple different options for consuming this
When this pod is run, the output will be: You can also control the paths within the volume where
When this pod is run, the output will be: Example: Configuring RedisFor a real-world example, you can configure Redis using a maxmemory 2mb maxmemory-policy allkeys-lru If your configuration file is located at example-files/redis/redis-config, create a
Now, create a pod that uses this
The newly-created pod has a If you $ oc exec -it redis redis-cli 127.0.0.1:6379> CONFIG GET maxmemory 1) "maxmemory" 2) "2097152" 127.0.0.1:6379> CONFIG GET maxmemory-policy 1) "maxmemory-policy" 2) "allkeys-lru" RestrictionsA
The Kubelet only supports use of a Which command is used to view the configuration?Explanation. Use the command show running-config to look at the current configuration. This command will display the active configuration file in memory including saved configuration changes.
How do I find the config file on a Cisco router?Use the show running-config command to view the running configuration file. Use the show startup-config command to view the startup configuration file.
How can I see the configuration of a Cisco switch?On Cisco Router/Switches:. Type "terminal length 0" in privileged mode to set your terminal to display without any breaks.. Type "show run" or "show start" to show the applicable config. ... . To display the config without lengthy certificate data, use "show run brief ".. What command do you expect to use to copy the start configuration file to running configuration?Use the copy nvram:startup-config {ftp: | rcp: | tftp:} command to copy the startup configuration file to a network server. The configuration file copy can serve as a backup copy.
|