运行上述命令时,kubectl 会在当前目录下查找config-file.conf文件,并将文件内容存储在ConfigMap中以config-file.conf为键名的条目下 从文件夹创建ConfigMap $kubectl create configmap my-conf - -from-file=/path/to/dir 合并不同选项 创建ConfigMap时可以混合使用提到的所有选项 $kubectl create configmap my-config ...
kubectl create configmap game-config-3 --from-file=<my-key-name>=<path-to-file> 1. 1.3 指定目录创建 示例 configs 目录下的config-1和config-2内容如下所示: 创建命令: kubectl create configmap test-config3 --from-file=./configs 1. 结果如图中data内容所示: 可以看到指定目录创建时configmap内容中...
Create a new config map named my-config with key1=config1 and key2=config2 kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2 Create a new config map named my-config from the key=value pairs in the file kubectl create configmap my-config --from...
"kubectl create configmap myconfigmap --from-file=game-properties-key=game.properties" and the configMap is getting created successfully. I tried creating a secret using the example given in kubernetes documentation ie kubectl create secret generic db-user-pass --from-file=./username.txt --from-f...
This is a Bug Report Problem: Binary data not shown in kubectl describe configmap To reproduce: Create a config map from 2 files: one file is text, the other is a png. The text file will become a key in data field, whereas the png will b...
kubectl create -f docker-registry.yaml--edit --output-version=v1 -o json (2)kubectl expose 将资源暴露为新的Kubernetes Service。 指定deployment、service、replica set、replication controller或pod,并使用该资源的选择器作为指定端口上新服务的选择器。deployment 或 replica set只有当其选择器可转换为service...
kubectl create 通过yaml/json 文件或者标准输入创建一个资源对象,支持很多子命令 例如namespace pod deployment service等 kubectl expose 将json/yaml文件中定义的资源对象的端口暴露给新的service资源对象 kubectl run 创建并运行一个或多个容器镜像 kubectl set 配置资源对象设置特定功能 (2)Basic Commands(Intermediate...
命令式资源对象管理命令式管理类就是直接通过命令执行增删改的操作,除了删除资源外,下面的命令能用apply代替,kubernetes也建议尽量使用apply命令。创建资源kubectl create deployment my-dep --image=busybox # 创建一个deplpyme kubectl expose rc nginx --port=80 --target-port=8000 # 创建一个svc,暴露 ...
docker-registry.yaml in JSON then create the resource using the edited data.kubectl create-f docker-registry.yaml--edit-o jsonAvailableCommands:clusterroleCreateaClusterRole.clusterrolebinding 为一个指定的ClusterRole创建一个ClusterRoleBindingconfigmap 从本地 file,directory 或者 literal value 创建一个 ...
1.kubectl create 2.kubectl delete 3.kubectl describe cm mysql-myshop-config 查看k8s对象中的指...