diff --git a/_data/concepts.yml b/_data/concepts.yml index 8eaab9e39e..0a0fc14143 100644 --- a/_data/concepts.yml +++ b/_data/concepts.yml @@ -24,6 +24,7 @@ toc: - title: Extending Kubernetes section: + - docs/concepts/overview/extending.md - title: Extending the Kubernetes API section: - docs/concepts/api-extension/apiserver-aggregation.md @@ -33,6 +34,7 @@ toc: - docs/concepts/cluster-administration/network-plugins.md - docs/concepts/cluster-administration/device-plugins.md - docs/concepts/cluster-administration/sysctl-cluster.md + - docs/concepts/service-catalog/index.md - title: Containers section: diff --git a/_data/glossary/managed-service.yaml b/_data/glossary/managed-service.yaml new file mode 100644 index 0000000000..409831141f --- /dev/null +++ b/_data/glossary/managed-service.yaml @@ -0,0 +1,9 @@ +id: managed-service +name: Managed Service +tags: +- extension +short-description: > + A software offering maintained by a third-party provider. +long-description: > + Some examples of Managed Services are AWS EC2, Azure SQL Database, and GCP Pub/Sub, but they can be any software offering that can be used by an application. + [Service Catalog](/docs/concepts/service-catalog/) provides a way to list, provision, and bind with Managed Services offered by {% glossary_tooltip text="Service Brokers" term_id="service-broker" %}. \ No newline at end of file diff --git a/_data/glossary/platform-developer.yaml b/_data/glossary/platform-developer.yaml index 85decd55f3..8d0c556d06 100644 --- a/_data/glossary/platform-developer.yaml +++ b/_data/glossary/platform-developer.yaml @@ -2,9 +2,10 @@ id: platform-developer name: Platform Developer aka: - Kubernetes Developer + - Extension Developer tags: - user-type short-description: > A person who customizes the Kubernetes platform to fit the needs of their project. long-description: > - A platform developer may, for example, use [Custom Resources](/docs/concepts/api-extension/custom-resources/) or [Extend the Kubernetes API with the aggregation layer](/docs/concepts/api-extension/apiserver-aggregation/) to add functionality to their instance of Kubernetes, specifically for their application. + A platform developer may, for example, use [Custom Resources](/docs/concepts/api-extension/custom-resources/) or [Extend the Kubernetes API with the aggregation layer](/docs/concepts/api-extension/apiserver-aggregation/) to add functionality to their instance of Kubernetes, specifically for their application. Some Platform Developers are also {% glossary_tooltip text="contributors" term_id="contributor" %} and develop extensions which are contributed to the Kubernetes community. Others develop closed-source commercial or site-specific extensions. diff --git a/_data/glossary/service-broker.yaml b/_data/glossary/service-broker.yaml new file mode 100644 index 0000000000..9cdc99bbcb --- /dev/null +++ b/_data/glossary/service-broker.yaml @@ -0,0 +1,9 @@ +id: service-broker +name: Service Broker +tags: +- extension +short-description: > + An endpoint for a set of {% glossary_tooltip text="Managed Services" term_id="managed-service" %} offered and maintained by a third-party. +long-description: > + {% glossary_tooltip text="Service Brokers" term_id="service-broker" %} implement the [Open Service Broker API spec](https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md) and provide a standard interface for applications to use their Managed Services. + [Service Catalog](/docs/concepts/service-catalog/) provides a way to list, provision, and bind with Managed Services offered by Service Brokers. \ No newline at end of file diff --git a/_data/glossary/service-catalog.yaml b/_data/glossary/service-catalog.yaml new file mode 100644 index 0000000000..bcbadd309c --- /dev/null +++ b/_data/glossary/service-catalog.yaml @@ -0,0 +1,8 @@ +id: service-catalog +name: Service Catalog +tags: +- extension +short-description: > + An extension API that enables applications running in Kubernetes clusters to easily use external managed software offerings, such as a datastore service offered by a cloud provider. +long-description: > + Service Catalog provides a way to list, provision, and bind with external {% glossary_tooltip text="Managed Services" term_id="managed-service" %} from {% glossary_tooltip text="Service Brokers" term_id="service-broker" %} without needing detailed knowledge about how those services are created or managed. \ No newline at end of file diff --git a/_data/reference.yml b/_data/reference.yml index 5c9ba3d2c1..4275214b3a 100644 --- a/_data/reference.yml +++ b/_data/reference.yml @@ -64,11 +64,7 @@ toc: - docs/user-guide/jsonpath.md - docs/user-guide/kubectl-cheatsheet.md -- title: Cloud Controller Manager - section: - - docs/reference/generated/cloud-controller-manager.md - -- title: Setup Tools +- title: Setup Tools Reference section: - docs/reference/generated/kubeadm.md - title: Kubefed @@ -80,7 +76,7 @@ toc: - docs/reference/generated/kubefed_unjoin.md - docs/reference/generated/kubefed_version.md -- title: Config Reference +- title: Command-line Tools Reference section: - docs/reference/generated/kubelet.md - docs/admin/kubelet-authentication-authorization.md @@ -89,6 +85,7 @@ toc: - docs/reference/generated/kube-proxy.md - docs/reference/generated/kube-scheduler.md - docs/admin/kubelet-tls-bootstrapping.md + - docs/reference/generated/cloud-controller-manager.md - docs/reference/generated/federation-apiserver.md - docs/reference/generated/federation-controller-manager.md diff --git a/_data/setup.yml b/_data/setup.yml index b1b0106881..d2907e9433 100644 --- a/_data/setup.yml +++ b/_data/setup.yml @@ -23,8 +23,8 @@ toc: path: https://cloud.google.com/kubernetes-engine/docs/before-you-begin/ - title: Running Kubernetes on Azure Container Service path: https://docs.microsoft.com/en-us/azure/container-service/container-service-kubernetes-walkthrough - - title: Running Kubernetes on IBM Bluemix Container Service - path: https://console.ng.bluemix.net/docs/containers/container_index.html + - title: Running Kubernetes on IBM Cloud Container Service + path: https://console.bluemix.net/docs/containers/container_index.html - title: Turn-key Cloud Solutions section: @@ -33,7 +33,7 @@ toc: - docs/getting-started-guides/azure.md - docs/getting-started-guides/alibaba-cloud.md - docs/getting-started-guides/clc.md - - title: Running Kubernetes on IBM Bluemix + - title: Running Kubernetes on IBM Cloud path: https://github.com/patrocinio/kubernetes-softlayer - docs/getting-started-guides/stackpoint.md diff --git a/_data/tasks.yml b/_data/tasks.yml index 4820d91855..15eb64620b 100644 --- a/_data/tasks.yml +++ b/_data/tasks.yml @@ -100,7 +100,7 @@ toc: - title: Use Explorer to Examine the Runtime Environment path: https://github.com/kubernetes/kubernetes/tree/release-1.5/examples/explorer -- title: Access and Extend the Kubernetes API +- title: Extend Kubernetes section: - docs/tasks/access-kubernetes-api/http-proxy-access-api.md - docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions.md @@ -108,6 +108,8 @@ toc: - docs/tasks/access-kubernetes-api/migrate-third-party-resource.md - docs/tasks/access-kubernetes-api/configure-aggregation-layer.md - docs/tasks/access-kubernetes-api/setup-extension-api-server.md + - docs/tasks/service-catalog/install-service-catalog-using-helm.md + - docs/tasks/service-catalog/install-service-catalog-using-sc.md - title: TLS section: diff --git a/_includes/partner-script.js b/_includes/partner-script.js index 39357ab2fa..d90cc040d0 100644 --- a/_includes/partner-script.js +++ b/_includes/partner-script.js @@ -432,7 +432,7 @@ name: 'Kublr', logo: 'kublr', link: 'http://kublr.com', - blurb: 'SSimplify and speed up the management of your containerized applications at scale.' + blurb: 'Simplify and speed up the management of your containerized applications at scale.' }, { type: 0, @@ -614,7 +614,7 @@ name: 'Sphere Software, LLC', logo: 'spheresoftware', link: 'https://sphereinc.com/kubernetes/', - blurb: 'Architect and implement scalable applications using Kubernetes in Google Cloud, AWS, and Azure with our team of experts.' + blurb: 'The Sphere Software team of experts allows customers to architect and implement scalable applications using Kubernetes in Google Cloud, AWS, and Azure.' }, { type: 1, @@ -742,6 +742,13 @@ link: 'https://caicloud.io/products/compass', blurb: 'Caicloud - Compass' }, + { + type: 2, + name: 'Caicloud', + logo: 'caicloud', + link: 'https://caicloud.io/', + blurb: 'Founded by ex-Googlers,and early Kubernetes contributors, Caicloud leverages Kubernetes to provide container products which have successfully served Fortune 500 enterprises, and further utilizes Kubernetes as a vehicle to deliver ultra-speed deep learning experience.' + }, { type: 3, name: 'Alibaba', @@ -788,7 +795,7 @@ type: 3, name: 'Loodse', logo: 'loodse', - link: 'https://loodse.io', + link: 'https://loodse.com', blurb: 'Loodse - Kubermatic Container Engine' }, { @@ -798,6 +805,13 @@ link: 'https://github.com/Azure/acs-engine', blurb: 'Microsoft - Azure acs-engine' }, + { + type: 3, + name: 'Microsoft', + logo: 'microsoft', + link: 'https://docs.microsoft.com/en-us/azure/aks/', + blurb: 'Microsoft - Azure Container Service AKS' + }, { type: 3, name: 'Oracle', @@ -910,6 +924,20 @@ link: 'https://gopaddle.io', blurb: 'goPaddle is a DevOps platform for Kubernetes developers. It simplifies the Kubernetes Service creation and maintenance through source to image conversion, build & version management, team management, access controls and audit logs, single click provision of Kubernetes Clusters across multiple clouds from a single console.' }, + { + type: 0, + name: 'Vexxhost', + logo: 'vexxhost', + link: 'https://vexxhost.com/public-cloud/container-services/kubernetes/', + blurb: 'VEXXHOST offers a high-performance container management service powered by Kubernetes and OpenStack Magnum.' + }, + { + type: 1, + name: 'Component Soft', + logo: 'componentsoft', + link: 'https://www.componentsoft.eu/?p=3925', + blurb: 'Component Soft offers training, consultation and support around open cloud technologies like Kubernetes, Docker, Openstack and Ceph.' + }, { type: 0, name: 'Datera', @@ -945,6 +973,41 @@ link: 'https://docs.portworx.com/scheduler/kubernetes/install.html', blurb: 'With Portworx, you can manage any database or stateful service on any infrastructure using Kubernetes. You get a single data management layer for all of your stateful services, no matter where they run.' }, + { + type: 1, + name: 'Object Computing, Inc.', + logo: 'objectcomputing', + link: 'https://objectcomputing.com/services/software-engineering/devops/kubernetes-services', + blurb: 'Our portfolio of DevOps consulting services includes Kubernetes support, development, and training.' + }, + { + type: 1, + name: 'Isotoma', + logo: 'isotoma', + link: 'https://www.isotoma.com/blog/2017/10/24/containerisation-tips-for-using-kubernetes-with-aws/', + blurb: 'Based in the North of England, Amazon partners who are delivering Kubernetes solutions on AWS for replatforming and native development.' + }, + { + type: 1, + name: 'Servian', + logo: 'servian', + link: 'https://www.servian.com/cloud-and-technology/', + blurb: 'Based in Australia, Servian provides advisory, consulting and managed services to support both application and data centric kubernetes use cases.' + }, + { + type: 1, + name: 'Redzara', + logo: 'redzara', + link: 'http://redzara.com/cloud-service', + blurb: 'Redzara has wide and in-depth experience in Cloud automation, now taking one giant step by providing container service offering and services to our customers.' + }, + { + type: 0, + name: 'Dataspine', + logo: 'dataspine', + link: 'http://dataspine.xyz/', + blurb: 'Dataspine is building a secure, elastic and serverless deployment platform for production ML/AI workloads on top of k8s.' + }, { type: 0, name: 'Logdna', diff --git a/cn/docs/concepts/workloads/controllers/garbage-collection.md b/cn/docs/concepts/workloads/controllers/garbage-collection.md index 1d8a921490..c9af3905b7 100644 --- a/cn/docs/concepts/workloads/controllers/garbage-collection.md +++ b/cn/docs/concepts/workloads/controllers/garbage-collection.md @@ -45,7 +45,7 @@ Kubernetes 垃圾收集器的角色是删除指定的对象,这些对象曾经 如果创建该 ReplicaSet,然后查看 Pod 的 metadata 字段,能够看到 OwnerReferences 字段: ```shell -kubectl create -f https://k8s.io/docs/concepts/abstractions/controllers/my-repset.yaml +kubectl create -f https://k8s.io/docs/concepts/controllers/my-repset.yaml kubectl get pods --output=yaml ``` diff --git a/cn/docs/reference/labels-annotations-taints.md b/cn/docs/reference/labels-annotations-taints.md new file mode 100644 index 0000000000..fbeffb9587 --- /dev/null +++ b/cn/docs/reference/labels-annotations-taints.md @@ -0,0 +1,104 @@ +--- +title: 知名标签(Label)、注解(Annotation)和 Taints +--- + +Kubernetes 保留了 kubernetes.io 名字空间下的所有标签和注解。 本文描述了知名的 +kubernetes.io 标签和注解。 + +本文既作为这些标签和注解值的参考,也就这些标签和注解的赋值进行了说明。 + +**目录:** + + +- [知名标签、注解和 Taints](#well-known-labels-annotations-and-taints) + - [beta.kubernetes.io/arch](#betakubernetesioarch) + - [beta.kubernetes.io/os](#betakubernetesioos) + - [kubernetes.io/hostname](#kubernetesiohostname) + - [beta.kubernetes.io/instance-type](#betakubernetesioinstance-type) + - [failure-domain.beta.kubernetes.io/region](#failure-domainbetakubernetesioregion) + - [failure-domain.beta.kubernetes.io/zone](#failure-domainbetakubernetesiozone) + + + + +## beta.kubernetes.io/arch + +示例:`beta.kubernetes.io/arch=amd64` + +用于:节点 + +Kubelet 用 Go 中定义的 `runtime.GOARCH` 值来填充该标签。 这在诸如混用 arm 和 x86 节点的情况下很有用。 + +## beta.kubernetes.io/os + +示例:`beta.kubernetes.io/os=linux` + +用于:节点 + +Kubelet 用该 Go 中定义的 `runtime.GOOS` 值来填充该标签。 这在集群中存在不同操作系统的节点时很有用(尽管当前 Kubernetes 只支持 Linux 操作系统)。 + +## kubernetes.io/hostname + +示例:`kubernetes.io/hostname=ip-172-20-114-199.ec2.internal` + +用于:节点 + +Kubelet 用 hostname 值来填充该标签。 注意:可以通过向 kubelet 传入 `--hostname-override` +参数对 “真正的” hostname 进行修改。 + +## beta.kubernetes.io/instance-type + +示例:`beta.kubernetes.io/instance-type=m3.medium` + +用于:节点 + +Kubelet 用 `cloudprovider` 中定义的实例类型来填充该标签。 未使用 `cloudprovider` 时不会设置该标签。 +该标签在想要将某些负载定向到特定实例类型的节点上时会很有用,但通常用户更希望依赖 Kubernetes 调度器来执行基于资源的调度,所以用户应该致力于基于属性而不是实例类型来进行调度(例如:需要一个 CPU,而不是 `g2.2xlarge`)。 + + +## failure-domain.beta.kubernetes.io/region + +参考 [failure-domain.beta.kubernetes.io/zone](#failure-domainbetakubernetesiozone). + +## failure-domain.beta.kubernetes.io/zone + +示例: + +`failure-domain.beta.kubernetes.io/region=us-east-1` + +`failure-domain.beta.kubernetes.io/zone=us-east-1c` + +用于:节点、PersistentVolume + +用于节点: Kubelet 用 `cloudprovider` 中定义的区域(zone)信息来填充该标签。 未使用 `cloudprovider` +时不会设置该标签,但如果该标签在你的拓扑中有意义的话,应该考虑设置。 + +用于 PersistentVolume:在 GCE 和 AWS 中,`PersistentVolumeLabel` 准入控制器会自动添加区域标签。 + +在单区的集群中,Kubernetes 会自动将同一副本控制器或服务下的 pod 分散到不同的节点上 (以降低故障的影响)。 +在多区的集群中,这种分散的行为扩展到跨区的层面 (以降低区域故障的影响)。 跨区分散通过 SelectorSpreadPriority +来实现。 + +这是一种尽力而为(best-effort)的处置方式, 如果集群中的区域是异构的 (例如:不同区域之间的节点数量、 +节点类型或 pod 资源需求不同),可能使得 pod 在各区域间无法均匀分布。 如有需要,用户可以使用同质的区域 +(节点数量和类型相同) 来减小 pod 分布不均的可能性。 + +由于卷不能跨区域挂载(attach),调度器 (通过 VolumeZonePredicate 断言) 也会保证需要特定卷的 pod +被调度到卷所在的区域中。 + + +区域和地域(region)的实际值无关紧要,两者的层次含义也没有严格的定义。 最终期望是,除非整个地域故障, +否则某一区域节点的故障不应该影响到其他区域的节点。 例如,通常区域间应该避免共用同一个网络交换机。 +具体的规划取决于特定的基础设备—— three-rack 设备所选择的设置与多数据中心截然不同。 + +如果 `PersistentVolumeLabel` 准入控制器不支持自动为 PersistentVolume 打标签,且用户希望防止 pod +跨区域进行卷的挂载,应考虑手动打标签 (或对 `PersistentVolumeLabel` 增加支持)。 如果用户的基础设施没有这种约束,则不需要为卷添加区域标签。 + + + + + + + +[![分析](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/api-reference/labels-annotations-taints.md?pixel)]() + diff --git a/community/index.html b/community/index.html index 6ade8ae9dd..e78541e9e4 100644 --- a/community/index.html +++ b/community/index.html @@ -7,7 +7,7 @@ cid: community

Community

-KubeConNA +KubeConNA
diff --git a/docs/admin/authorization/webhook.md b/docs/admin/authorization/webhook.md index a0ba0f8e38..f451a0d569 100644 --- a/docs/admin/authorization/webhook.md +++ b/docs/admin/authorization/webhook.md @@ -31,8 +31,10 @@ A configuration example which uses HTTPS client auth: clusters: - name: name-of-remote-authz-service cluster: - certificate-authority: /path/to/ca.pem # CA for verifying the remote service. - server: https://authz.example.com/authorize # URL of remote service to query. Must use 'https'. + # CA for verifying the remote service. + certificate-authority: /path/to/ca.pem + # URL of remote service to query. Must use 'https'. May not include parameters. + server: https://authz.example.com/authorize # users refers to the API Server's webhook configuration. users: diff --git a/docs/admin/daemon.yaml b/docs/admin/daemon.yaml deleted file mode 100644 index c5cd14a592..0000000000 --- a/docs/admin/daemon.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: prometheus-node-exporter -spec: - template: - metadata: - name: prometheus-node-exporter - labels: - daemon: prom-node-exp - spec: - containers: - - name: c - image: prom/prometheus - ports: - - containerPort: 9090 - hostPort: 9090 - name: serverport diff --git a/docs/admin/high-availability/kube-scheduler.yaml b/docs/admin/high-availability/kube-scheduler.yaml index 9e997cbc47..40c863da48 100644 --- a/docs/admin/high-availability/kube-scheduler.yaml +++ b/docs/admin/high-availability/kube-scheduler.yaml @@ -21,9 +21,6 @@ spec: volumeMounts: - mountPath: /var/log/kube-scheduler.log name: logfile - - mountPath: /var/run/secrets/kubernetes.io/serviceaccount - name: default-token-s8ejd - readOnly: true volumes: - hostPath: path: /var/log/kube-scheduler.log diff --git a/docs/admin/multiple-schedulers/pod1.yaml b/docs/admin/multiple-schedulers/pod1.yaml index 733aa97d99..6cf8fec25a 100644 --- a/docs/admin/multiple-schedulers/pod1.yaml +++ b/docs/admin/multiple-schedulers/pod1.yaml @@ -7,4 +7,4 @@ metadata: spec: containers: - name: pod-with-no-annotation-container - image: gcr.io/google_containers/pause:2.0 \ No newline at end of file + image: gcr.io/google_containers/pause:2.0 diff --git a/docs/concepts/abstractions/controllers/my-repset.yaml b/docs/concepts/abstractions/controllers/my-repset.yaml deleted file mode 100644 index 54befd8f9d..0000000000 --- a/docs/concepts/abstractions/controllers/my-repset.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: ReplicaSet -metadata: - name: my-repset -spec: - replicas: 3 - selector: - matchLabels: - pod-is-for: garbage-collection-example - template: - metadata: - labels: - pod-is-for: garbage-collection-example - spec: - containers: - - name: nginx - image: nginx diff --git a/docs/concepts/cluster-administration/cloud-providers.md b/docs/concepts/cluster-administration/cloud-providers.md index 739476217c..7b31be5cd7 100644 --- a/docs/concepts/cluster-administration/cloud-providers.md +++ b/docs/concepts/cluster-administration/cloud-providers.md @@ -213,6 +213,28 @@ provider configuration: bs-version=v2 ``` +#### Metadata +These configuration options for the OpenStack provider pertain to metadata and +should appear in the `[Metadata]` section of the `cloud.conf` file: + +* `search-order` (Optional): This configuration key influences the way that the + provider retrieves metadata relating to the instance(s) in which it runs. The + default value of `configDrive,metadataService` results in the provider + retrieving metadata relating to the instance from the config drive first if + available and then the metadata service. Alternative values are: + * `configDrive` - Only retrieve instance metadata from the configuration + drive. + * `metadataService` - Only retrieve instance metadata from the metadata + service. + * `metadataService,configDrive` - Retrieve instance metadata from the metadata + service first if available, then the configuration drive. + + Influencing this behavior may be desirable as the metadata on the + configuration drive may grow stale over time, whereas the metadata service + always provides the most up to date view. Not all OpenStack clouds provide + both configuration drive and metadata service though and only one or the other + may be available which is why the default is to check both. + #### Router These configuration options for the OpenStack provider pertain to routing and should appear in the `[Route]` section of the `cloud.conf` file: diff --git a/docs/concepts/configuration/overview.md b/docs/concepts/configuration/overview.md index f9151eca8c..1cb922a272 100644 --- a/docs/concepts/configuration/overview.md +++ b/docs/concepts/configuration/overview.md @@ -37,15 +37,19 @@ This is a living document. If you think of something that is not on this list bu ## Services -- It's typically best to create a [service](/docs/concepts/services-networking/service/) before corresponding [replication controllers](/docs/concepts/workloads/controllers/replicationcontroller/). This lets the scheduler spread the pods that comprise the service. +- It's typically best to create a [service](/docs/concepts/services-networking/service/) before the corresponding [replication controllers](/docs/concepts/workloads/controllers/replicationcontroller/). This lets the scheduler spread the pods that comprise the service. - You can also use this process to ensure that at least one replica works before creating lots of them: - - 1. Create a replication controller without specifying replicas (this will set replicas=1); - 2. Create a service; - 3. Then scale up the replication controller. - -- Don't use `hostPort` unless it is absolutely necessary (for example: for a node daemon). It specifies the port number to expose on the host. When you bind a Pod to a `hostPort`, there are a limited number of places to schedule a pod due to port conflicts— you can only schedule as many such Pods as there are nodes in your Kubernetes cluster. +- Don't use `hostPort` unless it is absolutely necessary (for example: for a node daemon). + It specifies the port number to expose on the host. + When you bind a Pod to a `hostPort`, there are a limited number of places to schedule a pod due to port conflicts. + The conflict comes from the requirement of an unique combination. + Different combinations mean different requirements. + For example, a pod that binds to host port 80 on 127.0.0.1 with TCP protocol has no conflict with another Pod that binds to host port 80 on 127.0.0.2 with TCP protocol. + + *Special notes on hostIP and protocol*: If you don't specify the hostIP and protocol explicitly, + kubernetes will use 0.0.0.0 and TCP as the default hostIP and protocol, + where "0.0.0.0" is a wildcard IP that will match all <*,hostPort,protocol> on the node the pod is scheduled on. + Specifically, it will match all tuples for all IPs on the host. If you only need access to the port for debugging purposes, you can use the [kubectl proxy and apiserver proxy](/docs/tasks/access-kubernetes-api/http-proxy-access-api/) or [kubectl port-forward](/docs/tasks/access-application-cluster/port-forward-access-application-cluster/). You can use a [Service](/docs/concepts/services-networking/service/) object for external service access. diff --git a/docs/concepts/configuration/pod-priority-preemption.md b/docs/concepts/configuration/pod-priority-preemption.md index ce30c79c67..9ee15dafbf 100644 --- a/docs/concepts/configuration/pod-priority-preemption.md +++ b/docs/concepts/configuration/pod-priority-preemption.md @@ -39,8 +39,7 @@ The following sections provide more information about these steps. ## Enabling priority and preemption Pod priority and preemption is disabled by default in Kubernetes 1.8. -To enable the feature, set this command-line flag for the API server -and the scheduler: +To enable the feature, set this command-line flag for the API server, scheduler and kubelet: ``` --feature-gates=PodPriority=true diff --git a/docs/concepts/overview/extending.md b/docs/concepts/overview/extending.md new file mode 100644 index 0000000000..89c34a40c4 --- /dev/null +++ b/docs/concepts/overview/extending.md @@ -0,0 +1,215 @@ +--- +title: Extending your Kubernetes Cluster +approvers: +- erictune +- lavalamp +- cheftako +- chenopis +--- + +{% capture overview %} + +Kubernetes is highly configurable and extensible. As a result, +there is rarely a need to fork or submit patches to the Kubernetes +project code. + +This guide describes the options for customizing a Kubernetes +cluster. It is aimed at {% glossary_tooltip text="Cluster Operators" term_id="cluster-operator" %} who want to +understand how to adapt their Kubernetes cluster to the needs of +their work environment. Developers who are prospective {% glossary_tooltip text="Platform +Developers" term_id="platform-developer" %} or Kubernetes Project {% glossary_tooltip text="Contributors" term_id="contributor" %} will also find it +useful as an introduction to what extension points and patterns +exist, and their trade-offs and limitations. + +{% endcapture %} + + +{% capture body %} + +## Overview + +Customization approaches can be broadly divided into *configuration*, which only involves changing flags, local configuration files, or API resources; and *extensions*, which involve running additional programs or services. This document is primarily about extensions. + +## Configuration + +*Configuration files* and *flags* are documented in the Reference section of the online documentation, under each binary: + +* [kubelet](/docs/admin/kubelet/) +* [kube-apiserver](/docs/admin/kube-apiserver/) +* [kube-controller-manager](/docs/admin/kube-controller-manager/) +* [kube-scheduler](/docs/admin/kube-scheduler/). + +Flags and configuration files may not always be changeable in a hosted Kubernetes service or a distribution with managed installation. When they are changeable, they are usually only changeable by the cluster administrator. Also, they are subject to change in future Kubernetes versions, and setting them may require restarting processes. For those reasons, they should be used only when there are no other options. + +*Built-in Policy APIs*, such as [ResourceQuota](/docs/concepts/policy/resource-quotas/), [PodSecurityPolicies](/docs/concepts/policy/pod-security-policy/), [NetworkPolicy](/docs/concepts/services-networking/network-policies/) and Role-based Access Control ([RBAC](/docs/admin/authorization/rbac/)), are built-in Kubernetes APIs. APIs are typically used with hosted Kubernetes services and with managed Kubernetes installations. They are declarative and use the same conventions as other Kubernetes resources like pods, so new cluster configuration can be repeatable and be managed the same way as applications. And, where they are stable, they enjoy a [defined support policy](/docs/reference/deprecation-policy/) like other Kubernetes APIs. For these reasons, they are preferred over *configuration files* and *flags* where suitable. + +## Extensions + +Extensions are software components that extend and deeply integrate with Kubernetes. +They adapt it to support new types and new kinds of hardware. + +Most cluster administrators will use a hosted or distribution +instance of Kubernetes. As a result, most Kubernetes users will need to +install extensions and fewer will need to author new ones. + +## Extension Patterns + +Kubernetes is designed to be automated by writing client programs. Any +program that reads and/or writes to the Kubernetes API can provide useful +automation. *Automation* can run on the cluster or off it. By following +the guidance in this doc you can write highly available and robust automation. +Automation generally works with any Kubernetes cluster, including hosted +clusters and managed installations. + +There is a specific pattern for writing client programs that work well with +Kubernetes called the *Controller* pattern. Controllers typically read an +object's `.spec`, possibly do things, and then update the object's `.status`. + +A controller is a client of Kubernetes. When Kubernetes is the client and +calls out to a remote service, it is called a *Webhook*. The remote service +is called a *Webhook Backend*. Like Controllers, Webhooks do add a point of +failure. + +In the webhook model, Kubernetes makes a network request to a remote service. +In the *Binary Plugin* model, Kubernetes executes a binary (program). +Binary plugins are used by the kubelet (e.g. [Flex Volume +Plugins](https://github.com/kubernetes/community/blob/master/contributors/devel/flexvolume.md) +and [Network +Plugins](/docs/concepts/cluster-administration/network-plugins/)) +and by kubectl. + +Below is a diagram showing how the extensions points interact with the +Kubernetes control plane. + + + + + + +## Extension Points + +This diagram shows the extension points in a Kubernetes system. + + + + + +1. Users often interact with the Kubernetes API using `kubectl`. [Kubectl plugins](docs/tasks/extend-kubectl/kubectl-plugins) extend the kubectl binary. They only affect the individual user's local environment, and so cannot enforce site-wide policies. +2. The apiserver handles all requests. Several types of extension points in the apiserver allow authenticating requests, or blocking them based on their content, editing content, and handling deletion. These are described in the [API Access Extensions](docs/concepts/overview/extending#api-access-extensions) section. +3. The apiserver serves various kinds of *resources*. *Built-in resource kinds*, like `pods`, are defined by the Kubernetes project and can't be changed. You can also add resources that you define, or that other projects have defined, called *Custom Resources*, as explained in the [Custom Resources](docs/concepts/overview/extending#custom-resources) section. Custom Resources are often used with API Access Extensions. +4. The Kubernetes scheduler decides which nodes to place pods on. There are several ways to extend scheduling. These are described in the [Scheduler Extensions](docs/concepts/overview/extending#shceduler-extensions) section. +5. Much of the behavior of Kubernetes is implemented by programs called Controllers which are clients of the API-Server. Controllers are often used in conjunction with Custom Resources. +6. The kubelet runs on servers, and helps pods appear like virtual servers with their own IPs on the cluster network. [Network Plugins](docs/concepts/overview/extending#network-plugins) allow for different implementations of pod networking. +7. The kubelet also mounts and unmounts volumes for containers. New types of storage can be supported via [Storage Plugins](docs/concepts/overview/extending#storage-plugins). + +If you are unsure where to start, this flowchart can help. Note that some solutions may involve several types of extensions. + + + + + + +## API Extensions +### User-Defined Types + +Consider adding a Custom Resource to Kubernetes if you want to define new controllers, application configuration objects or other declarative APIs, and to manage them using Kubernetes tools, such as `kubectl`. + +Do not use a Custom Resource as data storage for application, user, or monitoring data. + +For more about Custom Resources, see the [Custom Resources concept guide](/docs/concepts/api-extension/custom-resources.md). + + +### Combining New APIs with Automation + +Often, when you add a new API, you also add a control loop that reads and/or writes the new APIs. When the combination of a Custom API and a control loop is used to manage a specific, usually stateful, application, this is called the *Operator* pattern. Custom APIs and control loops can also be used to control other resources, such as storage, policies, and so on. + +### Changing Built-in Resources + +When you extend the Kubernetes API by adding custom resources, the added resources always fall into a new API Groups. You cannot replace or change existing API groups. +Adding an API does not directly let you affect the behavior of existing APIs (e.g. Pods), but API Access Extensions do. + + +### API Access Extensions + +When a request reaches the Kubernetes API Server, it is first Authenticated, then Authorized, then subject to various types of Admission Control. See [[Accessing the API](/docs/admin/accessing-the-api/)] for more on this flow. + +Each of these steps offers extension points. + +Kubernetes has several built-in authentication methods that it supports. It can also sit behind an authenticating proxy, and it can send a token from an Authorization header to a remote service for verification (a webhook). All of these methods are covered in the [Authentication documentation](/docs/admin/authentication/). + +### Authentication + +[Authentication](/docs/admin/authentication) maps headers or certificates in all requests to a username for the client making the request. + +Kubernetes provides several built-in authentication methods, and an [Authentication webhook](/docs/admin/authentication/#webhook-token-authentication) method if those don't meet your needs. + + +### Authorization + + [Authorization](/docs/admin/authorization/webhook/) determines whether specific users can read, write, and do other operations on API resources. It just works at the level of whole resources -- it doesn't discriminate based on arbitrary object fields. If the built-in authorization options don't meet your needs, and [Authorization webhook](/docs/admin/authorization/webhook/) allows calling out to user-provided code to make an authorization decision. + + +### Dynamic Admission Control + +After a request is authorized, if it is a write operation, it also t goes through [Admission Control](/docs/admin/admission-controllers/) steps. In addition to the built-in steps, there are several extensions: + +* The [Image Policy webhook](/docs/admin/admission-controllers/#imagepolicywebhook) restricts what images can be run in containers. +* To make arbitrary admission control decisions, a general [Admission webhook](/docs/admin/extensible-admission-controllers/#external-admission-webhooks) can be used. Admission Webhooks can reject creations or updates. +* [Initializers](/docs/admin/extensible-admission-controllers/#initializers) are controllers that can modify objects before they are created. Initializers can modify initial object creations but cannot affect updates to objects. Initializers can also reject objects. + +## Infrastructure Extensions + + +### Storage Plugins + +[Flex Volumes](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/flexvolume-deployment.md +) allow users to mount volume types without built-in support by having the +Kubelet call a Binary Plugin to mount the volume. + + +### Device Plugins + +Device plugins allow a node to discover new Node resources (in addition to the +builtin ones like cpu and memory) via a [Device +Plugin](/docs/concepts/cluster-administration/device-plugins/). + + +### Network Plugins + +Different networking fabrics can be supported via node-level [Network Plugins](/docs/admin/network-plugins/). + +### Scheduler Extensions + +The scheduler is a special type of controller that watches pods, and assigns +pods to nodes. The default scheduler can be be replaced entirely, while +continuing to use other Kubernetes components, or [multiple +schedulers](/docs/tasks/administer-cluster/configure-multiple-schedulers/) +can run at the same time. + +This is a significant undertaking, and almost all Kubernetes users find they +do not need to modify the scheduler. + +The scheduler also supports a +[webhook](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/scheduling/scheduler_extender.md) +that permits a webhook backend (scheduler extension) to filter and prioritize +the nodes chosen for a pod. + +{% endcapture %} + + +{% capture whatsnext %} + +* Learn more about [Custom Resources](/docs/concepts/api-extension/custom-resources/) +* Learn about [Dynamic admission control](/docs/admin/extensible-admission-controller) +* Learn more about Infrastructure extensions + * [Network Plugins](/docs/concepts/cluster-administration/network-plugin) + * [Device Plugins](/docs/concepts/cluster-administration/device-plugins.md) +* Learn about [kubectl plugins](/docs/tasks/extend-kubectl/kubectl-plugin) +* See examples of Automation + * [List of Operators](https://github.com/coreos/awesome-kubernetes-extensions) + +{% endcapture %} + +{% include templates/concept.md %} + + diff --git a/docs/concepts/overview/working-with-objects/nginx-deployment.yaml b/docs/concepts/overview/working-with-objects/nginx-deployment.yaml index 8925d1b08d..4139bd1ac1 100644 --- a/docs/concepts/overview/working-with-objects/nginx-deployment.yaml +++ b/docs/concepts/overview/working-with-objects/nginx-deployment.yaml @@ -4,6 +4,9 @@ metadata: name: nginx-deployment spec: replicas: 3 + selector: + matchLabels: + app: nginx template: metadata: labels: diff --git a/docs/concepts/service-catalog/index.md b/docs/concepts/service-catalog/index.md new file mode 100644 index 0000000000..814505ccb3 --- /dev/null +++ b/docs/concepts/service-catalog/index.md @@ -0,0 +1,234 @@ +--- +title: Service Catalog +approvers: +- chenopis +--- + +{% capture overview %} +{% glossary_definition term_id="service-catalog" length="all" prepend="Service Catalog is " %} + +A *Service Broker*, as defined by the [Open Service Broker API spec](https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md), is an endpoint for a set of Managed Services offered and maintained by a third-party, which could be a cloud provider such as AWS, GCP, or Azure. +Some examples of *Managed Services* are Microsoft Azure Cloud Queue, Amazon Simple Queue Service, and Google Cloud Pub/Sub, but they can be any software offering that can be used by an application. + +Using Service Catalog, a {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} can browse the list of {% glossary_tooltip text="Managed Services" term_id="managed-service" %} offered by a {% glossary_tooltip text="Service Brokers" term_id="service-broker" %}, provision an instance of a Managed Service, and bind with it to make it available to an application within the Kubernetes cluster. + +{% endcapture %} + + +{% capture body %} +## Example use case + +An {% glossary_tooltip text="Application Developer" term_id="application-developer" %} wants to use message queuing as part of their application running in a Kubernetes cluster. +However, they do not want to deal with the overhead of setting such a service up and administering it themselves. +Fortunately, there is a cloud provider that offers message queuing as a *Managed Service* through their *Service Broker*. + +A {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} can setup Service Catalog and use it to communicate with the cloud provider's {% glossary_tooltip text="Service Broker" term_id="service-broker" %} to provision an instance of the message queuing service and make it available to the application within the Kubernetes cluster. +The {% glossary_tooltip text="Application Developer" term_id="application-developer" %} therefore does not need to concern themselves with the implementation details or management of the message queue. +Their application can simply use it as a service. + +## Architecture + +Service Catalog uses the [Open Service Broker API](https://github.com/openservicebrokerapi/servicebroker) to communicate with Service Brokers, acting as an intermediary for the Kubernetes API Server in order to negotiate the initial provisioning and retrieve the credentials necessary for the application to use a Managed Service. + +It is implemented as an extension API server and a controller manager, using Etcd for storage. It also uses the [aggregation layer](/docs/concepts/api-extension/apiserver-aggregation/) available in Kubernetes 1.7+ to present its API. + +
+ +![Service Catalog Architecture](/images/docs/service-catalog-architecture.svg) + + +### API Resources + +Service Catalog installs the `servicecatalog.k8s.io` API and provides the following Kubernetes resources: + +* `ClusterServiceBroker`: An in-cluster representation of a Service Broker, encapsulating its server connection details. +These are created and managed by Cluster Operators who wish to use that broker server to make new types of Managed Services available within their cluster. +* `ClusterServiceClass`: A Managed Service offered by a particular Service Broker. +When a new `ClusterServiceBroker` resource is added to the cluster, the Service Catalog controller connects to the Service Broker to obtain a list of available Managed Services. It then creates a new `ClusterServiceClass` resource corresponding to each Managed Service. +* `ClusterServicePlan`: A specific offering of a Managed Service. For example, a Managed Service may have different plans available, such as a free tier or paid tier, or it may have different configuration options, such as using SSD storage or having more resources. Similar to `ClusterServiceClass`, when a new `ClusterServiceBroker` is added to the cluster, the Service Catalog creates a new `ClusterServicePlan` resource corresponding to each Service Plan available for each Managed Service. +* `ServiceInstance`: A provisioned instance of a `ClusterServiceClass`. +These are created by Cluster Operators to make a specific instance of a Managed Service available for use by one or more in-cluster applications. +When a new `ServiceInstance` resource is created, the Service Catalog controller will connect to the appropriate Service Broker and instruct it to provision the service instance. +* `ServiceBinding`: Access credentials to a `ServiceInstance`. +These are created by Cluster Operators who want their applications to make use of a Service `ServiceInstance`. +Upon creation, the Service Catalog controller will create a Kubernetes `Secret` containing connection details and credentials for the Service Instance, which can be mounted into Pods. + +### Authentication + +Service Catalog supports these methods of authentication: + +* Basic (username/password) +* [OAuth 2.0 Bearer Token](https://tools.ietf.org/html/rfc6750) + +## Usage + +A {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} can use the Service Catalog API Resources to provision Managed Services and make them available within a Kubernetes cluster. The steps involved are: + +1. Listing the Managed Services and Service Plans available from a Service Broker. +1. Provisioning a new instance of the Managed Service. +1. Binding to the Managed Service, which returns the connection credentials. +1. Mapping the connection credentials into the application. + +### Listing Managed Services and Service Plans + +First, a {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} must create a `ClusterServiceBroker` resource within the `servicecatalog.k8s.io` group. This resource contains the URL and connection details necessary to access a Service Broker endpoint. + +This is an example of a `ClusterServiceBroker` resource: + +```yaml +apiVersion: servicecatalog.k8s.io/v1beta1 +kind: ClusterServiceBroker +metadata: + name: cloud-broker +spec: + # Points to the endpoint of a Service Broker. (This example is not a working URL.) + url: https://servicebroker.somecloudprovider.com/v1alpha1/projects/service-catalog/brokers/default + ##### + # Additional values can be added here, which may be used to communicate + # with the Service Broker, such as bearer token info or a caBundle for TLS. + ##### +``` + +The following is a sequence diagram illustrating the steps involved in listing Managed Services and Plans available from a Service Broker: + +![List Services](/images/docs/service-catalog-list.svg){:height="80%" width="80%"} + +1. Once the `ClusterServiceBroker` resource is added to Service Catalog, it triggers a *List Services* call to the external Service Broker. +1. The Service Broker returns a list of available Managed Services and Service Plans, which are cached locally in `ClusterServiceClass` and `ClusterServicePlan` resources. +1. A {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} can then get the list of available Managed Services using the following command: + + kubectl get clusterserviceclasses -o=custom-columns=SERVICE\ NAME:.metadata.name,EXTERNAL\ NAME:.spec.externalName + + It should output a list of service names with a format similar to: + + SERVICE NAME EXTERNAL NAME + 4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468 cloud-provider-service + ... ... + + They can also view the Service Plans available using the following command: + + kubectl get clusterserviceplans -o=custom-columns=PLAN\ NAME:.metadata.name,EXTERNAL\ NAME:.spec.externalName + + It should output a list of plan names with a format similar to: + + PLAN NAME EXTERNAL NAME + 86064792-7ea2-467b-af93-ac9694d96d52 service-plan-name + ... ... + + +### Provisioning a new instance + +A {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} can initiate the provisioning of a new instance by creating a `ServiceInstance` resource. + +This is an example of a `ServiceInstance` resource: + +```yaml +apiVersion: servicecatalog.k8s.io/v1beta1 +kind: ServiceInstance +metadata: + name: cloud-queue-instance + namespace: cloud-apps +spec: + # References one of the previously returned services + clusterServiceClassExternalName: cloud-provider-service + clusterServicePlanExternalName: service-plan-name + ##### + # Additional parameters can be added here, + # which may be used by the Service Broker. + ##### +``` + +The following sequence diagram illustrates the steps involved in provisioning a new instance of a Managed Service: + +![Provision a Service](/images/docs/service-catalog-provision.svg){:height="80%" width="80%"} + +1. When the `ServiceInstance` resource is created, Service Catalog initiates a *Provision Instance* call to the external Service Broker. +1. The Service Broker creates a new instance of the Managed Service and returns an HTTP response. +1. A {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} can then check the status of the instance to see if it is ready. + +### Binding to a Managed Service + +After a new instance has been provisioned, a {% glossary_tooltip text="Cluster Operator" term_id="cluster-operator" %} must bind to the Managed Service to get the connection credentials and service account details necessary for the application to use the service. This is done by creating a `ServiceBinding` resource. + +The following is an example of a `ServiceBinding` resource: + +```yaml +apiVersion: servicecatalog.k8s.io/v1beta1 +kind: ServiceBinding +metadata: + name: cloud-queue-binding + namespace: cloud-apps +spec: + instanceRef: + name: cloud-queue-instance + ##### + # Additional information can be added here, such as a secretName or + # service account parameters, which may be used by the Service Broker. + ##### +``` + +The following sequence diagram illustrates the steps involved in binding to a Managed Service instance: + +![Bind to a Managed Service](/images/docs/service-catalog-bind.svg){:height="80%" width="80%"} + +1. After the `ServiceBinding` is created, Service Catalog makes a *Bind Instance* call to the external Service Broker. +1. The Service Broker enables the application permissions/roles for the appropriate service account. +1. The Service Broker returns the information necessary to connect and access the Managed Service instance. This is provider and service-specific so the information returned may differ between Service Providers and their Managed Services. + +### Mapping the connection credentials + +After binding, the final step involves mapping the connection credentials and service-specific information into the application. +These pieces of information are stored in secrets that the application in the cluster can access and use to connect directly with the Managed Service. + +
+ +![Map connection credentials](/images/docs/service-catalog-map.svg) + +#### Pod Configuration File + +One method to perform this mapping is to use a declarative Pod configuration. + +The following example describes how to map service account credentials into the application. A key called `sa-key` is stored in a volume named `provider-cloud-key`, and the application mounts this volume at `/var/secrets/provider/key.json`. The environment variable `GOOGLE_APPLICATION_CREDENTIALS` is mapped from the value of the mounted file. + +```yaml +... + spec: + volumes: + - name: provider-cloud-key + secret: + secretName: sa-key + containers: +... + volumeMounts: + - name: provider-cloud-key + mountPath: /var/secrets/provider + env: + - name: PROVIDER_APPLICATION_CREDENTIALS + value: "/var/secrets/provider/key.json" +``` + +The following example describes how to map secret values into application environment variables. In this example, the messaging queue topic name is mapped from a secret named `provider-queue-credentials` with a key named `topic` to the environment variable `TOPIC`. + + +```yaml +... + env: + - name: "TOPIC" + valueFrom: + secretKeyRef: + name: provider-queue-credentials + key: topic +``` + +{% endcapture %} + + +{% capture whatsnext %} +* If you are familiar with {% glossary_tooltip text="Helm Charts" term_id="helm-chart" %}, [install Service Catalog using Helm](/docs/tasks/service-catalog/install-service-catalog-using-helm/) into your Kubernetes cluster. Alternatively, you can [install Service Catalog using the SC tool](/docs/tasks/service-catalog/install-service-catalog-using-sc/). +* View [sample service brokers](https://github.com/openservicebrokerapi/servicebroker/blob/master/gettingStarted.md#sample-service-brokers). +* Explore the [kubernetes-incubator/service-catalog](https://github.com/kubernetes-incubator/service-catalog) project. + +{% endcapture %} + + +{% include templates/concept.md %} diff --git a/docs/concepts/services-networking/service.md b/docs/concepts/services-networking/service.md index 8aae3f98a0..089fab27cf 100644 --- a/docs/concepts/services-networking/service.md +++ b/docs/concepts/services-networking/service.md @@ -117,7 +117,7 @@ subsets: - port: 9376 ``` -NOTE: Endpoint IPs may not be loopback (127.0.0.0/8), link-local +**NOTE:** Endpoint IPs may not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast (224.0.0.0/24). Accessing a `Service` without a selector works the same as if it had a selector. @@ -151,13 +151,11 @@ its pods, add appropriate selectors or endpoints and change the service `type`. Every node in a Kubernetes cluster runs a `kube-proxy`. `kube-proxy` is responsible for implementing a form of virtual IP for `Services` of type other than `ExternalName`. -In Kubernetes v1.0 the proxy was purely in userspace. In Kubernetes v1.1 an -iptables proxy was added, but was not the default operating mode. Since -Kubernetes v1.2, the iptables proxy is the default. - -As of Kubernetes v1.0, `Services` are a "layer 4" (TCP/UDP over IP) construct. -In Kubernetes v1.1 the `Ingress` API was added (beta) to represent "layer 7" -(HTTP) services. +In Kubernetes v1.0, `Services` are a "layer 4" (TCP/UDP over IP) construct, the +proxy was purely in userspace. In Kubernetes v1.1, the `Ingress` API was added +(beta) to represent "layer 7"(HTTP) services, iptables proxy was added too, +and become the default operating mode since Kubernetes v1.2. In Kubernetes v1.9-alpha, +ipvs proxy was added. ### Proxy-mode: userspace @@ -169,37 +167,20 @@ will be proxied to one of the `Service`'s backend `Pods` (as reported in `SessionAffinity` of the `Service`. Lastly, it installs iptables rules which capture traffic to the `Service`'s `clusterIP` (which is virtual) and `Port` and redirects that traffic to the proxy port which proxies the backend `Pod`. - -The net result is that any traffic bound for the `Service`'s IP:Port is proxied -to an appropriate backend without the clients knowing anything about Kubernetes -or `Services` or `Pods`. - -By default, the choice of backend is round robin. Client-IP based session affinity -can be selected by setting `service.spec.sessionAffinity` to `"ClientIP"` (the -default is `"None"`), and you can set the max session sticky time by setting the field -`service.spec.sessionAffinityConfig.clientIP.timeoutSeconds` if you have already set -`service.spec.sessionAffinity` to `"ClientIP"` (the default is "10800"). +By default, the choice of backend is round robin. ![Services overview diagram for userspace proxy](/images/docs/services-userspace-overview.svg) ### Proxy-mode: iptables In this mode, kube-proxy watches the Kubernetes master for the addition and -removal of `Service` and `Endpoints` objects. For each `Service` it installs +removal of `Service` and `Endpoints` objects. For each `Service`, it installs iptables rules which capture traffic to the `Service`'s `clusterIP` (which is virtual) and `Port` and redirects that traffic to one of the `Service`'s -backend sets. For each `Endpoints` object it installs iptables rules which -select a backend `Pod`. +backend sets. For each `Endpoints` object, it installs iptables rules which +select a backend `Pod`.By default, the choice of backend is random. -By default, the choice of backend is random. Client-IP based session affinity -can be selected by setting `service.spec.sessionAffinity` to `"ClientIP"` (the -default is `"None"`), and you can set the max session sticky time by setting the field -`service.spec.sessionAffinityConfig.clientIP.timeoutSeconds` if you have already set -`service.spec.sessionAffinity` to `"ClientIP"` (the default is "10800"). - -As with the userspace proxy, the net result is that any traffic bound for the -`Service`'s IP:Port is proxied to an appropriate backend without the clients -knowing anything about Kubernetes or `Services` or `Pods`. This should be +Obviously, iptables need not switch back between userspace and kernelspace, it should be faster and more reliable than the userspace proxy. However, unlike the userspace proxier, the iptables proxier cannot automatically retry another `Pod` if the one it initially selects does not respond, so it depends on @@ -231,12 +212,21 @@ options for load balancing algorithm, such as: - nq: never queue **Note:** ipvs mode assumed IPVS kernel modules are installed on the node -before running kube-proxy. When kube-proxy starts, if proxy mode is ipvs, +before running kube-proxy. When kube-proxy starts with ipvs proxy mode, kube-proxy would validate if IPVS modules are installed on the node, if it's not installed kube-proxy will fall back to iptables proxy mode. ![Services overview diagram for ipvs proxy](/images/docs/services-ipvs-overview.svg) +In any of proxy model, any traffic bound for the Service’s IP:Port is +proxied to an appropriate backend without the clients knowing anything +about Kubernetes or Services or Pods. Client-IP based session affinity +can be selected by setting service.spec.sessionAffinity to "ClientIP" +(the default is "None"), and you can set the max session sticky time by +setting the field service.spec.sessionAffinityConfig.clientIP.timeoutSeconds +if you have already set service.spec.sessionAffinity to "ClientIP" +(the default is “10800”). + ## Multi-Port Services Many `Services` need to expose more than one port. For this case, Kubernetes @@ -708,6 +698,10 @@ work, and the client IP is not altered. This same basic flow executes when traffic comes in through a node-port or through a load-balancer, though in those cases the client IP does get altered. +#### Ipvs + +Iptables operations slow down dramatically in large scale cluster e.g 10,000 Services. IPVS is designed for load balancing and based on in-kernel hash tables. So we can achieve performance consistency in large number of services from IPVS-based kube-proxy. Meanwhile, IPVS-based kube-proxy has more sophisticated load balancing algorithms (least conns, locality, weighted, persistence). + ## API Object Service is a top-level resource in the Kubernetes REST API. More details about the diff --git a/docs/concepts/storage/persistent-volumes.md b/docs/concepts/storage/persistent-volumes.md index 4dccc7bc75..aebe9c5cf6 100644 --- a/docs/concepts/storage/persistent-volumes.md +++ b/docs/concepts/storage/persistent-volumes.md @@ -54,7 +54,7 @@ dynamic provisioning for themselves. To enable dynamic storage provisioning based on storage class, the cluster administrator needs to enable the `DefaultStorageClass` [admission controller](/docs/admin/admission-controllers/#defaultstorageclass) on the API server. This can be done, for example, by ensuring that `DefaultStorageClass` is -among the comma-delimited, ordered list of values for the `--admission-control` flag of +among the comma-delimited, ordered list of values for the `--admission-control` flag of the API server component. For more information on API server command line flags, please check [kube-apiserver](/docs/admin/kube-apiserver/) documentation. @@ -417,8 +417,6 @@ spec: `PersistentVolumes` binds are exclusive, and since `PersistentVolumeClaims` are namespaced objects, mounting claims with "Many" modes (`ROX`, `RWX`) is only possible within one namespace. -`` - ## Writing Portable Configuration If you're writing configuration templates or examples that run on a wide range of clusters @@ -455,4 +453,3 @@ and need persistent storage, we recommend that you use the following pattern: default. At some point, the alpha annotation will cease to have meaning, but the unset `storageClass` field on the PVC will have the desired effect. - diff --git a/docs/concepts/storage/volumes.md b/docs/concepts/storage/volumes.md index 4ea6df948a..2d2ad25678 100644 --- a/docs/concepts/storage/volumes.md +++ b/docs/concepts/storage/volumes.md @@ -65,33 +65,118 @@ mount each volume. Kubernetes supports several types of Volumes: - * `emptyDir` - * `hostPath` - * `gcePersistentDisk` * `awsElasticBlockStore` - * `nfs` - * `iscsi` - * `fc (fibre channel)` - * `flocker` - * `glusterfs` - * `rbd` - * `cephfs` - * `gitRepo` - * `secret` - * `persistentVolumeClaim` - * `downwardAPI` - * `projected` - * `azureFileVolume` * `azureDisk` - * `vsphereVolume` - * `Quobyte` - * `PortworxVolume` - * `ScaleIO` - * `StorageOS` + * `azureFile` + * `cephfs` + * `downwardAPI` + * `emptyDir` + * `fc` (fibre channel) + * `flocker` + * `gcePersistentDisk` + * `gitRepo` + * `glusterfs` + * `hostPath` + * `iscsi` * `local` + * `nfs` + * `persistentVolumeClaim` + * `projected` + * `portworxVolume` + * `quobyte` + * `rbd` + * `scaleIO` + * `secret` + * `storageos` + * `vsphereVolume` We welcome additional contributions. +### awsElasticBlockStore + +An `awsElasticBlockStore` volume mounts an Amazon Web Services (AWS) [EBS +Volume](http://aws.amazon.com/ebs/) into your pod. Unlike +`emptyDir`, which is erased when a Pod is removed, the contents of an EBS +volume are preserved and the volume is merely unmounted. This means that an +EBS volume can be pre-populated with data, and that data can be "handed off" +between pods. + +**Important:** You must create an EBS volume using `aws ec2 create-volume` or the AWS API before you can use it. +{: .caution} + +There are some restrictions when using an awsElasticBlockStore volume: + +* the nodes on which pods are running must be AWS EC2 instances +* those instances need to be in the same region and availability-zone as the EBS volume +* EBS only supports a single EC2 instance mounting a volume + +#### Creating an EBS volume + +Before you can use an EBS volume with a pod, you need to create it. + +```shell +aws ec2 create-volume --availability-zone=eu-west-1a --size=10 --volume-type=gp2 +``` + +Make sure the zone matches the zone you brought up your cluster in. (And also check that the size and EBS volume +type are suitable for your use!) + +#### AWS EBS Example configuration + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: test-ebs +spec: + containers: + - image: gcr.io/google_containers/test-webserver + name: test-container + volumeMounts: + - mountPath: /test-ebs + name: test-volume + volumes: + - name: test-volume + # This AWS EBS volume must already exist. + awsElasticBlockStore: + volumeID: + fsType: ext4 +``` + +### azureDisk + +A `azureDisk` is used to mount a Microsoft Azure [Data Disk](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-about-disks-vhds/) into a Pod. + +More details can be found [here](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/azure_disk/README.md). + +### azureFile + +A `azureFile` is used to mount a Microsoft Azure File Volume (SMB 2.1 and 3.0) +into a Pod. + +More details can be found [here](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/azure_file/README.md). + +### cephfs + +A `cephfs` volume allows an existing CephFS volume to be +mounted into your pod. Unlike `emptyDir`, which is erased when a Pod is +removed, the contents of a `cephfs` volume are preserved and the volume is merely +unmounted. This means that a CephFS volume can be pre-populated with data, and +that data can be "handed off" between pods. CephFS can be mounted by multiple +writers simultaneously. + +**Important:** You must have your own Ceph server running with the share exported before you can use it. +{: .caution} + +See the [CephFS example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/cephfs/) for more details. + +### downwardAPI + +A `downwardAPI` volume is used to make downward API data available to applications. +It mounts a directory and writes the requested data in plain text files. + +See the [`downwardAPI` volume example](/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/) for more details. + ### emptyDir An `emptyDir` volume is first created when a Pod is assigned to a Node, and @@ -138,6 +223,132 @@ spec: emptyDir: {} ``` +### fc (fibre channel) + +An `fc` volume allows an existing fibre channel volume to be mounted in a pod. +You can specify single or multiple target World Wide Names using the parameter +`targetWWNs` in your volume configuration. If multiple WWNs are specified, +targetWWNs expect that those WWNs are from multi-path connections. + +**Important:** You must configure FC SAN Zoning to allocate and mask those LUNs (volumes) to the target WWNs beforehand so that Kubernetes hosts can access them. +{: .caution} + +See the [FC example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/fibre_channel) for more details. + +### flocker + +[Flocker](https://clusterhq.com/flocker) is an open-source clustered container data volume manager. It provides management +and orchestration of data volumes backed by a variety of storage backends. + +A `flocker` volume allows a Flocker dataset to be mounted into a pod. If the +dataset does not already exist in Flocker, it needs to be first created with the Flocker +CLI or by using the Flocker API. If the dataset already exists it will be +reattached by Flocker to the node that the pod is scheduled. This means data +can be "handed off" between pods as required. + +**Important:** You must have your own Flocker installation running before you can use it. +{: .caution} + +See the [Flocker example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/flocker) for more details. + +### gcePersistentDisk + +A `gcePersistentDisk` volume mounts a Google Compute Engine (GCE) [Persistent +Disk](http://cloud.google.com/compute/docs/disks) into your pod. Unlike +`emptyDir`, which is erased when a Pod is removed, the contents of a PD are +preserved and the volume is merely unmounted. This means that a PD can be +pre-populated with data, and that data can be "handed off" between pods. + +**Important:** You must create a PD using `gcloud` or the GCE API or UI before you can use it. +{: .caution} + +There are some restrictions when using a `gcePersistentDisk`: + +* the nodes on which pods are running must be GCE VMs +* those VMs need to be in the same GCE project and zone as the PD + +A feature of PD is that they can be mounted as read-only by multiple consumers +simultaneously. This means that you can pre-populate a PD with your dataset +and then serve it in parallel from as many pods as you need. Unfortunately, +PDs can only be mounted by a single consumer in read-write mode - no +simultaneous writers allowed. + +Using a PD on a pod controlled by a ReplicationController will fail unless +the PD is read-only or the replica count is 0 or 1. + +#### Creating a PD + +Before you can use a GCE PD with a pod, you need to create it. + +```shell +gcloud compute disks create --size=500GB --zone=us-central1-a my-data-disk +``` + +#### Example pod + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: test-pd +spec: + containers: + - image: gcr.io/google_containers/test-webserver + name: test-container + volumeMounts: + - mountPath: /test-pd + name: test-volume + volumes: + - name: test-volume + # This GCE PD must already exist. + gcePersistentDisk: + pdName: my-data-disk + fsType: ext4 +``` + +### gitRepo + +A `gitRepo` volume is an example of what can be done as a volume plugin. It +mounts an empty directory and clones a git repository into it for your pod to +use. In the future, such volumes may be moved to an even more decoupled model, +rather than extending the Kubernetes API for every such use case. + +Here is an example for gitRepo volume: + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: server +spec: + containers: + - image: nginx + name: nginx + volumeMounts: + - mountPath: /mypath + name: git-volume + volumes: + - name: git-volume + gitRepo: + repository: "git@somewhere:me/my-git-repository.git" + revision: "22f1d8406d464b0c0874075539c1f2e96c253775" +``` + +### glusterfs + +A `glusterfs` volume allows a [Glusterfs](http://www.gluster.org) (an open +source networked filesystem) volume to be mounted into your pod. Unlike +`emptyDir`, which is erased when a Pod is removed, the contents of a +`glusterfs` volume are preserved and the volume is merely unmounted. This +means that a glusterfs volume can be pre-populated with data, and that data can +be "handed off" between pods. GlusterFS can be mounted by multiple writers +simultaneously. + +**Important:** You must have your own GlusterFS installation running before you can use it. +{: .caution} + +See the [GlusterFS example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/glusterfs) for more details. + ### hostPath A `hostPath` volume mounts a file or directory from the host node's filesystem @@ -202,126 +413,6 @@ spec: type: Directory ``` -### gcePersistentDisk - -A `gcePersistentDisk` volume mounts a Google Compute Engine (GCE) [Persistent -Disk](http://cloud.google.com/compute/docs/disks) into your pod. Unlike -`emptyDir`, which is erased when a Pod is removed, the contents of a PD are -preserved and the volume is merely unmounted. This means that a PD can be -pre-populated with data, and that data can be "handed off" between pods. - -**Important:** You must create a PD using `gcloud` or the GCE API or UI before you can use it. -{: .caution} - -There are some restrictions when using a `gcePersistentDisk`: - -* the nodes on which pods are running must be GCE VMs -* those VMs need to be in the same GCE project and zone as the PD - -A feature of PD is that they can be mounted as read-only by multiple consumers -simultaneously. This means that you can pre-populate a PD with your dataset -and then serve it in parallel from as many pods as you need. Unfortunately, -PDs can only be mounted by a single consumer in read-write mode - no -simultaneous writers allowed. - -Using a PD on a pod controlled by a ReplicationController will fail unless -the PD is read-only or the replica count is 0 or 1. - -#### Creating a PD - -Before you can use a GCE PD with a pod, you need to create it. - -```shell -gcloud compute disks create --size=500GB --zone=us-central1-a my-data-disk -``` - -#### Example pod - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: test-pd -spec: - containers: - - image: gcr.io/google_containers/test-webserver - name: test-container - volumeMounts: - - mountPath: /test-pd - name: test-volume - volumes: - - name: test-volume - # This GCE PD must already exist. - gcePersistentDisk: - pdName: my-data-disk - fsType: ext4 -``` - -### awsElasticBlockStore - -An `awsElasticBlockStore` volume mounts an Amazon Web Services (AWS) [EBS -Volume](http://aws.amazon.com/ebs/) into your pod. Unlike -`emptyDir`, which is erased when a Pod is removed, the contents of an EBS -volume are preserved and the volume is merely unmounted. This means that an -EBS volume can be pre-populated with data, and that data can be "handed off" -between pods. - -**Important:** You must create an EBS volume using `aws ec2 create-volume` or the AWS API before you can use it. -{: .caution} - -There are some restrictions when using an awsElasticBlockStore volume: - -* the nodes on which pods are running must be AWS EC2 instances -* those instances need to be in the same region and availability-zone as the EBS volume -* EBS only supports a single EC2 instance mounting a volume - -#### Creating an EBS volume - -Before you can use an EBS volume with a pod, you need to create it. - -```shell -aws ec2 create-volume --availability-zone=eu-west-1a --size=10 --volume-type=gp2 -``` - -Make sure the zone matches the zone you brought up your cluster in. (And also check that the size and EBS volume -type are suitable for your use!) - -#### AWS EBS Example configuration - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: test-ebs -spec: - containers: - - image: gcr.io/google_containers/test-webserver - name: test-container - volumeMounts: - - mountPath: /test-ebs - name: test-volume - volumes: - - name: test-volume - # This AWS EBS volume must already exist. - awsElasticBlockStore: - volumeID: - fsType: ext4 -``` - -### nfs - -An `nfs` volume allows an existing NFS (Network File System) share to be -mounted into your pod. Unlike `emptyDir`, which is erased when a Pod is -removed, the contents of an `nfs` volume are preserved and the volume is merely -unmounted. This means that an NFS volume can be pre-populated with data, and -that data can be "handed off" between pods. NFS can be mounted by multiple -writers simultaneously. - -**Important:** You must have your own NFS server running with the share exported before you can use it. -{: .caution} - -See the [NFS example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/nfs) for more details. - ### iscsi An `iscsi` volume allows an existing iSCSI (SCSI over IP) volume to be mounted @@ -341,123 +432,71 @@ simultaneous writers allowed. See the [iSCSI example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/iscsi) for more details. -### fc (fibre channel) +### local -An `fc` volume allows an existing fibre channel volume to be mounted in a pod. -You can specify single or multiple target World Wide Names using the parameter -`targetWWNs` in your volume configuration. If multiple WWNs are specified, -targetWWNs expect that those WWNs are from multi-path connections. +This volume type is alpha in 1.7. -**Important:** You must configure FC SAN Zoning to allocate and mask those LUNs (volumes) to the target WWNs beforehand so that Kubernetes hosts can access them. -{: .caution} +A `local` volume represents a mounted local storage device such as a disk, +partition or directory. -See the [FC example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/fibre_channel) for more details. +Local volumes can only be used as a statically created PersistentVolume. -### flocker +Compared to HostPath volumes, local volumes can be used in a durable manner +without manually scheduling pods to nodes, as the system is aware of the volume's +node constraints. -[Flocker](https://clusterhq.com/flocker) is an open-source clustered container data volume manager. It provides management -and orchestration of data volumes backed by a variety of storage backends. +However, local volumes are still subject to the availability of the underlying +node and are not suitable for all applications. -A `flocker` volume allows a Flocker dataset to be mounted into a pod. If the -dataset does not already exist in Flocker, it needs to be first created with the Flocker -CLI or by using the Flocker API. If the dataset already exists it will be -reattached by Flocker to the node that the pod is scheduled. This means data -can be "handed off" between pods as required. +The following is an example PersistentVolume spec using a `local` volume: -**Important:** You must have your own Flocker installation running before you can use it. -{: .caution} - -See the [Flocker example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/flocker) for more details. - -### glusterfs - -A `glusterfs` volume allows a [Glusterfs](http://www.gluster.org) (an open -source networked filesystem) volume to be mounted into your pod. Unlike -`emptyDir`, which is erased when a Pod is removed, the contents of a -`glusterfs` volume are preserved and the volume is merely unmounted. This -means that a glusterfs volume can be pre-populated with data, and that data can -be "handed off" between pods. GlusterFS can be mounted by multiple writers -simultaneously. - -**Important:** You must have your own GlusterFS installation running before you can use it. -{: .caution} - -See the [GlusterFS example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/glusterfs) for more details. - -### rbd - -An `rbd` volume allows a [Rados Block -Device](http://ceph.com/docs/master/rbd/rbd/) volume to be mounted into your -pod. Unlike `emptyDir`, which is erased when a Pod is removed, the contents of -a `rbd` volume are preserved and the volume is merely unmounted. This -means that a RBD volume can be pre-populated with data, and that data can -be "handed off" between pods. - -**Important:** You must have your own Ceph installation running before you can use RBD. -{: .caution} - -A feature of RBD is that it can be mounted as read-only by multiple consumers -simultaneously. This means that you can pre-populate a volume with your dataset -and then serve it in parallel from as many pods as you need. Unfortunately, -RBD volumes can only be mounted by a single consumer in read-write mode - no -simultaneous writers allowed. - -See the [RBD example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/rbd) for more details. - -### cephfs - -A `cephfs` volume allows an existing CephFS volume to be -mounted into your pod. Unlike `emptyDir`, which is erased when a Pod is -removed, the contents of a `cephfs` volume are preserved and the volume is merely -unmounted. This means that a CephFS volume can be pre-populated with data, and -that data can be "handed off" between pods. CephFS can be mounted by multiple -writers simultaneously. - -**Important:** You must have your own Ceph server running with the share exported before you can use it. -{: .caution} - -See the [CephFS example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/cephfs/) for more details. - -### gitRepo - -A `gitRepo` volume is an example of what can be done as a volume plugin. It -mounts an empty directory and clones a git repository into it for your pod to -use. In the future, such volumes may be moved to an even more decoupled model, -rather than extending the Kubernetes API for every such use case. - -Here is an example for gitRepo volume: - -```yaml +``` yaml apiVersion: v1 -kind: Pod +kind: PersistentVolume metadata: - name: server + name: example-pv + annotations: + "volume.alpha.kubernetes.io/node-affinity": '{ + "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [ + { "matchExpressions": [ + { "key": "kubernetes.io/hostname", + "operator": "In", + "values": ["example-node"] + } + ]} + ]} + }' spec: - containers: - - image: nginx - name: nginx - volumeMounts: - - mountPath: /mypath - name: git-volume - volumes: - - name: git-volume - gitRepo: - repository: "git@somewhere:me/my-git-repository.git" - revision: "22f1d8406d464b0c0874075539c1f2e96c253775" + capacity: + storage: 100Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Delete + storageClassName: local-storage + local: + path: /mnt/disks/ssd1 ``` -### secret +**Note:** The local PersistentVolume cleanup and deletion requires manual intervention without the external provisioner. +{: .note} -A `secret` volume is used to pass sensitive information, such as passwords, to -pods. You can store secrets in the Kubernetes API and mount them as files for -use by pods without coupling to Kubernetes directly. `secret` volumes are -backed by tmpfs (a RAM-backed filesystem) so they are never written to -non-volatile storage. +For details on the `local` volume type, see the [Local Persistent Storage +user guide](https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume). -**Important:** You must create a secret in the Kubernetes API before you can use it. +### nfs + +An `nfs` volume allows an existing NFS (Network File System) share to be +mounted into your pod. Unlike `emptyDir`, which is erased when a Pod is +removed, the contents of an `nfs` volume are preserved and the volume is merely +unmounted. This means that an NFS volume can be pre-populated with data, and +that data can be "handed off" between pods. NFS can be mounted by multiple +writers simultaneously. + +**Important:** You must have your own NFS server running with the share exported before you can use it. {: .caution} -Secrets are described in more detail [here](/docs/user-guide/secrets). +See the [NFS example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/nfs) for more details. ### persistentVolumeClaim @@ -469,13 +508,6 @@ iSCSI volume) without knowing the details of the particular cloud environment. See the [PersistentVolumes example](/docs/concepts/storage/persistent-volumes/) for more details. -### downwardAPI - -A `downwardAPI` volume is used to make downward API data available to applications. -It mounts a directory and writes the requested data in plain text files. - -See the [`downwardAPI` volume example](/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/) for more details. - ### projected A `projected` volume maps several existing volume sources into the same directory. @@ -564,27 +596,189 @@ Each projected volume source is listed in the spec under `sources`. The parameters are nearly the same with two exceptions: * For secrets, the `secretName` field has been changed to `name` to be consistent -with ConfigMap naming. + with ConfigMap naming. * The `defaultMode` can only be specified at the projected level and not for each -volume source. However, as illustrated above, you can explicitly set the `mode` -for each individual projection. + volume source. However, as illustrated above, you can explicitly set the `mode` + for each individual projection. -### AzureFileVolume +### portworxVolume -A `AzureFileVolume` is used to mount a Microsoft Azure File Volume (SMB 2.1 and 3.0) -into a Pod. +A `portworxVolume` is an elastic block storage layer that runs hyperconverged with +Kubernetes. Portworx fingerprints storage in a server, tiers based on capabilities, +and aggregates capacity across multiple servers. Portworx runs in-guest in virtual +machines or on bare metal Linux nodes. -More details can be found [here](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/azure_file/README.md). +A `portworxVolume` can be dynamically created through Kubernetes or it can also +be pre-provisioned and referenced inside a Kubernetes pod. +Here is an example pod referencing a pre-provisioned PortworxVolume: -### AzureDiskVolume +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: test-portworx-volume-pod +spec: + containers: + - image: gcr.io/google_containers/test-webserver + name: test-container + volumeMounts: + - mountPath: /mnt + name: pxvol + volumes: + - name: pxvol + # This Portworx volume must already exist. + portworxVolume: + volumeID: "pxvol" + fsType: "" +``` -A `AzureDiskVolume` is used to mount a Microsoft Azure [Data Disk](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-about-disks-vhds/) into a Pod. +**Important:** Make sure you have an existing PortworxVolume with name `pxvol` +before using it in the pod. +{: .caution} -More details can be found [here](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/azure_disk/README.md). +More details and examples can be found [here](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/portworx/README.md). + +### quobyte + +A `quobyte` volume allows an existing [Quobyte](http://www.quobyte.com) volume to +be mounted into your pod. + +**Important:** You must have your own Quobyte setup running with the volumes +created before you can use it. +{: .caution} + +See the [Quobyte example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/quobyte) for more details. + +### rbd + +An `rbd` volume allows a [Rados Block +Device](http://ceph.com/docs/master/rbd/rbd/) volume to be mounted into your +pod. Unlike `emptyDir`, which is erased when a Pod is removed, the contents of +a `rbd` volume are preserved and the volume is merely unmounted. This +means that a RBD volume can be pre-populated with data, and that data can +be "handed off" between pods. + +**Important:** You must have your own Ceph installation running before you can use RBD. +{: .caution} + +A feature of RBD is that it can be mounted as read-only by multiple consumers +simultaneously. This means that you can pre-populate a volume with your dataset +and then serve it in parallel from as many pods as you need. Unfortunately, +RBD volumes can only be mounted by a single consumer in read-write mode - no +simultaneous writers allowed. + +See the [RBD example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/rbd) for more details. + +### scaleIO + +ScaleIO is a software-based storage platform that can use existing hardware to +create clusters of scalable shared block networked storage. The `scaleIO` volume +plugin allows deployed pods to access existing ScaleIO +volumes (or it can dynamically provision new volumes for persistent volume claims, see +[ScaleIO Persistent Volumes](/docs/concepts/storage/persistent-volumes/#scaleio)). + +**Important:** You must have an existing ScaleIO cluster already setup and +running with the volumes created before you can use them. +{: .caution} + +The following is an example pod configuration with ScaleIO: + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: pod-0 +spec: + containers: + - image: gcr.io/google_containers/test-webserver + name: pod-0 + volumeMounts: + - mountPath: /test-pd + name: vol-0 + volumes: + - name: vol-0 + scaleIO: + gateway: https://localhost:443/api + system: scaleio + protectionDomain: sd0 + storagePool: sp1 + volumeName: vol-0 + secretRef: + name: sio-secret + fsType: xfs +``` + +For further detail, please the see the [ScaleIO examples](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/scaleio). + +### secret + +A `secret` volume is used to pass sensitive information, such as passwords, to +pods. You can store secrets in the Kubernetes API and mount them as files for +use by pods without coupling to Kubernetes directly. `secret` volumes are +backed by tmpfs (a RAM-backed filesystem) so they are never written to +non-volatile storage. + +**Important:** You must create a secret in the Kubernetes API before you can use it. +{: .caution} + +Secrets are described in more detail [here](/docs/user-guide/secrets). + +### storageOS + +A `storageos` volume allows an existing [StorageOS](https://www.storageos.com) +volume to be mounted into your pod. + +StorageOS runs as a container within your Kubernetes environment, making local +or attached storage accessible from any node within the Kubernetes cluster. +Data can be replicated to protect against node failure. Thin provisioning and +compression can improve utilization and reduce cost. + +At its core, StorageOS provides block storage to containers, accessible via a file system. + +The StorageOS container requires 64-bit Linux and has no additional dependencies. +A free developer license is available. + +**Important:** You must run the StorageOS container on each node that wants to +access StorageOS volumes or that will contribute storage capacity to the pool. +For installation instructions, consult the +[StorageOS documentation](https://docs.storageos.com). +{: .caution} + +```yaml +apiVersion: v1 +kind: Pod +metadata: + labels: + name: redis + role: master + name: test-storageos-redis +spec: + containers: + - name: master + image: kubernetes/redis:v1 + env: + - name: MASTER + value: "true" + ports: + - containerPort: 6379 + volumeMounts: + - mountPath: /redis-master-data + name: redis-data + volumes: + - name: redis-data + storageos: + # The `redis-vol01` volume must already exist within StorageOS in the `default` namespace. + volumeName: redis-vol01 + fsType: ext4 +``` + +For more information including Dynamic Provisioning and Persistent Volume Claims, please see the +[StorageOS examples](https://github.com/kubernetes/kubernetes/tree/master/examples/volumes/storageos). ### vsphereVolume -**Prerequisite:** Kubernetes with vSphere Cloud Provider configured. For cloudprovider configuration please refer [vSphere getting started guide](/docs/getting-started-guides/vsphere/). +**Prerequisite:** Kubernetes with vSphere Cloud Provider configured. For cloudprovider +configuration please refer [vSphere getting started guide](/docs/getting-started-guides/vsphere/). {: .note} A `vsphereVolume` is used to mount a vSphere VMDK Volume into your Pod. The contents @@ -638,185 +832,10 @@ spec: volumePath: "[DatastoreName] volumes/myDisk" fsType: ext4 ``` + More examples can be found [here](https://github.com/kubernetes/examples/tree/master/staging/volumes/vsphere). -### Quobyte - -A `Quobyte` volume allows an existing [Quobyte](http://www.quobyte.com) volume to be mounted into your pod. - -**Important:** You must have your own Quobyte setup running with the volumes created before you can use it. -{: .caution} - -See the [Quobyte example](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/quobyte) for more details. - -### PortworxVolume -A `PortworxVolume` is an elastic block storage layer that runs hyperconverged with Kubernetes. Portworx fingerprints storage in a -server, tiers based on capabilities, and aggregates capacity across multiple servers. Portworx runs in-guest in virtual machines or on bare metal -Linux nodes. - -A `PortworxVolume` can be dynamically created through Kubernetes or it can also be pre-provisioned and referenced inside a Kubernetes pod. -Here is an example pod referencing a pre-provisioned PortworxVolume: - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: test-portworx-volume-pod -spec: - containers: - - image: gcr.io/google_containers/test-webserver - name: test-container - volumeMounts: - - mountPath: /mnt - name: pxvol - volumes: - - name: pxvol - # This Portworx volume must already exist. - portworxVolume: - volumeID: "pxvol" - fsType: "" -``` - -**Important:** Make sure you have an existing PortworxVolume with name `pxvol` before using it in the pod. -{: .caution} - -More details and examples can be found [here](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/portworx/README.md). - -### ScaleIO -ScaleIO is a software-based storage platform that can use existing hardware to create clusters of scalable -shared block networked storage. The ScaleIO volume plugin allows deployed pods to access existing ScaleIO -volumes (or it can dynamically provision new volumes for persistent volume claims, see -[ScaleIO Persistent Volumes](/docs/concepts/storage/persistent-volumes/#scaleio)). - -**Important:** You must have an existing ScaleIO cluster already setup and running with the volumes created before you can use them. -{: .caution} - -The following is an example pod configuration with ScaleIO: - -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: pod-0 -spec: - containers: - - image: gcr.io/google_containers/test-webserver - name: pod-0 - volumeMounts: - - mountPath: /test-pd - name: vol-0 - volumes: - - name: vol-0 - scaleIO: - gateway: https://localhost:443/api - system: scaleio - protectionDomain: sd0 - storagePool: sp1 - volumeName: vol-0 - secretRef: - name: sio-secret - fsType: xfs -``` - -For further detail, please the see the [ScaleIO examples](https://github.com/kubernetes/examples/tree/{{page.githubbranch}}/staging/volumes/scaleio). - -### StorageOS -A `storageos` volume allows an existing [StorageOS](https://www.storageos.com) volume to be mounted into your pod. - -StorageOS runs as a container within your Kubernetes environment, making local or attached storage accessible from any node within the Kubernetes cluster. Data can be replicated to protect against node failure. Thin provisioning and compression can improve utilization and reduce cost. - -At its core, StorageOS provides block storage to containers, accessible via a file system. - -The StorageOS container requires 64-bit Linux and has no additional dependencies. A free developer licence is available. - -**Important:** You must run the StorageOS container on each node that wants to access StorageOS volumes or that will contribute storage capacity to the pool. For installation instructions, consult the [StorageOS documentation](https://docs.storageos.com). -{: .caution} - -```yaml -apiVersion: v1 -kind: Pod -metadata: - labels: - name: redis - role: master - name: test-storageos-redis -spec: - containers: - - name: master - image: kubernetes/redis:v1 - env: - - name: MASTER - value: "true" - ports: - - containerPort: 6379 - volumeMounts: - - mountPath: /redis-master-data - name: redis-data - volumes: - - name: redis-data - storageos: - # The `redis-vol01` volume must already exist within StorageOS in the `default` namespace. - volumeName: redis-vol01 - fsType: ext4 -``` - -For more information including Dynamic Provisioning and Persistent Volume Claims, please see the -[StorageOS examples](https://github.com/kubernetes/kubernetes/tree/master/examples/volumes/storageos). - - -### local - -This volume type is alpha in 1.7. - -A `local` volume represents a mounted local storage device such as a disk, -partition or directory. - -Local volumes can only be used as a statically created PersistentVolume. - -Compared to HostPath volumes, local volumes can be used in a durable manner -without manually scheduling pods to nodes, as the system is aware of the volume's -node constraints. - -However, local volumes are still subject to the availability of the underlying -node and are not suitable for all applications. - -The following is an example PersistentVolume spec using a `local` volume: - -``` yaml -apiVersion: v1 -kind: PersistentVolume -metadata: - name: example-pv - annotations: - "volume.alpha.kubernetes.io/node-affinity": '{ - "requiredDuringSchedulingIgnoredDuringExecution": { - "nodeSelectorTerms": [ - { "matchExpressions": [ - { "key": "kubernetes.io/hostname", - "operator": "In", - "values": ["example-node"] - } - ]} - ]} - }' -spec: - capacity: - storage: 100Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Delete - storageClassName: local-storage - local: - path: /mnt/disks/ssd1 -``` - -**Note:** The local PersistentVolume cleanup and deletion requires manual intervention without the external provisioner. -{: .note} - -For details on the `local` volume type, see the [Local Persistent Storage -user guide](https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume). - ## Using subPath Sometimes, it is useful to share one volume for multiple uses in a single pod. The `volumeMounts.subPath` diff --git a/docs/concepts/workloads/controllers/daemonset.md b/docs/concepts/workloads/controllers/daemonset.md index 3c5898a3fd..d29c91ea0b 100644 --- a/docs/concepts/workloads/controllers/daemonset.md +++ b/docs/concepts/workloads/controllers/daemonset.md @@ -129,6 +129,8 @@ labelled as critical, the Daemon pods are created with an additional Note that all above `NoSchedule` taints above are created only in version 1.8 or later if the alpha feature `TaintNodesByCondition` is enabled. +Also note that the `node-role.kubernetes.io/master` `NoSchedule` toleration specified in the above example is needed on 1.6 or later to schedule on *master* nodes as this is not a default toleration. + ## Communicating with Daemon Pods Some possible patterns for communicating with Pods in a DaemonSet are: diff --git a/docs/concepts/workloads/controllers/daemonset.yaml b/docs/concepts/workloads/controllers/daemonset.yaml index 1788487382..b94e564259 100644 --- a/docs/concepts/workloads/controllers/daemonset.yaml +++ b/docs/concepts/workloads/controllers/daemonset.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1beta2 # for versions before 1.8.0 use apps/v1beta1 +apiVersion: apps/v1beta2 # for versions before 1.8.0 use extensions/v1beta1 kind: DaemonSet metadata: name: fluentd-elasticsearch @@ -14,6 +14,9 @@ spec: labels: name: fluentd-elasticsearch spec: + tolerations: + - key: node-role.kubernetes.io/master + effect: NoSchedule containers: - name: fluentd-elasticsearch image: gcr.io/google-containers/fluentd-elasticsearch:1.20 diff --git a/docs/concepts/workloads/controllers/garbage-collection.md b/docs/concepts/workloads/controllers/garbage-collection.md index b220a17cdd..2f83cc87ab 100644 --- a/docs/concepts/workloads/controllers/garbage-collection.md +++ b/docs/concepts/workloads/controllers/garbage-collection.md @@ -40,7 +40,7 @@ If you create the ReplicaSet and then view the Pod metadata, you can see OwnerReferences field: ```shell -kubectl create -f https://k8s.io/docs/concepts/abstractions/controllers/my-repset.yaml +kubectl create -f https://k8s.io/docs/concepts/controllers/my-repset.yaml kubectl get pods --output=yaml ``` diff --git a/docs/concepts/workloads/pods/init-containers.md b/docs/concepts/workloads/pods/init-containers.md index b1b7120d46..355620ad12 100644 --- a/docs/concepts/workloads/pods/init-containers.md +++ b/docs/concepts/workloads/pods/init-containers.md @@ -89,7 +89,7 @@ Here are some ideas for how to use Init Containers: configuration file using Jinja. More detailed usage examples can be found in the [StatefulSets documentation](/docs/concepts/workloads/controllers/statefulset/) -and the [Production Pods guide](/docs/tasks/#handling-initialization). +and the [Production Pods guide](/docs/tasks/configure-pod-container/configure-pod-initialization/). ### Init Containers in use diff --git a/docs/home/contribute/style-guide.md b/docs/home/contribute/style-guide.md index 4b5efb30bd..db330d32ab 100644 --- a/docs/home/contribute/style-guide.md +++ b/docs/home/contribute/style-guide.md @@ -18,6 +18,12 @@ docs, follow the instructions on **Note:** Kubernetes documentation uses [GitHub Flavored Markdown](https://github.github.com/gfm/). {: .note} + +## Language + +Kubernetes documentation uses US English. + + ## Documentation formatting standards ### Use camel case for API objects diff --git a/docs/setup/independent/create-cluster-kubeadm.md b/docs/setup/independent/create-cluster-kubeadm.md index 2dc0259a00..1d7c2448dd 100644 --- a/docs/setup/independent/create-cluster-kubeadm.md +++ b/docs/setup/independent/create-cluster-kubeadm.md @@ -271,7 +271,7 @@ to pass bridged IPv4 traffic to iptables' chains. This is a requirement for some please see [here](https://kubernetes.io/docs/concepts/cluster-administration/network-plugins/#network-plugin-requirements). ```shell -kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.0/Documentation/kube-flannel.yml +kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml ``` - For more information about `flannel`, please see [here](https://github.com/coreos/flannel). diff --git a/docs/setup/independent/install-kubeadm.md b/docs/setup/independent/install-kubeadm.md index 3a4c1536c2..b07895df7c 100644 --- a/docs/setup/independent/install-kubeadm.md +++ b/docs/setup/independent/install-kubeadm.md @@ -86,15 +86,21 @@ apt-get update apt-get install -y docker.io ``` -or install Docker CE 17.03 from Docker's repositories for Ubuntu or Debian: +or install Docker CE 17.09 from Docker's repositories for Ubuntu or Debian: ```bash -apt-get update && apt-get install -y curl apt-transport-https +apt-get update +apt-get install -y \ + apt-transport-https \ + ca-certificates \ + curl \ + software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - -cat </etc/apt/sources.list.d/docker.list -deb https://download.docker.com/linux/$(lsb_release -si | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable -EOF -apt-get update && apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 17.03 | head -1 | awk '{print $3}') +add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \ + $(lsb_release -cs) \ + stable" +apt-get update && apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 17.09 | head -1 | awk '{print $3}') ``` {% endcapture %} @@ -130,6 +136,9 @@ as Docker (e.g. `cgroupfs`). {% include tabs.md %} +Refer to the [official Docker installation guides](https://docs.docker.com/engine/installation/) +for more information. + ## Installing kubeadm, kubelet and kubectl You will install these packages on all of your machines: diff --git a/docs/setup/pick-right-solution.md b/docs/setup/pick-right-solution.md index d823609725..2c9c7844c1 100644 --- a/docs/setup/pick-right-solution.md +++ b/docs/setup/pick-right-solution.md @@ -55,7 +55,7 @@ a Kubernetes cluster from scratch. * [OpenShift Online](https://www.openshift.com/features/) provides free hosted access for Kubernetes applications. -* [IBM Bluemix Container Service](https://console.ng.bluemix.net/docs/containers/container_index.html) offers managed Kubernetes clusters with isolation choice, operational tools, integrated security insight into images and containers, and integration with Watson, IoT, and data. +* [IBM Cloud Container Service](https://console.bluemix.net/docs/containers/container_index.html) offers managed Kubernetes clusters with isolation choice, operational tools, integrated security insight into images and containers, and integration with Watson, IoT, and data. * [Giant Swarm](https://giantswarm.io/product/) offers managed Kubernetes clusters in their own datacenter, on-premises, or on public clouds. @@ -70,7 +70,7 @@ few commands. These solutions are actively developed and have active community s * [Azure](/docs/getting-started-guides/azure/) * [Tectonic by CoreOS](https://coreos.com/tectonic) * [CenturyLink Cloud](/docs/getting-started-guides/clc/) -* [IBM Bluemix](https://github.com/patrocinio/kubernetes-softlayer) +* [IBM Cloud](https://github.com/patrocinio/kubernetes-softlayer) * [Stackpoint.io](/docs/getting-started-guides/stackpoint/) * [KUBE2GO.io](https://kube2go.io/) * [Madcore.Ai](https://madcore.ai/) diff --git a/docs/tasks/administer-cluster/access-cluster-api.md b/docs/tasks/administer-cluster/access-cluster-api.md index 7929387906..561ff96408 100644 --- a/docs/tasks/administer-cluster/access-cluster-api.md +++ b/docs/tasks/administer-cluster/access-cluster-api.md @@ -136,7 +136,7 @@ import ( // creates the clientset clientset, _:= kubernetes.NewForConfig(config) // access the API to list pods - pods, _:= clientset.Core().Pods("").List(v1.ListOptions{}) + pods, _:= clientset.CoreV1().Pods("").List(v1.ListOptions{}) fmt.Printf("There are %d pods in the cluster\n", len(pods.Items)) ... ``` diff --git a/docs/tasks/administer-cluster/developing-cloud-controller-manager.md b/docs/tasks/administer-cluster/developing-cloud-controller-manager.md index c84b56dad5..9a5d946da6 100644 --- a/docs/tasks/administer-cluster/developing-cloud-controller-manager.md +++ b/docs/tasks/administer-cluster/developing-cloud-controller-manager.md @@ -17,7 +17,7 @@ can develop their features independantly from the core Kubernetes release cycles Before going into how to build your own cloud controller manager, some background on how it works under the hood is helpful. The cloud controller manager is code from `kube-controller-manager` utilizing Go interfaces to allow implementations from any cloud to be plugged in. Most of the scaffolding and generic controller implementations will be in core, but it will always exec out to the cloud interfaces it is provided, so long as the [cloud provider interface](https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/cloud.go#L29-L50) is satisifed. -To dive a little deeper into implementation details, all cloud controller managers will import packages from Kubernetes core, the only difference being each project will register their own cloud providers by calling [cloudprovider.RegisterCloudProvier](https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/plugins.go#L42-L52) where a global variable of available cloud providers is updated. +To dive a little deeper into implementation details, all cloud controller managers will import packages from Kubernetes core, the only difference being each project will register their own cloud providers by calling [cloudprovider.RegisterCloudProvider](https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/plugins.go#L42-L52) where a global variable of available cloud providers is updated. ## Developing diff --git a/docs/tasks/administer-cluster/quota-api-object.md b/docs/tasks/administer-cluster/quota-api-object.md index fd3fdd2236..978cc02037 100644 --- a/docs/tasks/administer-cluster/quota-api-object.md +++ b/docs/tasks/administer-cluster/quota-api-object.md @@ -67,7 +67,7 @@ status: services.nodeports: "0" ``` -## Create a PersistentVolumeClaim: +## Create a PersistentVolumeClaim Here is the configuration file for a PersistentVolumeClaim object: @@ -92,7 +92,7 @@ NAME STATUS pvc-quota-demo Pending ``` -## Attempt to create a second PersistentVolumeClaim: +## Attempt to create a second PersistentVolumeClaim Here is the configuration file for a second PersistentVolumeClaim: diff --git a/docs/tasks/configure-pod-container/configmap.md b/docs/tasks/configure-pod-container/configmap.md index e77248b191..d31ea8f978 100644 --- a/docs/tasks/configure-pod-container/configmap.md +++ b/docs/tasks/configure-pod-container/configmap.md @@ -36,7 +36,9 @@ The data source corresponds to a key-value pair in the ConfigMap, where * key = the file name or the key you provided on the command line, and * value = the file contents or the literal value you provided on the command line. -You can use [`kubectl describe`](/docs/user-guide/kubectl/{{page.version}}/#describe) or [`kubectl get`](/docs/user-guide/kubectl/{{page.version}}/#get) to retrieve information about a ConfigMap. The former shows a summary of the ConfigMap, while the latter returns the full contents of the ConfigMap. +You can use [`kubectl describe`](/docs/user-guide/kubectl/{{page.version}}/#describe) or +[`kubectl get`](/docs/user-guide/kubectl/{{page.version}}/#get) to retrieve information +about a ConfigMap. ### Create ConfigMaps from directories diff --git a/docs/tasks/debug-application-cluster/debug-application-introspection.md b/docs/tasks/debug-application-cluster/debug-application-introspection.md index a149efba6f..917cc18d5a 100644 --- a/docs/tasks/debug-application-cluster/debug-application-introspection.md +++ b/docs/tasks/debug-application-cluster/debug-application-introspection.md @@ -16,33 +16,12 @@ your pods. But there are a number of ways to get even more information about you For this example we'll use a Deployment to create two pods, similar to the earlier example. -```yaml -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: nginx-deployment -spec: - replicas: 2 - template: - metadata: - labels: - app: nginx - spec: - containers: - - name: nginx - image: nginx - resources: - limits: - memory: "128Mi" - cpu: "500m" - ports: - - containerPort: 80 -``` +{% include code.html language="yaml" file="nginx-dep.yaml" ghlink="/docs/tasks/debug-application-cluster/nginx-dep.yaml" %} -Copy this to a file *./my-nginx-dep.yaml* +Create deployment by running following command: ```shell -$ kubectl create -f ./my-nginx-dep.yaml +$ kubectl create -f https://k8s.io/docs/tasks/debug-application-cluster/nginx-dep.yaml deployment "nginx-deployment" created ``` diff --git a/docs/concepts/abstractions/nginx-deployment.yaml b/docs/tasks/debug-application-cluster/nginx-dep.yaml similarity index 57% rename from docs/concepts/abstractions/nginx-deployment.yaml rename to docs/tasks/debug-application-cluster/nginx-dep.yaml index 2aabf5e7b1..9051645fbb 100644 --- a/docs/concepts/abstractions/nginx-deployment.yaml +++ b/docs/tasks/debug-application-cluster/nginx-dep.yaml @@ -1,9 +1,9 @@ -apiVersion: apps/v1beta1 +apiVersion: extensions/v1beta1 kind: Deployment metadata: name: nginx-deployment spec: - replicas: 3 + replicas: 2 template: metadata: labels: @@ -11,6 +11,10 @@ spec: spec: containers: - name: nginx - image: nginx:1.7.9 + image: nginx + resources: + limits: + memory: "128Mi" + cpu: "500m" ports: - containerPort: 80 diff --git a/docs/tasks/federation/set-up-cluster-federation-kubefed.md b/docs/tasks/federation/set-up-cluster-federation-kubefed.md index a615cdbf25..a73e06f6fc 100644 --- a/docs/tasks/federation/set-up-cluster-federation-kubefed.md +++ b/docs/tasks/federation/set-up-cluster-federation-kubefed.md @@ -371,44 +371,35 @@ For more information see ## Adding a cluster to a federation -Once you've deployed a federation control plane, you'll need to make -that control plane aware of the clusters it should manage. You can add -a cluster to your federation by using the [`kubefed join`](/docs/admin/kubefed_join/) -command. A new context will have been added to your kubeconfig named `fellowship` -(after the name of your federation). To join clusters into the federation, you will -need to change the context. +After you've deployed a federation control plane, you'll need to make that control plane aware of the clusters it should manage. -``` -kubectl config use-context fellowship -``` +To join clusters into the federation: -To use `kubefed join`, you'll need to provide the name of the cluster -you want to add to the federation, and the `--host-cluster-context` -for the federation control plane's host cluster. +1. Change the context: -> Note: The name that you provide to the `join` command is used as the -joining cluster's identity in federation. This name should adhere to -the rules described in the -[identifiers doc](/docs/concepts/overview/working-with-objects/names/). If the context -corresponding to your joining cluster conforms to these rules then you -can use the same name in the join command. Otherwise, you will have to -choose a different name for your cluster's identity. For more -information, please see the -[naming rules and customization](#naming-rules-and-customization) -section below. + kubectl config use-context fellowship -The following example command adds the cluster `gondor` to the -federation running on host cluster `rivendell`: +1. If you are using a managed cluster service, allow the service to access the cluster. To do this, create a `clusterrolebinding` for the account associated with your cluster service: -``` -kubefed join gondor --host-cluster-context=rivendell -``` + kubectl create clusterrolebinding -cluster-admin-binding --clusterrole=cluster-admin --user=@example.org --context= Note: The name that you provide to the `join` command is used as the joining cluster's identity in federation. If this name adheres to the rules described in the [identifiers doc](/docs/concepts/overview/working-with-objects/names/). If the context +corresponding to your joining cluster conforms to these rules then you can use the same name in the join command. Otherwise, you will have to choose a different name for your cluster's identity. -> Note: Kubernetes requires that you manually join clusters to a -federation because the federation control plane manages only those -clusters that it is responsible for managing. Adding a cluster tells -the federation control plane that it is responsible for managing that -cluster. ### Naming rules and customization diff --git a/docs/tasks/inject-data-application/distribute-credentials-secure.md b/docs/tasks/inject-data-application/distribute-credentials-secure.md index c85532fe86..b48f22ab97 100644 --- a/docs/tasks/inject-data-application/distribute-credentials-secure.md +++ b/docs/tasks/inject-data-application/distribute-credentials-secure.md @@ -37,7 +37,7 @@ username and password: 1. Create the Secret - kubectl create -f secret.yaml + kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret.yaml **Note:** If you want to skip the Base64 encoding step, you can create a Secret by using the `kubectl create secret` command: @@ -81,7 +81,7 @@ Here is a configuration file you can use to create a Pod: 1. Create the Pod: - kubectl create -f secret-pod.yaml + kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret-pod.yaml 1. Verify that your Pod is running: @@ -128,7 +128,7 @@ Here is a configuration file you can use to create a Pod: 1. Create the Pod: - kubectl create -f secret-envars-pod.yaml + kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret-envars-pod.yaml 1. Verify that your Pod is running: diff --git a/docs/tasks/inject-data-application/podpreset-allow-db-merged.yaml b/docs/tasks/inject-data-application/podpreset-allow-db-merged.yaml index 73d93312fa..0cf950c803 100644 --- a/docs/tasks/inject-data-application/podpreset-allow-db-merged.yaml +++ b/docs/tasks/inject-data-application/podpreset-allow-db-merged.yaml @@ -10,7 +10,7 @@ metadata: spec: containers: - name: website - image: ecorp/website + image: nginx volumeMounts: - mountPath: /cache name: cache-volume diff --git a/docs/tasks/inject-data-application/podpreset-allow-db.yaml b/docs/tasks/inject-data-application/podpreset-allow-db.yaml index 96f6dbfe20..97203fdb9c 100644 --- a/docs/tasks/inject-data-application/podpreset-allow-db.yaml +++ b/docs/tasks/inject-data-application/podpreset-allow-db.yaml @@ -2,7 +2,6 @@ apiVersion: settings.k8s.io/v1alpha1 kind: PodPreset metadata: name: allow-database - namespace: myns spec: selector: matchLabels: diff --git a/docs/tasks/inject-data-application/podpreset-conflict-pod.yaml b/docs/tasks/inject-data-application/podpreset-conflict-pod.yaml index 9061b9f5e8..cf201b2f06 100644 --- a/docs/tasks/inject-data-application/podpreset-conflict-pod.yaml +++ b/docs/tasks/inject-data-application/podpreset-conflict-pod.yaml @@ -8,7 +8,7 @@ metadata: spec: containers: - name: website - image: ecorp/website + image: nginx volumeMounts: - mountPath: /cache name: cache-volume diff --git a/docs/tasks/inject-data-application/podpreset-conflict-preset.yaml b/docs/tasks/inject-data-application/podpreset-conflict-preset.yaml index ab70b14d28..a2ad96c48a 100644 --- a/docs/tasks/inject-data-application/podpreset-conflict-preset.yaml +++ b/docs/tasks/inject-data-application/podpreset-conflict-preset.yaml @@ -2,7 +2,6 @@ apiVersion: settings.k8s.io/v1alpha1 kind: PodPreset metadata: name: allow-database - namespace: myns spec: selector: matchLabels: diff --git a/docs/tasks/inject-data-application/podpreset-merged.yaml b/docs/tasks/inject-data-application/podpreset-merged.yaml index 0a5dfce0b5..97c022c86c 100644 --- a/docs/tasks/inject-data-application/podpreset-merged.yaml +++ b/docs/tasks/inject-data-application/podpreset-merged.yaml @@ -10,7 +10,7 @@ metadata: spec: containers: - name: website - image: ecorp/website + image: nginx volumeMounts: - mountPath: /cache name: cache-volume diff --git a/docs/tasks/inject-data-application/podpreset-multi-merged.yaml b/docs/tasks/inject-data-application/podpreset-multi-merged.yaml index dd6a7197ef..7fcaae62e3 100644 --- a/docs/tasks/inject-data-application/podpreset-multi-merged.yaml +++ b/docs/tasks/inject-data-application/podpreset-multi-merged.yaml @@ -11,7 +11,7 @@ metadata: spec: containers: - name: website - image: ecorp/website + image: nginx volumeMounts: - mountPath: /cache name: cache-volume diff --git a/docs/tasks/inject-data-application/podpreset-pod.yaml b/docs/tasks/inject-data-application/podpreset-pod.yaml index 82c590a924..b6b4e60d6e 100644 --- a/docs/tasks/inject-data-application/podpreset-pod.yaml +++ b/docs/tasks/inject-data-application/podpreset-pod.yaml @@ -8,7 +8,7 @@ metadata: spec: containers: - name: website - image: ecorp/website + image: nginx ports: - containerPort: 80 diff --git a/docs/tasks/inject-data-application/podpreset-preset.yaml b/docs/tasks/inject-data-application/podpreset-preset.yaml index c5d34437f2..f300289c82 100644 --- a/docs/tasks/inject-data-application/podpreset-preset.yaml +++ b/docs/tasks/inject-data-application/podpreset-preset.yaml @@ -2,7 +2,6 @@ apiVersion: settings.k8s.io/v1alpha1 kind: PodPreset metadata: name: allow-database - namespace: myns spec: selector: matchLabels: diff --git a/docs/tasks/inject-data-application/podpreset-proxy.yaml b/docs/tasks/inject-data-application/podpreset-proxy.yaml index 20dab81f36..d854475ac2 100644 --- a/docs/tasks/inject-data-application/podpreset-proxy.yaml +++ b/docs/tasks/inject-data-application/podpreset-proxy.yaml @@ -2,7 +2,6 @@ apiVersion: settings.k8s.io/v1alpha1 kind: PodPreset metadata: name: proxy - namespace: myns spec: selector: matchLabels: diff --git a/docs/tasks/inject-data-application/podpreset.md b/docs/tasks/inject-data-application/podpreset.md index d2571ab844..4368608690 100644 --- a/docs/tasks/inject-data-application/podpreset.md +++ b/docs/tasks/inject-data-application/podpreset.md @@ -20,18 +20,50 @@ You can get an overview of PodPresets at This is a simple example to show how a Pod spec is modified by the Pod Preset. -**User submitted pod spec:** +{% include code.html language="yaml" file="podpreset-preset.yaml" ghlink="/docs/tasks/inject-data-application/podpreset-preset.yaml" %} + +Create the PodPreset: + +```shell +kubectl create -f https://k8s.io/docs/tasks/inject-data-application/podpreset-preset.yaml +``` + +Examine the created PodPreset: + +```shell +$ kubectl get podpreset +NAME AGE +allow-database 1m +``` + +The new PodPreset will act upon any pod that has label `role: frontend`. {% include code.html language="yaml" file="podpreset-pod.yaml" ghlink="/docs/tasks/inject-data-application/podpreset-pod.yaml" %} -**Example Pod Preset:** +Create a pod: -{% include code.html language="yaml" file="podpreset-preset.yaml" ghlink="/docs/tasks/inject-data-application/podpreset-preset.yaml" %} +```shell +$ kubectl create -f https://k8s.io/docs/tasks/inject-data-application/podpreset-pod.yaml +``` + +List the running Pods: + +```shell +$ kubectl get pods +NAME READY STATUS RESTARTS AGE +website 1/1 Running 0 4m +``` **Pod spec after admission controller:** {% include code.html language="yaml" file="podpreset-merged.yaml" ghlink="/docs/tasks/inject-data-application/podpreset-merged.yaml" %} +To see above output, run the following command: + +```shell +$ kubectl get pod website -o yaml +``` + ### Pod Spec with `ConfigMap` Example This is an example to show how a Pod spec is modified by the Pod Preset @@ -113,7 +145,7 @@ when there is a conflict. **If we run `kubectl describe...` we can see the event:** -``` +```shell $ kubectl describe ... .... Events: diff --git a/docs/tasks/service-catalog/install-service-catalog-using-helm.md b/docs/tasks/service-catalog/install-service-catalog-using-helm.md new file mode 100644 index 0000000000..9ce776cb28 --- /dev/null +++ b/docs/tasks/service-catalog/install-service-catalog-using-helm.md @@ -0,0 +1,100 @@ +--- +title: Install Service Catalog using Helm +approvers: +- chenopis +--- + +{% capture overview %} +{% glossary_definition term_id="service-catalog" length="long" %} + +Use [Helm](https://helm.sh/) to install Service Catalog on your Kubernetes cluster. Up to date information on this process can be found at the [kubernetes-incubator/service-catalog](https://github.com/kubernetes-incubator/service-catalog/blob/master/docs/install.md) repo. + +{% endcapture %} + + +{% capture prerequisites %} +* Understand the key concepts of [Service Catalog](/docs/concepts/service-catalog/). +* Service Catalog requires a Kubernetes cluster running version 1.7 or higher. +* You must have a Kubernetes cluster with cluster DNS enabled. + * If you are using a cloud-based Kubernetes cluster or {% glossary_tooltip text="Minikube" term_id="minikube" %}, you may already have cluster DNS enabled. + * If you are using `hack/local-up-cluster.sh`, ensure that the `KUBE_ENABLE_CLUSTER_DNS` environment variable is set, then run the install script. +* [Install and setup kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) v1.7 or higher. Make sure it is configured to connect to the Kubernetes cluster. +* Install [Helm](http://helm.sh/) v2.7.0 or newer. + * Follow the [Helm install instructions](https://github.com/kubernetes/helm/blob/master/docs/install.md). + * If you already have an appropriate version of Helm installed, execute `helm init` to install Tiller, the server-side component of Helm. + +{% endcapture %} + + +{% capture steps %} +## Add the service-catalog Helm repository + +Once Helm is installed, add the *service-catalog* Helm repository to your local machine by executing the following command: + +```shell +helm repo add svc-cat https://svc-catalog-charts.storage.googleapis.com +``` + +Check to make sure that it installed successfully by executing the following command: + +```shell +helm search service-catalog +``` + +If the installation was successful, the command should output the following: + +``` +NAME VERSION DESCRIPTION +svc-cat/catalog 0.0.1 service-catalog API server and controller-manag... +``` + +## Enable RBAC + +Your Kubernetes cluster must have RBAC enabled, which requires your Tiller Pod(s) to have `cluster-admin` access. + +If you are using {% glossary_tooltip text="Minikube" term_id="minikube" %}, run the `minikube start` command with the following flag: + +```shell +minikube start --extra-config=apiserver.Authorization.Mode=RBAC +``` + +If you are using `hack/local-up-cluster.sh`, set the `AUTHORIZATION_MODE` environment variable with the following values: + +``` +AUTHORIZATION_MODE=Node,RBAC hack/local-up-cluster.sh -O +``` + +By default, `helm init` installs the Tiller Pod into the `kube-system` namespace, with Tiller configured to use the `default` service account. + +**NOTE:** If you used the `--tiller-namespace` or `--service-account` flags when running `helm init`, the `--serviceaccount` flag in the following command needs to be adjusted to reference the appropriate namespace and ServiceAccount name. +{: .note} + +Configure Tiller to have `cluster-admin` access: + +```shell +kubectl create clusterrolebinding tiller-cluster-admin \ + --clusterrole=cluster-admin \ + --serviceaccount=kube-system:default +``` + + +## Install Service Catalog in your Kubernetes cluster + +Install Service Catalog from the root of the Helm repository using the following command: + +```shell +helm install svc-cat/catalog \ + --name catalog --namespace catalog +``` + +{% endcapture %} + + +{% capture whatsnext %} +* View [sample service brokers](https://github.com/openservicebrokerapi/servicebroker/blob/master/gettingStarted.md#sample-service-brokers). +* Explore the [kubernetes-incubator/service-catalog](https://github.com/kubernetes-incubator/service-catalog) project. + +{% endcapture %} + + +{% include templates/task.md %} \ No newline at end of file diff --git a/docs/tasks/service-catalog/install-service-catalog-using-sc.md b/docs/tasks/service-catalog/install-service-catalog-using-sc.md new file mode 100644 index 0000000000..e235e0e0ed --- /dev/null +++ b/docs/tasks/service-catalog/install-service-catalog-using-sc.md @@ -0,0 +1,77 @@ +--- +title: Install Service Catalog using SC +approvers: +- chenopis +--- + +{% capture overview %} +{% glossary_definition term_id="service-catalog" length="long" %} + +Use the [Service Catalog Installer](https://github.com/GoogleCloudPlatform/k8s-service-catalog#installation) tool to easily install or uninstall Service Catalog on your Kubernetes cluster. This CLI tool is installed as `sc` in your local environment. + +{% endcapture %} + + +{% capture prerequisites %} +* Understand the key concepts of [Service Catalog](/docs/concepts/service-catalog/). +* Install [Go 1.6+](https://golang.org/dl/) and set the `GOPATH`. +* Install the [cfssl](https://github.com/cloudflare/cfssl) tool needed for generating SSL artifacts. +* Service Catalog requires Kubernetes version 1.7+. +* [Install and setup kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) so that it is configured to connect to a Kubernetes v1.7+ cluster. +* The kubectl user must be bound to the *cluster-admin* role for it to install Service Catalog. To ensure that this is true, run the following command: + + kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user= + +{% endcapture %} + + +{% capture steps %} +## Install `sc` in your local environment + +Install the `sc` CLI tool using the `go get` command: + +```Go +go get github.com/GoogleCloudPlatform/k8s-service-catalog/installer/cmd/sc +``` + +After running the above command, `sc` should be installed in your `GOPATH/bin` directory. + +## Install Service Catalog in your Kubernetes cluster + +First, verify that all dependencies have been installed. Run: + +```shell +sc check +``` + +If the check is successful, it should return: + +``` +Dependency check passed. You are good to go. +``` + +Next, run the install command and specify the `storageclass` that you want to use for the backup: + +```shell +sc install --etcd-backup-storageclass "standard" +``` + +## Uninstall Service Catalog + +If you would like to uninstall Service Catalog from your Kubernetes cluster using the `sc` tool, run: + +```shell +sc uninstall +``` + +{% endcapture %} + + +{% capture whatsnext %} +* View [sample service brokers](https://github.com/openservicebrokerapi/servicebroker/blob/master/gettingStarted.md#sample-service-brokers). +* Explore the [kubernetes-incubator/service-catalog](https://github.com/kubernetes-incubator/service-catalog) project. + +{% endcapture %} + + +{% include templates/task.md %} \ No newline at end of file diff --git a/docs/tutorials/stateful-application/zookeeper.md b/docs/tutorials/stateful-application/zookeeper.md index 5c07373bf3..7b7f1d0b4d 100644 --- a/docs/tutorials/stateful-application/zookeeper.md +++ b/docs/tutorials/stateful-application/zookeeper.md @@ -100,7 +100,7 @@ Open a command terminal, and use manifest. ```shell -kubectl apply -f https://k8s.io/docs/tutorials/stateful-application/zookeeper.yaml +kubectl apply -f https://raw.githubusercontent.com/kubernetes/website/master/docs/tutorials/stateful-application/zookeeper.yaml ``` This creates the `zk-hs` Headless Service, the `zk-cs` Service, diff --git a/docs/user-guide/kubectl-overview.md b/docs/user-guide/kubectl-overview.md index 923a99558e..5ae7485c5b 100644 --- a/docs/user-guide/kubectl-overview.md +++ b/docs/user-guide/kubectl-overview.md @@ -264,6 +264,17 @@ $ kubectl describe pods $ kubectl describe pods --include-uninitialized=false ``` +**Note:** The `kubectl get` command is usually used for retrieving one or more +resources of the same resource type. It features a rich set of flags that allows +you to customize the output format using the `-o` or `--output` flag, for example. +You can specify the `-w` or `--watch` flag to start watching updates to a particular +object. The `kubectl describe` command is more focused on describing the many +related aspects of a specified resource. It may invoke several API calls to the +API server to build a view for the user. For example, the `kubectl describe node` +command retrieves not only the information about the node, but also a summary of +the pods running on it, the events generated for the node etc. +{: .note} + `kubectl delete` - Delete resources either from a file, stdin, or specifying label selectors, names, resource selectors, or resources. ```shell diff --git a/docs/user-guide/walkthrough/index.md b/docs/user-guide/walkthrough/index.md index c456638dac..20fd482271 100644 --- a/docs/user-guide/walkthrough/index.md +++ b/docs/user-guide/walkthrough/index.md @@ -97,8 +97,8 @@ volumes: ```yaml volumeMounts: - # name must match the volume name below - - name: redis-persistent-storage +    # name must match the volume name defined in volumes +    - name: redis-persistent-storage # mount path within the container mountPath: /data/redis ``` diff --git a/images/KubeCon_NA_Community.jpg b/images/KubeCon_NA_Community.jpg new file mode 100644 index 0000000000..ab046414be Binary files /dev/null and b/images/KubeCon_NA_Community.jpg differ diff --git a/images/docs/service-catalog-architecture.svg b/images/docs/service-catalog-architecture.svg new file mode 100644 index 0000000000..57c7558d5a --- /dev/null +++ b/images/docs/service-catalog-architecture.svg @@ -0,0 +1,138 @@ + + + + Produced by OmniGraffle 7.5 + 2017-11-17 22:47:47 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + architecture + + Layer 1 + + + + Service Broker + A + + + + API Server + + + + Service Catalog + servicecatalog.k8s.io: + ClusterServiceBroker + ClusterServiceClass + ClusterServicePlan + ServiceInstance + ServiceBinding + + + + Application + + + + + + + + Service Broker Z + + + + Managed Service 2 + + + + Managed Service N + + + + Managed Service 1 + + + + Open Service Broker + API + + + List Services + Provision Instance + Bind Instance + + + + + + + + + + Bind Instance + + + + Secret: + Connection Credentials + Service Details + + + Kubernetes + + + + diff --git a/images/docs/service-catalog-bind.svg b/images/docs/service-catalog-bind.svg new file mode 100644 index 0000000000..0a57f944aa --- /dev/null +++ b/images/docs/service-catalog-bind.svg @@ -0,0 +1,115 @@ + + + + Produced by OmniGraffle 7.5 + 2017-11-17 22:45:14 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + V2b + + Layer 1 + + + + + + + + + + + + Bind Instance + + + + + Connection + Information + + + + ServiceBinding + Resource + + + + ServiceBinding + Resource + + + + + Service Catalog + API Server + + + + Service Broker + + + + Cluster Operator + + + + + + 1. + + + + + + + 3. + + + + + + Service + + + + + + 2. + + + + + diff --git a/images/docs/service-catalog-list.svg b/images/docs/service-catalog-list.svg new file mode 100644 index 0000000000..ba1802d8fe --- /dev/null +++ b/images/docs/service-catalog-list.svg @@ -0,0 +1,136 @@ + + + + Produced by OmniGraffle 7.5 + 2017-11-17 22:45:14 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + V2b + + Layer 1 + + + + + + + + + + ClusterServiceClass + Resource + + + + + + + Service Catalog + API Server + + + + Service Broker + + + + List Services + + + + ClusterServiceBroker + Resource + + + + + + Cluster Operator + + + + + + 2. + + + + + + + 3. + + + + + + + 1. + + + + + + List of + Services, + Plans + + + + + ClusterServicePlan + Resource + + + + Services, Plans + + + + get clusterserviceplans + + + + get clusterserviceclasses + + + + diff --git a/images/docs/service-catalog-map.svg b/images/docs/service-catalog-map.svg new file mode 100644 index 0000000000..091cd4efef --- /dev/null +++ b/images/docs/service-catalog-map.svg @@ -0,0 +1,100 @@ + + + + Produced by OmniGraffle 7.5 + 2017-11-07 08:04:59 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + map creds + + Layer 1 + + + + Service Broker + + + + API Server + + + + Service Catalog + servicecatalog.k8s.io: + ServiceBinding + + + + Application + + + + Managed Service + Instance + + + + Bind Instance + + + Service Account + + + + + + + Secret: + Connection Credentials + Service + Account Details + + + + Kubernetes + + + + diff --git a/images/docs/service-catalog-provision.svg b/images/docs/service-catalog-provision.svg new file mode 100644 index 0000000000..748ba3a336 --- /dev/null +++ b/images/docs/service-catalog-provision.svg @@ -0,0 +1,125 @@ + + + + Produced by OmniGraffle 7.5 + 2017-11-17 23:02:50 +0000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + V2b + + Layer 1 + + + + + + + + + + + + Provision Instance + + + + + ServiceInstance + Resource + + + + ServiceInstance + Resource + + + + + + get serviceinstance + + + + + READY + + + + Service Catalog + API Server + + + + Service Broker + + + + Cluster Operator + + + + + + 3. + + + + + + + 1. + + + + + + + 2. + + + + + + Service + + + + diff --git a/images/square-logos/componentsoft.png b/images/square-logos/componentsoft.png new file mode 100644 index 0000000000..cdd7b4d4dd Binary files /dev/null and b/images/square-logos/componentsoft.png differ diff --git a/images/square-logos/dataspine.png b/images/square-logos/dataspine.png new file mode 100644 index 0000000000..95ab24a311 Binary files /dev/null and b/images/square-logos/dataspine.png differ diff --git a/images/square-logos/isotoma.png b/images/square-logos/isotoma.png new file mode 100644 index 0000000000..b1ac23d905 Binary files /dev/null and b/images/square-logos/isotoma.png differ diff --git a/images/square-logos/objectcomputing.png b/images/square-logos/objectcomputing.png new file mode 100644 index 0000000000..622e6b98a6 Binary files /dev/null and b/images/square-logos/objectcomputing.png differ diff --git a/images/square-logos/redzara.png b/images/square-logos/redzara.png new file mode 100644 index 0000000000..4aa3b9bbbe Binary files /dev/null and b/images/square-logos/redzara.png differ diff --git a/images/square-logos/servian.png b/images/square-logos/servian.png new file mode 100644 index 0000000000..aeaaa58a21 Binary files /dev/null and b/images/square-logos/servian.png differ diff --git a/images/square-logos/vexxhost.png b/images/square-logos/vexxhost.png new file mode 100644 index 0000000000..c7060c021c Binary files /dev/null and b/images/square-logos/vexxhost.png differ diff --git a/index.html b/index.html index a3f73aaac3..cf22d1e40c 100644 --- a/index.html +++ b/index.html @@ -64,7 +64,7 @@ cid: home

- Attend KubeCon in Austin, TX on December 6-8, 2017 + Attend KubeCon in Austin, TX on December 6-8, 2017
diff --git a/partners/index.html b/partners/index.html index 271dcd0b25..14f39332d0 100644 --- a/partners/index.html +++ b/partners/index.html @@ -22,8 +22,8 @@ cid: partners

Kubernetes Certified Service Providers (KCSP)

-

The KCSP program is a vetted tier of service providers who have deep experience helping enterprises successfully adopt Kubernetes. KCSP partners offer Kubernetes support, consulting, professional services and training for organizations embarking on their Kubernetes journey.

-

Interested in becoming a KCSP? Learn more.

+

The KCSP program is a vetted tier of service providers who have deep experience helping enterprises successfully adopt Kubernetes. KCSP partners offer Kubernetes support, consulting, professional services and training for organizations embarking on their Kubernetes journey. Learn more about the program here.

+

Interested in becoming a KCSP? Please fill out this form.

@@ -35,13 +35,13 @@ cid: partners

Technology Partners

Technology partners offer integrations and plugins that add features to Kubernetes applications.

-

Interested in becoming a Technology Partner? Please fill out this form.

+

Interested in becoming a Technology Partner? Please fill out this form.

Service Partners

Service Partners offer consulting or management services to help companies implement and use Kubernetes in commercial applications.

-

Interested in becoming a Service Provider? Please fill out this form

+

Interested in becoming a Service Provider? Please fill out this form.

@@ -53,4 +53,4 @@ cid: partners \ No newline at end of file + diff --git a/test/examples_test.go b/test/examples_test.go index be88ff908f..87b7e9a54a 100644 --- a/test/examples_test.go +++ b/test/examples_test.go @@ -32,15 +32,17 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/util/yaml" - api "k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/apis/core/validation" "k8s.io/kubernetes/pkg/apis/apps" apps_validation "k8s.io/kubernetes/pkg/apis/apps/validation" + "k8s.io/kubernetes/pkg/apis/autoscaling" + autoscaling_validation "k8s.io/kubernetes/pkg/apis/autoscaling/validation" "k8s.io/kubernetes/pkg/apis/batch" batch_validation "k8s.io/kubernetes/pkg/apis/batch/validation" + api "k8s.io/kubernetes/pkg/apis/core" + "k8s.io/kubernetes/pkg/apis/core/validation" "k8s.io/kubernetes/pkg/apis/extensions" - expvalidation "k8s.io/kubernetes/pkg/apis/extensions/validation" + ext_validation "k8s.io/kubernetes/pkg/apis/extensions/validation" "k8s.io/kubernetes/pkg/apis/policy" policyvalidation "k8s.io/kubernetes/pkg/apis/policy/validation" "k8s.io/kubernetes/pkg/apis/storage" @@ -113,11 +115,21 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) { t.Namespace = api.NamespaceDefault } errors = validation.ValidateResourceQuota(t) + case *autoscaling.HorizontalPodAutoscaler: + if t.Namespace == "" { + t.Namespace = api.NamespaceDefault + } + errors = autoscaling_validation.ValidateHorizontalPodAutoscaler(t) case *extensions.Deployment: if t.Namespace == "" { t.Namespace = api.NamespaceDefault } - errors = expvalidation.ValidateDeployment(t) + errors = ext_validation.ValidateDeployment(t) + case *extensions.ReplicaSet: + if t.Namespace == "" { + t.Namespace = api.NamespaceDefault + } + errors = ext_validation.ValidateReplicaSet(t) case *batch.Job: if t.Namespace == "" { t.Namespace = api.NamespaceDefault @@ -130,14 +142,14 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) { if t.Namespace == "" { t.Namespace = api.NamespaceDefault } - errors = expvalidation.ValidateIngress(t) + errors = ext_validation.ValidateIngress(t) case *extensions.DaemonSet: if t.Namespace == "" { t.Namespace = api.NamespaceDefault } - errors = expvalidation.ValidateDaemonSet(t) + errors = ext_validation.ValidateDaemonSet(t) case *extensions.PodSecurityPolicy: - errors = expvalidation.ValidatePodSecurityPolicy(t) + errors = ext_validation.ValidatePodSecurityPolicy(t) case *batch.CronJob: if t.Namespace == "" { t.Namespace = api.NamespaceDefault @@ -218,45 +230,76 @@ func walkConfigFiles(inDir string, fn func(name, path string, data [][]byte)) er } func TestExampleObjectSchemas(t *testing.T) { + // Please help maintain the alphabeta order in the map cases := map[string]map[string][]runtime.Object{ - "../docs/user-guide/walkthrough": { - "deployment": {&extensions.Deployment{}}, - "deployment-update": {&extensions.Deployment{}}, - "pod-nginx": {&api.Pod{}}, - "pod-nginx-with-label": {&api.Pod{}}, - "pod-redis": {&api.Pod{}}, - "pod-with-http-healthcheck": {&api.Pod{}}, - "pod-with-tcp-socket-healthcheck": {&api.Pod{}}, - "podtemplate": {&api.PodTemplate{}}, - "service": {&api.Service{}}, + "../docs/admin/high-availability": { + "etcd": {&api.Pod{}}, + "kube-apiserver": {&api.Pod{}}, + "kube-controller-manager": {&api.Pod{}}, + "kube-scheduler": {&api.Pod{}}, + "podmaster": {&api.Pod{}}, }, - "../docs/user-guide/update-demo": { - "kitten-rc": {&api.ReplicationController{}}, - "nautilus-rc": {&api.ReplicationController{}}, + "../docs/admin/limitrange": { + "invalid-pod": {&api.Pod{}}, + "limits": {&api.LimitRange{}}, + "namespace": {&api.Namespace{}}, + "valid-pod": {&api.Pod{}}, + }, + "../docs/admin/multiple-schedulers": { + "my-scheduler": {&extensions.Deployment{}}, + "pod1": {&api.Pod{}}, + "pod2": {&api.Pod{}}, + "pod3": {&api.Pod{}}, + }, + "../docs/admin/namespaces": { + "namespace-dev": {&api.Namespace{}}, + "namespace-prod": {&api.Namespace{}}, + }, + "../docs/admin/resourcequota": { + "best-effort": {&api.ResourceQuota{}}, + "compute-resources": {&api.ResourceQuota{}}, + "limits": {&api.LimitRange{}}, + "namespace": {&api.Namespace{}}, + "not-best-effort": {&api.ResourceQuota{}}, + "object-counts": {&api.ResourceQuota{}}, + }, + "../docs/concepts/cluster-administration": { + "counter-pod": {&api.Pod{}}, + "fluentd-sidecar-config": {&api.ConfigMap{}}, + "nginx-app": {&api.Service{}, &extensions.Deployment{}}, + "two-files-counter-pod": {&api.Pod{}}, + "two-files-counter-pod-agent-sidecar": {&api.Pod{}}, + "two-files-counter-pod-streaming-sidecar": {&api.Pod{}}, + }, + "../docs/concepts/configuration": { + "commands": {&api.Pod{}}, + "pod": {&api.Pod{}}, + "pod-with-node-affinity": {&api.Pod{}}, + "pod-with-pod-affinity": {&api.Pod{}}, + }, + "../docs/concepts/overview/working-with-objects": { + "nginx-deployment": {&extensions.Deployment{}}, }, "../docs/concepts/policy": { "psp": {&extensions.PodSecurityPolicy{}}, }, - "../docs/user-guide/persistent-volumes/volumes": { - "local-01": {&api.PersistentVolume{}}, - "local-02": {&api.PersistentVolume{}}, - "gce": {&api.PersistentVolume{}}, - "nfs": {&api.PersistentVolume{}}, + "../docs/concepts/services-networking": { + "curlpod": {&extensions.Deployment{}}, + "hostaliases-pod": {&api.Pod{}}, + "ingress": {&extensions.Ingress{}}, + "nginx-secure-app": {&api.Service{}, &extensions.Deployment{}}, + "nginx-svc": {&api.Service{}}, + "run-my-nginx": {&extensions.Deployment{}}, }, - "../docs/user-guide/persistent-volumes/claims": { - "claim-01": {&api.PersistentVolumeClaim{}}, - "claim-02": {&api.PersistentVolumeClaim{}}, - "claim-03": {&api.PersistentVolumeClaim{}}, - }, - "../docs/user-guide/persistent-volumes/simpletest": { - "namespace": {&api.Namespace{}}, - "pod": {&api.Pod{}}, - "service": {&api.Service{}}, - }, - "../docs/user-guide/liveness": { - "exec-liveness": {&api.Pod{}}, - "http-liveness": {&api.Pod{}}, - "http-liveness-named-port": {&api.Pod{}}, + "../docs/concepts/workloads/controllers": { + "cronjob": {&batch.CronJob{}}, + "daemonset": {&extensions.DaemonSet{}}, + "frontend": {&extensions.ReplicaSet{}}, + "hpa-rs": {&autoscaling.HorizontalPodAutoscaler{}}, + "job": {&batch.Job{}}, + "my-repset": {&extensions.ReplicaSet{}}, + "nginx-deployment": {&extensions.Deployment{}}, + "replication": {&api.ReplicationController{}}, }, "../docs/tasks/job/coarse-parallel-processing-work-queue": { "job": {&batch.Job{}}, @@ -266,6 +309,18 @@ func TestExampleObjectSchemas(t *testing.T) { "redis-pod": {&api.Pod{}}, "redis-service": {&api.Service{}}, }, + "../docs/tutorials/stateful-application": { + "gce-volume": {&api.PersistentVolume{}}, + "mysql-deployment": {&api.Service{}, &api.PersistentVolumeClaim{}, &extensions.Deployment{}}, + "mysql-services": {&api.Service{}, &api.Service{}}, + "mysql-configmap": {&api.ConfigMap{}}, + "mysql-statefulset": {&apps.StatefulSet{}}, + "cassandra-service": {&api.Service{}}, + "cassandra-statefulset": {&apps.StatefulSet{}, &storage.StorageClass{}}, + "web": {&api.Service{}, &apps.StatefulSet{}}, + "webp": {&api.Service{}, &apps.StatefulSet{}}, + "zookeeper": {&api.Service{}, &api.Service{}, &policy.PodDisruptionBudget{}, &apps.StatefulSet{}}, + }, "../docs/user-guide": { "bad-nginx-deployment": {&extensions.Deployment{}}, "counter-pod": {&api.Pod{}}, @@ -290,9 +345,6 @@ func TestExampleObjectSchemas(t *testing.T) { "run-my-nginx": {&extensions.Deployment{}}, "cronjob": {&batch.CronJob{}}, }, - "../docs/admin": { - "daemon": {&extensions.DaemonSet{}}, - }, "../docs/user-guide/downward-api": { "dapi-pod": {&api.Pod{}}, "dapi-container-resources": {&api.Pod{}}, @@ -301,45 +353,51 @@ func TestExampleObjectSchemas(t *testing.T) { "dapi-volume": {&api.Pod{}}, "dapi-volume-resources": {&api.Pod{}}, }, - "../docs/admin/namespaces": { - "namespace-dev": {&api.Namespace{}}, - "namespace-prod": {&api.Namespace{}}, - }, - "../docs/admin/limitrange": { - "invalid-pod": {&api.Pod{}}, - "limits": {&api.LimitRange{}}, - "namespace": {&api.Namespace{}}, - "valid-pod": {&api.Pod{}}, + "../docs/user-guide/liveness": { + "exec-liveness": {&api.Pod{}}, + "http-liveness": {&api.Pod{}}, + "http-liveness-named-port": {&api.Pod{}}, }, "../docs/user-guide/node-selection": { "pod": {&api.Pod{}}, "pod-with-node-affinity": {&api.Pod{}}, "pod-with-pod-affinity": {&api.Pod{}}, }, - "../docs/admin/resourcequota": { - "best-effort": {&api.ResourceQuota{}}, - "compute-resources": {&api.ResourceQuota{}}, - "limits": {&api.LimitRange{}}, - "namespace": {&api.Namespace{}}, - "not-best-effort": {&api.ResourceQuota{}}, - "object-counts": {&api.ResourceQuota{}}, + "../docs/user-guide/persistent-volumes/volumes": { + "local-01": {&api.PersistentVolume{}}, + "local-02": {&api.PersistentVolume{}}, + "gce": {&api.PersistentVolume{}}, + "nfs": {&api.PersistentVolume{}}, + }, + "../docs/user-guide/persistent-volumes/claims": { + "claim-01": {&api.PersistentVolumeClaim{}}, + "claim-02": {&api.PersistentVolumeClaim{}}, + "claim-03": {&api.PersistentVolumeClaim{}}, + }, + "../docs/user-guide/persistent-volumes/simpletest": { + "namespace": {&api.Namespace{}}, + "pod": {&api.Pod{}}, + "service": {&api.Service{}}, }, "../docs/user-guide/secrets": { "secret-pod": {&api.Pod{}}, "secret": {&api.Secret{}}, "secret-env-pod": {&api.Pod{}}, }, - "../docs/tutorials/stateful-application": { - "gce-volume": {&api.PersistentVolume{}}, - "mysql-deployment": {&api.Service{}, &api.PersistentVolumeClaim{}, &extensions.Deployment{}}, - "mysql-services": {&api.Service{}, &api.Service{}}, - "mysql-configmap": {&api.ConfigMap{}}, - "mysql-statefulset": {&apps.StatefulSet{}}, - "cassandra-service": {&api.Service{}}, - "cassandra-statefulset": {&apps.StatefulSet{}, &storage.StorageClass{}}, - "web": {&api.Service{}, &apps.StatefulSet{}}, - "webp": {&api.Service{}, &apps.StatefulSet{}}, - "zookeeper": {&api.Service{}, &api.Service{}, &policy.PodDisruptionBudget{}, &apps.StatefulSet{}}, + "../docs/user-guide/update-demo": { + "kitten-rc": {&api.ReplicationController{}}, + "nautilus-rc": {&api.ReplicationController{}}, + }, + "../docs/user-guide/walkthrough": { + "deployment": {&extensions.Deployment{}}, + "deployment-update": {&extensions.Deployment{}}, + "pod-nginx": {&api.Pod{}}, + "pod-nginx-with-label": {&api.Pod{}}, + "pod-redis": {&api.Pod{}}, + "pod-with-http-healthcheck": {&api.Pod{}}, + "pod-with-tcp-socket-healthcheck": {&api.Pod{}}, + "podtemplate": {&api.PodTemplate{}}, + "service": {&api.Service{}}, }, }