22.2.3. 从 Literal 值创建
您还可以为 ConfigMap
提供字面值。--from-literal
选项使用 key=value
语法,允许直接在命令行中提供字面值:
创建指定字面值的
ConfigMap
:$ oc create configmap special-config \ --from-literal=special.how=very \ --from-literal=special.type=charm
验证结果:
$ oc get configmaps special-config -o yaml apiVersion: v1 data: special.how: very special.type: charm kind: ConfigMap metadata: creationTimestamp: 2016-02-18T19:14:38Z name: special-config namespace: default resourceVersion: "651" selflink: /api/v1/namespaces/default/configmaps/special-config uid: dadce046-d673-11e5-8cd0-68f728db1985