kubectl create configmap --from-file 命令允许用户从本地文件系统上的文件或目录创建 Kubernetes ConfigMap。ConfigMap 是一种 Kubernetes 资源,用于将配置数据以键值对的形式存储,以便在 Pod 中使用。 如何使用 --from-file 选项: 指定文件:使用 --from-file=[fileName] 形式,可以将单个文件的内容创建为一个 Con...
1. 使用指定的keys创建一个名为exp-config的configmap: kubectl create configmap exp-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt 1.
通过直接在命令行中指定configmap参数创建,即--from-literal 通过指定文件创建,即将一个配置文件创建为一个ConfigMap--from-file=<文件> 通过指定目录创建,即将一个目录下的所有配置文件创建为一个ConfigMap,--from-file=<目录> 事先写好标准的configmap的yaml文件,然后kubectl create -f 创建 1.1 通过命令行参数--...
kubectl create -f xxx.yaml 2.1.2、适合没有部署快速生成 yaml 资源编排文件 kubectl create <resource_type> <Pod_name> --image=<image_name> -o yaml --dry-run > <fileName>.yaml 2.1.3、创建ConfigMap kubectl create configmap <cm_name> --from-file=<fileName>.properties 2.2、expose 获取一个...
createkubectl create -f filename [flags]从配置文件或 stdin 中创建资源对象 exposekubectl expose (-f filename | type name) [--port=port] [--protocol=tcp|udp|sctp] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type] [options]将已经存在...
$ job NAME --image=image [--from=cronjob/name] -- [COMMAND] [args...] kubectl create job my-job --image=busybox -- date $ deployment NAME --image=image [--dry-run] kubectl create deployment my-dep --image=busybox $ configmap NAME [--from-file=[key=]source] [--from-literal...
I am trying to create a configmap from a file using the "kubectl create configmap myconfigmap --from-file=game.properties" The game.properties consists of the following key value pairs enemies.name=aliens lives.count=3 enemies.cheat=true enemies.cheat=noGoodRotten secret.code=UUDDLRLRBABAS ...
4.ConfigMap映射 # 创建configMapkubectl create configmap nginx-conf --from-file=nginx.conf# 查看configMapkubectl get configmaps# yaml文件内配置configMap: name: nginx-conf#ConfigMap名字
Delete the configmap if it exists and create a new one with updated values.useConfigMapFile - Use file boolean. Optional. Use when command != login && command != logout. Default value: false. Creates a ConfigMap from an individual file or from multiple files by specifying a directory.confi...
kubectl create -f docker-registry.yaml --edit -o json Available Commands: clusterrole Create a ClusterRole. clusterrolebinding Create a ClusterRoleBinding for a particular ClusterRole configmap Create a configmap from a local file, directory or literal value cronjob Create a cronjob with the specified...