Kubernetes v1.15 版本的文档已不再维护。您现在看到的版本来自于一份静态的快照。如需查阅最新文档,请点击 最新版本。

文档
kubeadm 概述
Setup an extension API server
Accessing Clusters
Getting started
kubeadm init
安装 kubeadm
使用 kubeadm 创建一个单主集群
Use Port Forwarding to Access Applications in a Cluster
概念
概念
Taint 和 Toleration
日志架构
Kubernetes 中的代理
Kubernetes集群中使用Sysctls
Managing Compute Resources for Containers
Secret
云供应商
安装扩展(Addons)
概念模板示例
联邦
设备插件
证书
集群管理概述
Provide Load-Balanced Access to an Application in a Cluster
Tasks
Administer a Cluster
Access Clusters Using the Kubernetes API (EN)
Access Services Running on Clusters (EN)
Advertise Extended Resources for a Node (EN)
Autoscale the DNS Service in a Cluster (EN)
Change the default StorageClass (EN)
Change the Reclaim Policy of a PersistentVolume (EN)
Cluster Management (EN)
Configure Multiple Schedulers (EN)
Configure Out Of Resource Handling (EN)
Configure Quotas for API Objects (EN)
Control CPU Management Policies on the Node (EN)
Customizing DNS Service (EN)
Debugging DNS Resolution (EN)
Declare Network Policy (EN)
Developing Cloud Controller Manager (EN)
Encrypting Secret Data at Rest (EN)
Guaranteed Scheduling For Critical Add-On Pods (EN)
IP Masquerade Agent User Guide (EN)
Kubernetes Cloud Controller Manager (EN)
Limit Storage Consumption (EN)
Namespaces Walkthrough (EN)
Operating etcd clusters for Kubernetes (EN)
Reconfigure a Node's Kubelet in a Live Cluster (EN)
Reserve Compute Resources for System Daemons (EN)
Safely Drain a Node while Respecting the PodDisruptionBudget (EN)
Securing a Cluster (EN)
Set Kubelet parameters via a config file (EN)
Set up High-Availability Kubernetes Masters (EN)
Share a Cluster with Namespaces (EN)
Using a KMS provider for data encryption (EN)
Using CoreDNS for Service Discovery (EN)
Using NodeLocal DNSCache in Kubernetes clusters (EN)
Using sysctls in a Kubernetes Cluster (EN)
Extend kubectl with plugins (EN)
Manage HugePages (EN)
Schedule GPUs (EN)
Use a Service to Access an Application in a Cluster
删除 StatefulSet
授权概述
裸金属
使用 Salt 配置 Kubernetes 集群
Create an External Load Balancer
配置你的云平台防火墙
List All Container Images Running in a Cluster
Configure DNS for a Cluster
Federation - Run an App on Multiple Clusters
(EN)
ABAC 模式
Advanced Topics (EN)
Docker 用户使用 kubectl 命令指南
Docs smoke test page (EN)
Encrypting Secret Data at Rest
Foundational (EN)
Foundational (EN)
Intermediate (EN)
Intermediate (EN)
JSONPath 支持
kube-apiserver
kube-proxy
kube-scheduler
kubectl
kubectl概述
kubelet
Kubelet authentication/authorization
Kubernetes API访问控制
Kubernetes 对象管理
Search Results (EN)
StatefulSet 基本使用
TLS bootstrapping
Tools
Webhook Mode
使用 Calico 来提供 NetworkPolicy
使用 Romana 来提供 NetworkPolicy
使用 Service 把前端连接到后端
使用 Source IP
使用 Weave 网络来提供 NetworkPolicy
使用ConfigMap来配置Redis
使用Deployment运行一个无状态应用
使用准入控制插件
使用启动引导令牌(Bootstrap Tokens)认证
使用命令式的方式管理 Kubernetes 对象
关键插件 Pod 的调度保证
创建大规模集群
同 Pod 内的容器使用共享卷通信
在 Kubernetes 中配置私有 DNS 和上游域名服务器
在 Kubernetes 集群中使用 sysctl
基于 Persistent Volumes 搭建 WordPress 和 MySQL 应用
基于Replication Controller执行滚动升级
声明网络策略
多区域运行
安全考虑
对 DaemonSet 执行回滚
将 kubeadm 集群在 v1.8 版本到 v1.9 版本之间升级/降级
应用资源配额和限额
弹缩StatefulSet
控制节点上的CPU管理策略
改变默认 StorageClass
更改 PersistentVolume 的回收策略
知名标签(Label)、注解(Annotation)和 Taints
示例:使用 Stateful Sets 部署 Cassandra
管理Service Accounts
管理巨页(HugePages)
节点设置校验
设置 Pod CPU 和内存限制
访问集群上运行的服务
证书轮换
调度 GPU
运行 ZooKeeper, 一个 CP 分布式系统
运行一个单实例有状态应用
通过配置文件设置 Kubelet 参数
配置命名空间下pod总数
配置对多集群的访问
集群管理
静态Pods

Edit This Page

JSONPath 支持

JSONPath 模板由 {} 包起来的 JSONPath 表达式组成。 除了原始的 JSONPath 语法之外,我们还添加了三个函数:

  1. $ 运算符是可选的,因为表达式默认情况下始终从根对象开始。
  2. 我们可以使用 "" 来引用 JSONPath 表达式中的文本。
  3. 我们可以使用 range 运算符来迭代列表。

结果对象使用 String() 函数打印。

给定输入:

{
  "kind": "List",
  "items":[
    {
      "kind":"None",
      "metadata":{"name":"127.0.0.1"},
      "status":{
        "capacity":{"cpu":"4"},
        "addresses":[{"type": "LegacyHostIP", "address":"127.0.0.1"}]
      }
    },
    {
      "kind":"None",
      "metadata":{"name":"127.0.0.2"},
      "status":{
        "capacity":{"cpu":"8"},
        "addresses":[
          {"type": "LegacyHostIP", "address":"127.0.0.2"},
          {"type": "another", "address":"127.0.0.3"}
        ]
      }
    }
  ],
  "users":[
    {
      "name": "myself",
      "user": {}
    },
    {
      "name": "e2e",
      "user": {"username": "admin", "password": "secret"}
    }
  ]
}
函数 描述 示例 结果
text 纯文本 kind is {.kind} kind is List
@ 当前对象 {@} 与输入相同
. 或者 [] 子运算符 {.kind} 或者 {['kind']} List
.. 递归下降 {..name} 127.0.0.1 127.0.0.2 myself e2e
* 通配符,获取所有对象 {.items[*].metadata.name} [127.0.0.1 127.0.0.2]
[start:end :step] 下标运算符 {.users[0].name} myself
[,] 并集运算符 {.items[*]['metadata.name', 'status.capacity']} 127.0.0.1 127.0.0.2 map[cpu:4] map[cpu:8]
?() 过滤 {.users[?(@.name=="e2e")].user.password} secret
range, end 迭代列表 {range .items[*]}[{.metadata.name}, {.status.capacity}] {end} [127.0.0.1, map[cpu:4]] [127.0.0.2, map[cpu:8]]
'' 引用解释执行字符串 {range .items[*]}{.metadata.name}{'\t'}{end} 127.0.0.1 127.0.0.2

反馈