# kubectl get configmap game-config-env-file -o yaml 1. 输出如下 apiVersion: v1 data: allowed: '"true"' enemies: aliens lives: "3" kind: ConfigMap metadata: creationTimestamp: "2020-01-17T07:32:05Z" name: game-config-env-file namespace: default resourceVersion: "10103588" selfLink: ...
kubectl get cm --all-namespaces-ojson|jq-r'.items[] | select(.metadata.name | test("deploy.*")) | .metadata.name' 统计数量 如果您想统计匹配特定条件的 ConfigMaps 的数量,可以使用jq: 代码语言:bash 复制 kubectl get cm --all-namespaces-ojson|jq'[.items[] | select(.data and (.data[...
1. 列出按容量排序的持久卷 (PV):kubectl get pv --sort-by=.spec.capacity.storage 2. 查看PV回收策略:kubectl get pv <pv-name> -o=jsonpath='{.spec.persistentVolumeReclaimPolicy}' 3. 列出所有存储类别:kubectl get storageclasses Ingress和服务网格诊断: 1. 列出命名空间中的所有Ingress:kubectl get ...
[root@master cm]# kubectl get configmap special-config -o go-template='{{.data}}' map[special.how:very][root@master cm]# 1. 2. 3. 4. 5. 2、文件创建 示例一:创建ENV文件,a.conf vim a.conf a=b c=d [root@master cm]# kubectl get configmap special-config1 -o go-template='{{....
kubectl get all 选项说明: --all-namespaces:false If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace. --allow-missing-template-keys:true If true, ignore any errors in templates when a field or map key ...
kubectl get 获取一个或多个资源对象的信息 kubectl edit 使用默认编辑器编辑服务器上定义的资源对象 kubectldelete通过json/yaml文件、标准舒服、资源名称或标签选择器来删除资源 (3)DeployCommands 部署命令 kubectl rollout 资源管理对象的部署 kubectl rollout-update 使用rc(replication controller)来做滚动恩星 ...
kubectl get resource_name 常见resource_name 代码语言:javascript 代码运行次数:0 复制Cloud Studio 代码运行 all certificatesigningrequests (缩写csr) clusterrolebindings clusterrol componentstatuses (缩写cs) configmaps (缩写cm) controllerrevisions cronjobs customresourcedefinition (缩写crd) daemonsets (缩写ds)...
(-let* ((config (or (kubernetes-state-namespaces state) (kubernetes-kubectl-await-on-async kubernetes-props state (-partial #'kubernetes-kubectl-get "namespaces"))) ((&alist 'items items) config)) (-map (-lambda ((&alist 'metadata (&alist 'name name))) name) items))) 2 changes...
kubectl config get-contexts Example Output: Copy CURRENT NAME CLUSTER AUTHINFO NAMESPACE * kubernetes-admin@kubernetes kubernetes kubernetes-admin Note:If the configuration contains more than one context in the configuration file, the currentdefaultcontext is indicated with an asterisk (*). The tutorial...
go get -u github.com/spf13/cobra@latest cobra库中的Command结构体的字段,用于定义命令行工具的行为和选项。它们的作用如下: Use: 命令名称。 Aliases: 命令的别名。 SuggestFor: 命令建议使用的单词列表。 Short: 命令简短描述。 GroupID: 命令所属的命令组。 Long: 命令详细描述。 Example: 命令的使用示例...