From deae72a03e7dca6e4a969055eff2d7b1778c8b49 Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Fri, 23 Sep 2016 14:57:08 +0200 Subject: [PATCH 01/21] Add generators section in kubectl conventions --- docs/user-guide/kubectl-conventions.md | 46 +++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/docs/user-guide/kubectl-conventions.md b/docs/user-guide/kubectl-conventions.md index f4398362da..a22973f16f 100644 --- a/docs/user-guide/kubectl-conventions.md +++ b/docs/user-guide/kubectl-conventions.md @@ -8,11 +8,11 @@ assignees: * TOC {:toc} -## Using `kubectl` in Reusable Scripts +## Using `kubectl` in Reusable Scripts If you need stable output in a script, you should: -* Request one of the machine-oriented output forms, such as `-o name`, `-o json`, `-o yaml`, `-o go-template`, or `-o jsonpath` +* Request one of the machine-oriented output forms, such as `-o name`, `-o json`, `-o yaml`, `-o go-template`, or `-o jsonpath` * Specify `--output-version`, since those output forms (other than `-o name`) output the resource using a particular API version * Specify `--generator` to pin to a specific behavior forever, if using generator-based commands (such as `kubectl run` or `kubectl expose`) * Don't rely on context, preferences, or other implicit state @@ -27,8 +27,46 @@ In order for `kubectl run` to satisfy infrastructure as code: * If the image is lightly parameterized, capture the parameters in a checked-in script, or at least use `--record`, to annotate the created objects with the command line. * If the image is heavily parameterized, definitely check in the script. * If features are needed that are not expressible via `kubectl run` flags, switch to configuration files checked into source control. -* Pin to a specific generator version, such as `kubectl run --generator=deployment/v1beta1` +* Pin to a specific [generator](#generators) version, such as `kubectl run --generator=deployment/v1beta1` + +#### Generators + +`kubectl run` allows you to generate the following resources (using `--generator` flag): + +* Pod - use `run-pod/v1`. +* Replication controller - use `run/v1`. +* Deployment - use `deployment/v1beta1`. +* Job (using `extension/v1beta1` endpoint) - use `job/v1beta1`. +* Job - use `job/v1`. +* ScheduledJob - use `scheduledjob/v2alpha1`. + +Additionally, if you didn't specify a generator flag, other flags will suggest using +a specific generator. Below table shows which flags force using specific generators, +depending on your cluster version: + +| Generated Resource | Cluster v1.4 | Cluster v1.3 | Cluster v1.2 | Cluster v1.1 and eariler | +|:----------------------:|-----------------------|-----------------------|--------------------------------------------|--------------------------------------------| +| Pod | `--restart=Never` | `--restart=Never` | `--generator=run-pod/v1` | `--restart=OnFailure` OR `--restart=Never` | +| Replication Controller | `--generator=run/v1` | `--generator=run/v1` | `--generator=run/v1` | `--restart=Always` | +| Deployment | `--restart=Always` | `--restart=Always` | `--restart=Always` | N/A | +| Job | `--restart=OnFailure` | `--restart=OnFailure` | `--restart=OnFailure` OR `--restart=Never` | N/A | +| Scheduled Job | `--schedule=` | N/A | N/A | N/A | + +Note that these flags will use a default generator only when you have not specified +any flag. This also means that combining `--generator` with other flags won't +change the generator you specified. For example, in a 1.4 cluster, if you specify +`--restart=Always`, a Deployment will be created; if you specify `--restart=Always` +and `--generator=run/v1`, a Replication Controller will be created instead. +This becomes handy if you want to pin to a specific behavior with the generator, +even when the defaulted generator is changed in the future. + +Finally, the order in which flags set the generator is: schedule flag has the highest +priority, then restart policy and finally the generator itself. + +If in doubt about the final resource being created, you can always use `--dry-run` +flag, which will provide the object to be submitted to the cluster. + ### `kubectl apply` -* To use `kubectl apply` to update resources, always create resources initially with `kubectl apply` or with `--save-config`. See [managing resources with kubectl apply](/docs/user-guide/managing-deployments/#kubectl-apply) for the reason behind it. +* To use `kubectl apply` to update resources, always create resources initially with `kubectl apply` or with `--save-config`. See [managing resources with kubectl apply](/docs/user-guide/managing-deployments/#kubectl-apply) for the reason behind it. From 616f99b7165602a671d101fcdfc623ca9cdba275 Mon Sep 17 00:00:00 2001 From: Devin Donnelly Date: Thu, 6 Oct 2016 16:46:59 -0700 Subject: [PATCH 02/21] Modifies the overview for the Kubernetes Basics tutorial to make it more useful. Adds a link to the Overview from the left-hand TOC. Links to the Kubernetes Basics Tutorial from the Tutorials landing page. --- _data/tutorials.yml | 2 ++ docs/tutorials/index.md | 4 ++++ docs/tutorials/kubernetes-basics/index.html | 18 +++++++++++++----- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/_data/tutorials.yml b/_data/tutorials.yml index 465b0575d8..e312523bcd 100644 --- a/_data/tutorials.yml +++ b/_data/tutorials.yml @@ -4,6 +4,8 @@ toc: path: /docs/tutorials/ - title: Kubernetes Basics section: + - title: Overview + path: /docs/tutorials/kubernetes-basics/ - title: 1. Create a Cluster section: - title: Using Minikube to Create a Cluster diff --git a/docs/tutorials/index.md b/docs/tutorials/index.md index 23400521e7..03ae95fe36 100644 --- a/docs/tutorials/index.md +++ b/docs/tutorials/index.md @@ -3,6 +3,10 @@ The Tutorials section of the Kubernetes documentation is a work in progress. +#### Kubernetes Basics + +* [Kubernetes Basics](/docs/tutorials/kubernetes-basics/) is an in-depth interactive tutorial that helps you understand the Kubernetes system and try out some basic Kubernetes features. + #### Stateless Applications * [Running a Stateless Application Using a Deployment](/docs/tutorials/stateless-application/run-stateless-application-deployment/) diff --git a/docs/tutorials/kubernetes-basics/index.html b/docs/tutorials/kubernetes-basics/index.html index 0f6a435626..971a3fba19 100644 --- a/docs/tutorials/kubernetes-basics/index.html +++ b/docs/tutorials/kubernetes-basics/index.html @@ -15,8 +15,16 @@
-

Getting Started with Kubernetes

-

By the end of this tutorial you will understand what Kubernetes does. You will also learn how to deploy, scale, update and debug containerized applications on a Kubernetes cluster using an interactive online terminal.

+

Kubernetes Basics

+

This tutorial provides a walkthrough of the basics of the Kubernetes cluster orchestration system. Each module contains some background information on major Kubernetes features and concepts, and includes an interactive online tutorial. These interactive tutorials let you manage a simple cluster and its containerized applications for yourself.

+

Using the interactive tutorials, you can learn to:

+
    +
  • Deploy a containerized application on a cluster
  • +
  • Scale the deployment
  • +
  • Update the containerized application with a new software version
  • +
  • Debug the containerized application
  • +
+

The tutorials use Katacoda to run a virtual terminal in your web browser that runs Minikube, a small-scale local deployment of Kubernetes that can run anywhere. There's no need to install any software or configure anything; each interactive tutorial runs directly out of your web browser itself.

@@ -24,13 +32,13 @@
-

Why Kubernetes?

-

Today users expect applications to be available 24/7, while developers expect to deploy new versions of those applications several times a day. The way we build software is moving in this direction, enabling applications to be released and updated in an easy and fast way without downtime. We also need to be able to scale application in line with the user demand and we expect them to make intelligent use of the available resources. Kubernetes is a platform designed to meet those requirements, using the experience accumulated by Google in this area, combined with best-of-breed ideas from the community.

+

What can Kubernetes do for you?

+

With modern web services, users expect applications to be available 24/7, and developers expect to deploy new versions of those applications several times a day. Containzerization helps package software to serve these goals, enabling applications to be released and updated in an easy and fast way without downtime. Kubernetes helps you make sure those containerized applications run where and when you want, and helps them find the resources and tools they need to work. Kubernetes is a production-ready, open source platform designed with the Google's accumulated experience in container orchestration, combined with best-of-breed ideas from the community.

-

Getting Started Modules

+

Kubernetes Basics Modules

From 65b71767e19cacd2c5e2e0fa173fb21afd4c1ccb Mon Sep 17 00:00:00 2001 From: Devin Donnelly Date: Thu, 6 Oct 2016 16:53:49 -0700 Subject: [PATCH 03/21] Fixes broken links to each module. --- docs/tutorials/kubernetes-basics/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/tutorials/kubernetes-basics/index.html b/docs/tutorials/kubernetes-basics/index.html index 971a3fba19..723639552b 100644 --- a/docs/tutorials/kubernetes-basics/index.html +++ b/docs/tutorials/kubernetes-basics/index.html @@ -42,7 +42,7 @@
- + @@ -50,7 +50,7 @@
- + @@ -58,7 +58,7 @@
- + @@ -66,7 +66,7 @@
- + @@ -74,7 +74,7 @@
- + @@ -82,7 +82,7 @@
- + From 482760d6d6ab0c8f849b5b34b445fed57e84c682 Mon Sep 17 00:00:00 2001 From: Devin Donnelly Date: Thu, 6 Oct 2016 16:59:17 -0700 Subject: [PATCH 04/21] Replaces links to HelloNode with links to Kubernetes Basics. --- docs/index.md | 6 +++--- index.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index 5e29c42dcb..38f3400167 100644 --- a/docs/index.md +++ b/docs/index.md @@ -77,9 +77,9 @@ h2, h3, h4 { Read the Overview
-

Hello World on Google Container Engine

-

In this quickstart, we’ll be creating a Kubernetes instance that stands up a simple “Hello World” app using Node.js. In just a few minutes you'll go from zero to deployed Kubernetes app on Google Container Engine (GKE), a hosted service from Google.

- Get Started on GKE +

Kubernetes Basics Interactive Tutorial

+

The Kubernetes Basics interactive tutorials let you try out Kubernetes features using Minikube right out of your web browser in a virtual terminal. Learn about the Kubernetes system and deploy, expose, scale, and upgrade a containerized application in just a few minutes.

+ Try the Interactive Tutorials

Installing Kubernetes on Linux with kubeadm

diff --git a/index.html b/index.html index 3c940304ba..cf01ad2e92 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ title: Production-Grade Container Orchestration

Production-Grade Container Orchestration

Automated container deployment, scaling, and management
- Try Our Hello World + Try Our Interactive Tutorials From 30a8b4724f49578c5402d0257a3dbde2ed56dc43 Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Sun, 25 Sep 2016 15:33:10 -0700 Subject: [PATCH 05/21] Clarified the apiGroup identified by empty string Noted this where the relevance of api group is introduced, and corrected the reference to what the empty string means ("core" api group, which is the terminology used in the page that introduces api group, rather than the old text "default"). --- docs/admin/authorization.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/admin/authorization.md b/docs/admin/authorization.md index 0c8508a1ec..a72a855cb2 100644 --- a/docs/admin/authorization.md +++ b/docs/admin/authorization.md @@ -53,7 +53,7 @@ A request has the following attributes that can be considered for authorization: - what resource is being accessed (for resource requests only) - what subresource is being accessed (for resource requests only) - the namespace of the object being accessed (for namespaced resource requests only) - - the API group being accessed (for resource requests only) + - the API group being accessed (for resource requests only); an empty string designates the [core API group](../api.md#api-groups) The request verb for a resource API endpoint can be determined by the HTTP verb used and whether or not the request acts on an individual resource or a collection of resources: @@ -231,7 +231,7 @@ metadata: namespace: default name: pod-reader rules: - - apiGroups: [""] # The API group "" indicates the default API Group. + - apiGroups: [""] # The API group "" indicates the core API Group. resources: ["pods"] verbs: ["get", "watch", "list"] nonResourceURLs: [] @@ -632,4 +632,4 @@ subjectaccessreview "" created ``` This is useful for debugging access problems, in that you can use this resource -to determine what access an authorizer is granting. \ No newline at end of file +to determine what access an authorizer is granting. From 2c14d7fcb04e1f631316f1305f6a3213020baa2e Mon Sep 17 00:00:00 2001 From: Steve Perry Date: Fri, 7 Oct 2016 14:13:42 -0700 Subject: [PATCH 06/21] Redirection experiment 2. (#1411) --- _config.yml | 4 ++++ docs/tutorials/kubernetes-basics/cluster-intro.html | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 1a7fefdb6d..7ace374fca 100644 --- a/_config.yml +++ b/_config.yml @@ -27,3 +27,7 @@ defaults: showedit: true permalink: pretty + +gems: + - jekyll-redirect-from + diff --git a/docs/tutorials/kubernetes-basics/cluster-intro.html b/docs/tutorials/kubernetes-basics/cluster-intro.html index 890c9c387e..423dc61783 100644 --- a/docs/tutorials/kubernetes-basics/cluster-intro.html +++ b/docs/tutorials/kubernetes-basics/cluster-intro.html @@ -1,5 +1,7 @@ --- -redirect_from: "/docs/tutorials/getting-started/create-cluster/" +redirect_from: + - /docs/tutorials/getting-started/create-cluster/ + - /docs/tutorials/getting-started/create-cluster.html --- From ee5b5eea3980d67220055c2248ff400864bc6ee6 Mon Sep 17 00:00:00 2001 From: Anirudh Ramanathan Date: Sat, 8 Oct 2016 13:43:19 -0700 Subject: [PATCH 07/21] Point init containers to documentation The proposal doesn't reflect reality. --- docs/user-guide/petset/bootstrapping/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/petset/bootstrapping/index.md b/docs/user-guide/petset/bootstrapping/index.md index e9b04fc135..03ba721edc 100644 --- a/docs/user-guide/petset/bootstrapping/index.md +++ b/docs/user-guide/petset/bootstrapping/index.md @@ -8,7 +8,7 @@ This purpose of this guide is to help you become familiar with the runtime initialization of [Pet Sets](/docs/user-guide/petset). This guide assumes the same prerequisites, and uses the same terminology as the [Pet Set user document](/docs/user-guide/petset). -The most common way to initialize the runtime in a containerized environment, is through a custom [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint). While this is not necessarily bad, making your application pid 1, and treating containers as processes in general is good for a few reasons outside the scope of this document. Doing so allows you to run docker images from third-party vendors without modification. We will not be writing custom entrypoints for this example, but using a feature called [init containers](http://releases.k8s.io/{{page.githubbranch}}/docs/proposals/container-init.md), to explain 2 common patterns that come up deploying Pet Sets. +The most common way to initialize the runtime in a containerized environment, is through a custom [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint). While this is not necessarily bad, making your application pid 1, and treating containers as processes in general is good for a few reasons outside the scope of this document. Doing so allows you to run docker images from third-party vendors without modification. We will not be writing custom entrypoints for this example, but using a feature called [init containers](http://kubernetes.io/docs/user-guide/production-pods/#handling-initialization), to explain 2 common patterns that come up deploying Pet Sets. 1. Transferring state across Pet restart, so that a future Pet is initialized with the computations of its past incarnation 2. Initializing the runtime environment of a Pet based on existing conditions, like a list of currently healthy peers From 58ae316dfed5f6eeddebaebdc19f842ff268ad60 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Sun, 9 Oct 2016 16:42:13 +0300 Subject: [PATCH 08/21] Update kubectl-overview.md Broken link --- docs/user-guide/kubectl-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide/kubectl-overview.md b/docs/user-guide/kubectl-overview.md index 81f171a445..b86009d69a 100644 --- a/docs/user-guide/kubectl-overview.md +++ b/docs/user-guide/kubectl-overview.md @@ -281,4 +281,4 @@ $ kubectl logs -f ## Next steps -Start using the [kubectl](/docs/user-guide/kubectl/kubectl) commands. +Start using the [kubectl](/docs/user-guide/kubectl) commands. From 7143b1e7820df2e2e6760212f5943bb7b9eb366d Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Sun, 9 Oct 2016 19:14:02 +0300 Subject: [PATCH 09/21] More broken links --- docs/user-guide/kubectl-overview.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/user-guide/kubectl-overview.md b/docs/user-guide/kubectl-overview.md index b86009d69a..bb587a9f91 100644 --- a/docs/user-guide/kubectl-overview.md +++ b/docs/user-guide/kubectl-overview.md @@ -77,7 +77,7 @@ Operation | Syntax | Description `stop` | `kubectl stop` | Deprecated: Instead, see `kubectl delete`. `version` | `kubectl version [--client] [flags]` | Display the Kubernetes version running on the client and server. -Remember: For more about command operations, see the [kubectl](/docs/user-guide/kubectl/kubectl) reference documentation. +Remember: For more about command operations, see the [kubectl](/docs/user-guide/kubectl) reference documentation. ## Resource types @@ -115,7 +115,7 @@ Resource type | Abbreviated alias ## Output options -Use the following sections for information about how you can format or sort the output of certain commands. For details about which commands support the various output options, see the [kubectl](/docs/user-guide/kubectl/kubectl) reference documentation. +Use the following sections for information about how you can format or sort the output of certain commands. For details about which commands support the various output options, see the [kubectl](/docs/user-guide/kubectl) reference documentation. ### Formatting output @@ -146,7 +146,7 @@ In this example, the following command outputs the details for a single pod as a `$ kubectl get pod web-pod-13je7 -o=yaml` -Remember: See the [kubectl](/docs/user-guide/kubectl/kubectl) reference documentation for details about which output format is supported by each command. +Remember: See the [kubectl](/docs/user-guide/kubectl) reference documentation for details about which output format is supported by each command. #### Custom columns From 12f5e30309ea31aba99b980a73bdd646d97f475b Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Sun, 25 Sep 2016 15:24:59 -0700 Subject: [PATCH 10/21] Removed confusing remark about authorizers determining groups The old text said that the authorizer is expected to determine group memberships when the authenticator does not. This not true. It is allowed, but not expected --- and none of the standard authorizers do it. I tried composing a brief correct statement about this, but the reviews were mainly aghast that internal details of some non-standard authorizers were being injected into the discussion of authentictors. I decided that the better part of valor is simply to delete the whole topic from here. Besides, it is a conclusion that any reader would normally draw --- since there is no statement forbidding it (nor indeed any indication that there might be a reason to forbid it), any reader would naturally conclude that an authorizer is free to derive additional intermediate information of any sort and in any way it likes. --- docs/admin/accessing-the-api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/admin/accessing-the-api.md b/docs/admin/accessing-the-api.md index 6569ac93f8..cb3f3d4ce4 100644 --- a/docs/admin/accessing-the-api.md +++ b/docs/admin/accessing-the-api.md @@ -52,8 +52,8 @@ On GCE, Client Certificates, Password, Plain Tokens, and JWT Tokens are all enab If the request cannot be authenticated, it is rejected with HTTP status code 401. Otherwise, the user is authenticated as a specific `username`, and the user name is available to subsequent steps to use in their decisions. Some authenticators -may also provide the group memberships of the user, while other authenticators -do not (and expect the authorizer to determine these). +also provide the group memberships of the user, while other authenticators +do not. While Kubernetes uses "usernames" for access control decisions and in request logging, it does not have a `user` object nor does it store usernames or other information about From a3821df026f855c83c236c2274752f426501fb86 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 6 Oct 2016 12:05:28 +0100 Subject: [PATCH 11/21] Ensure namespace is created first in microservices-demo Avoid 'namespaces "sock-shop" not found' messages when users try the demo --- docs/getting-started-guides/kubeadm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started-guides/kubeadm.md b/docs/getting-started-guides/kubeadm.md index 86de0652c2..e5e60c83ef 100644 --- a/docs/getting-started-guides/kubeadm.md +++ b/docs/getting-started-guides/kubeadm.md @@ -178,7 +178,7 @@ As an example, install a sample microservices application, a socks shop, to put To learn more about the sample microservices app, see the [GitHub README](https://github.com/microservices-demo/microservices-demo). # git clone https://github.com/microservices-demo/microservices-demo - # kubectl apply -f microservices-demo/deploy/kubernetes/manifests + # kubectl apply -f microservices-demo/deploy/kubernetes/manifests/sock-shop-ns.yml -f microservices-demo/deploy/kubernetes/manifests You can then find out the port that the [NodePort feature of services](/docs/user-guide/services/) allocated for the front-end service by running: From 65e894123928653fc95b3605d94648586132c317 Mon Sep 17 00:00:00 2001 From: James Munnelly Date: Mon, 26 Sep 2016 21:41:24 +0100 Subject: [PATCH 12/21] Add kubeadm reference docs --- docs/getting-started-guides/kubeadm.md | 1 + docs/user-guide/kubeadm-reference.md | 143 +++++++++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 docs/user-guide/kubeadm-reference.md diff --git a/docs/getting-started-guides/kubeadm.md b/docs/getting-started-guides/kubeadm.md index e5e60c83ef..32b91ccdb9 100644 --- a/docs/getting-started-guides/kubeadm.md +++ b/docs/getting-started-guides/kubeadm.md @@ -211,6 +211,7 @@ See the [list of add-ons](/docs/admin/addons/) to explore other add-ons, includi * Learn more about [Kubernetes concepts and kubectl in Kubernetes 101](/docs/user-guide/walkthrough/). * Install Kubernetes with [a cloud provider configurations](/docs/getting-started-guides/) to add Load Balancer and Persistent Volume support. +* Learn about `kubeadm`'s advanced usage on the [advanced reference doc](/docs/user-guide/kubeadm-reference/) ## Cleanup diff --git a/docs/user-guide/kubeadm-reference.md b/docs/user-guide/kubeadm-reference.md new file mode 100644 index 0000000000..49ba3663e6 --- /dev/null +++ b/docs/user-guide/kubeadm-reference.md @@ -0,0 +1,143 @@ +# kubeadm reference + +This document provides information on how to use kubeadm's advanced options. + +Running kubeadm init bootstraps a Kubernetes cluster. This consists of the +following steps: + +1. kubeadm generates a token that additional nodes can use to register themselves +with the master in future. + +1. kubeadm generates a self-signed CA using openssl to provision identities +for each node in the cluster, and for the API server to secure communication +with clients. + +1. Outputting a kubeconfig file for the kubelet to use to connect to the API server, +as well as an additional kubeconfig file for administration. + +1. kubeadm generates Kubernetes resource manifests for the API server, controller manager +and scheduler, and placing them in `/etc/kubernetes/manifests`. The kubelet watches +this directory for static resources to create on startup. These are the core +components of Kubernetes, and once they are up and running we can use `kubectl` +to set up/manage any additional components. + +1. kubeadm installs any add-on components, such as DNS or discovery, via the API server. + +## Usage + +Fields that support multiple values do so either with comma separation, or by specifying +the flag multiple times. + +### `kubeadm init` + +It is usually sufficient to run `kubeadm init` without any flags, +but in some cases you might like to override the default behaviour. +Here we specify all the flags that can be used to customise the Kubernetes +installation. + +- `--api-advertise-addresses` (multiple values are allowed) +- `--api-external-dns-names` (multiple values are allowed) + +By default, `kubeadm init` automatically detects IP addresses and uses +these to generate certificates for the API server. This uses the IP address +of the default network interface. If you would like to access the API server +through a different IP address, or through a hostname, you can override these +defaults with `--api-advertise-addresses` and `--api-external-dns-names`. +For example, to generate certificates that verify the API server at addresses +`10.100.245.1` and `100.123.121.1`, you could use +`--api-advertise-addresses=10.100.245.1,100.123.121.1`. To allow it to be accessed +with a hostname, `--api-external-dns-names=kubernetes.example.com,kube.example.com` +Specifying `--api-advertise-addresses` disables auto detection of IP addresses. + +- `--cloud-provider` + +Currently, `kubeadm init` does not provide autodetection of cloud provider. +This means that load balancing and persistent volumes are not supported out +of the box. You can specify a cloud provider using `--cloud-provider`. +Valid values are the ones supported by `controller-manager`, namely `"aws"`, +`"azure"`, `"cloudstack"`, `"gce"`, `"mesos"`, `"openstack"`, `"ovirt"`, +`"rackspace"`, `"vsphere"`. In order to provide additional configuration for +the cloud provider, you should create a `/etc/kubernetes/cloud-config.json` +file manually, before running `kubeadm init`. `kubeadm` automatically +picks those settings up and ensures other nodes are configured correctly. +You must also set the `--cloud-provider` and `--cloud-config` parameters +yourself by editing the `/etc/systemd/system/kubelet.service.d/10-kubeadm.conf` +file appropriately. + +- `--external-etcd-cafile` etcd certificate authority file +- `--external-etcd-endpoints` (multiple values are allowed) +- `--external-etcd-certfile` etcd client certificate file +- `--external-etcd-keyfile` etcd client key file + +By default, `kubeadm` deploys a single node etcd cluster on the master +to store Kubernetes state. This means that any failure on the master node +requires you to rebuild your cluster from scratch. Currently `kubeadm init` +does not support automatic deployment of a highly available etcd cluster. +If you would like to use your own etcd cluster, you can override this +behaviour with `--external-etcd-endpoints`. `kubeadm` supports etcd client +authentication using the `--external-etcd-cafile`, `--external-etcd-certfile` +and `--external-etcd-keyfile` flags. + +- `--pod-network-cidr` + +By default, `kubeadm init` does not set node CIDR's for pods and allows you to +bring your own networking configuration through a CNI compatible network +controller addon such as [Weave Net](https://github.com/weaveworks/weave-kube), +[Calico](https://github.com/projectcalico/calico-containers/tree/master/docs/cni/kubernetes/manifests/kubeadm) +or [Canal](https://github.com/tigera/canal/tree/master/k8s-install/kubeadm). +If you are using a compatible cloud provider or flannel, you can specify a +subnet to use for each pod on the cluster with the `--pod-network-cidr` flag. +This should be a minimum of a /16 so that kubeadm is able to assign /24 subnets +to each node in the cluster. + +- `--service-cidr` (default '10.12.0.0/12') + +You can use the `--service-cidr` flag to override the subnet Kubernetes uses to +assign pods IP addresses. If you do, you will also need to update the +`/etc/systemd/system/kubelet.service.d/10-kubeadm.conf` file to reflect this change +else DNS will not function correctly. + +- `--service-dns-domain` (default 'cluster.local') + +By default, `kubeadm init` deploys a cluster that assigns services with DNS names +`..svc.cluster.local`. You can use the `--service-dns-domain` +to change the DNS name suffix. Again, you will need to update the +`/etc/systemd/system/kubelet.service.d/10-kubeadm.conf` file accordingly else DNS will +not function correctly. + +- `--token` + +By default, `kubeadm init` automatically generates the token used to initialise +each new node. If you would like to manually specify this token, you can use the +`--token` flag. The token must be of the format '<6 character string>.<16 character string>'. + +- `--use-kubernetes-version` (default 'v1.4.1') the kubernetes version to initialise + +`kubeadm` was originally built for Kubernetes version **v1.4.0**, older versions are not +supported. With this flag you can try any future version, e.g. **v1.5.0-beta.1** +whenever it comes out (check [releases page](https://github.com/kubernetes/kubernetes/releases) +for a full list of available versions). + +### `kubeadm join` + +`kubeadm join` has one mandatory flag, the token used to secure cluster bootstrap, +and one mandatory argument, the master IP address. + +Here's an example on how to use it: + +`kubeadm join --token=the_secret_token 192.168.1.1` + +- `--token=` + +By default, when `kubeadm init` runs, a token is generated and revealed in the output. +That's the token you should use here. + +## Troubleshooting + +* Some users on RHEL/CentOS 7 have reported issues with traffic being routed incorrectly due to iptables being bypassed. You should ensure `net.bridge.bridge-nf-call-iptables` is set to 1 in your sysctl config, eg. + +``` +# cat /etc/sysctl.d/k8s.conf +net.bridge.bridge-nf-call-ip6tables = 1 +net.bridge.bridge-nf-call-iptables = 1 +``` From 23d77196631642e67a8d73c15fa7da1fdd5c7939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Tue, 11 Oct 2016 09:01:12 +0300 Subject: [PATCH 13/21] Move kubeadm reference, add a navigation link to it and assignees --- _data/guides.yml | 2 ++ .../kubeadm-reference.md => admin/kubeadm.md} | 9 ++++++++- docs/getting-started-guides/kubeadm.md | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) rename docs/{user-guide/kubeadm-reference.md => admin/kubeadm.md} (99%) diff --git a/_data/guides.yml b/_data/guides.yml index ab622a0284..40d47b08d6 100644 --- a/_data/guides.yml +++ b/_data/guides.yml @@ -252,6 +252,8 @@ toc: path: /docs/admin/ - title: Cluster Management Guide path: /docs/admin/cluster-management/ + - title: kubeadm reference + path: /docs/admin/kubeadm/ - title: Installing Addons path: /docs/admin/addons/ - title: Sharing a Cluster with Namespaces diff --git a/docs/user-guide/kubeadm-reference.md b/docs/admin/kubeadm.md similarity index 99% rename from docs/user-guide/kubeadm-reference.md rename to docs/admin/kubeadm.md index 49ba3663e6..57a21528c2 100644 --- a/docs/user-guide/kubeadm-reference.md +++ b/docs/admin/kubeadm.md @@ -1,4 +1,11 @@ -# kubeadm reference +--- +assignees: +- mikedanese +- luxas +- errordeveloper + +--- + This document provides information on how to use kubeadm's advanced options. diff --git a/docs/getting-started-guides/kubeadm.md b/docs/getting-started-guides/kubeadm.md index 32b91ccdb9..34e3ea7656 100644 --- a/docs/getting-started-guides/kubeadm.md +++ b/docs/getting-started-guides/kubeadm.md @@ -211,7 +211,7 @@ See the [list of add-ons](/docs/admin/addons/) to explore other add-ons, includi * Learn more about [Kubernetes concepts and kubectl in Kubernetes 101](/docs/user-guide/walkthrough/). * Install Kubernetes with [a cloud provider configurations](/docs/getting-started-guides/) to add Load Balancer and Persistent Volume support. -* Learn about `kubeadm`'s advanced usage on the [advanced reference doc](/docs/user-guide/kubeadm-reference/) +* Learn about `kubeadm`'s advanced usage on the [advanced reference doc](/docs/admin/kubeadm/) ## Cleanup From 75a3e77452891485f532593dca099bf36e4db5f6 Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Tue, 11 Oct 2016 20:49:58 +0100 Subject: [PATCH 14/21] Note about workaround for https://github.com/kubernetes/kubernetes/issues/34566 --- docs/getting-started-guides/kubeadm.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/getting-started-guides/kubeadm.md b/docs/getting-started-guides/kubeadm.md index 34e3ea7656..d5232ad16c 100644 --- a/docs/getting-started-guides/kubeadm.md +++ b/docs/getting-started-guides/kubeadm.md @@ -254,3 +254,9 @@ Please note: `kubeadm` is a work in progress and these limitations will be addre 1. There is not yet an easy way to generate a `kubeconfig` file which can be used to authenticate to the cluster remotely with `kubectl` on, for example, your workstation. Workaround: copy the kubelet's `kubeconfig` from the master: use `scp root@:/etc/kubernetes/admin.conf .` and then e.g. `kubectl --kubeconfig ./admin.conf get nodes` from your workstation. + +1. If you are using VirtualBox (directly or via Vagrant), you will need to ensure that `hostname -i` returns a routable IP address (i.e. one on the second network interface, not the first one). + By default, it doesn't do this and kubelet ends-up using first non-loopback network interface, which is usually NATed. + Workaround: Modify `/etc/hosts`, take a look at this [`Vagrantfile`][ubuntu-vagrantfile] for how you this can be achieved. + +[ubuntu-vagrantfile]: https://github.com/errordeveloper/k8s-playground/blob/22dd39dfc06111235620e6c4404a96ae146f26fd/Vagrantfile#L11), From 791000cbe4f771b4c48e7bb330db52ac3e1ff0c1 Mon Sep 17 00:00:00 2001 From: Steve Perry Date: Tue, 11 Oct 2016 14:36:18 -0700 Subject: [PATCH 15/21] Add replica count to tutorial. (#1434) --- .../deployment-scale.yaml | 16 +++++++++++++ .../run-stateless-application-deployment.md | 24 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 docs/tutorials/stateless-application/deployment-scale.yaml diff --git a/docs/tutorials/stateless-application/deployment-scale.yaml b/docs/tutorials/stateless-application/deployment-scale.yaml new file mode 100644 index 0000000000..2968b88360 --- /dev/null +++ b/docs/tutorials/stateless-application/deployment-scale.yaml @@ -0,0 +1,16 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: nginx-deployment +spec: + replicas: 4 + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx:1.8 # Update the version of nginx from 1.7.9 to 1.8 + ports: + - containerPort: 80 diff --git a/docs/tutorials/stateless-application/run-stateless-application-deployment.md b/docs/tutorials/stateless-application/run-stateless-application-deployment.md index 70aeb925c2..20a7aff243 100644 --- a/docs/tutorials/stateless-application/run-stateless-application-deployment.md +++ b/docs/tutorials/stateless-application/run-stateless-application-deployment.md @@ -94,6 +94,30 @@ specifies that the deployment should be updated to use nginx 1.8. kubectl get pods -l app=nginx +### Scaling the application by increasing the replica count + +You can increase the number of pods in your Deployment by applying a new YAML +file. This YAML file sets `replicas` to 4, which specifies that the Deployment +should have four pods: + +{% include code.html language="yaml" file="deployment-scale.yaml" ghlink="/docs/tutorials/stateless-application/deployment-scale.yaml" %} + +1. Apply the new YAML file: + + kubectl apply -f $REPO/docs/tutorials/stateless-application/deployment-scale.yaml + +1. Verify that the Deployment has four pods: + + kubectl get pods + + The output is similar to this: + + NAME READY STATUS RESTARTS AGE + nginx-deployment-148880595-4zdqq 1/1 Running 0 25s + nginx-deployment-148880595-6zgi1 1/1 Running 0 25s + nginx-deployment-148880595-fxcez 1/1 Running 0 2m + nginx-deployment-148880595-rwovn 1/1 Running 0 2m + ### Deleting a deployment Delete the deployment by name: From a250e18e2f3d91848ff07f5fad4c25677e2d8a80 Mon Sep 17 00:00:00 2001 From: Steel Brain Date: Wed, 12 Oct 2016 05:44:51 +0530 Subject: [PATCH 16/21] :bug: Fix broken JSON format --- docs/user-guide/secrets/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/secrets/index.md b/docs/user-guide/secrets/index.md index 4da56a3cca..f9931bfbf5 100644 --- a/docs/user-guide/secrets/index.md +++ b/docs/user-guide/secrets/index.md @@ -284,7 +284,7 @@ For example, you can specify a default mode like this: "image": "redis", "volumeMounts": [{ "name": "foo", - "mountPath": "/etc/foo", + "mountPath": "/etc/foo" }] }], "volumes": [{ @@ -322,7 +322,7 @@ permission for different files like this: "image": "redis", "volumeMounts": [{ "name": "foo", - "mountPath": "/etc/foo", + "mountPath": "/etc/foo" }] }], "volumes": [{ From 4d5d29567da6c2e71505a993c9ff1f63db0eaa85 Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Tue, 11 Oct 2016 07:51:54 +0100 Subject: [PATCH 17/21] Cosmetic tweaks to main kubeadm doc - clean-up the reset script - remove details tag --- docs/getting-started-guides/kubeadm.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/getting-started-guides/kubeadm.md b/docs/getting-started-guides/kubeadm.md index d5232ad16c..f4f4c15211 100644 --- a/docs/getting-started-guides/kubeadm.md +++ b/docs/getting-started-guides/kubeadm.md @@ -45,7 +45,7 @@ For each host in turn: * SSH into the machine and become `root` if you are not already (for example, run `sudo su -`). * If the machine is running Ubuntu 16.04, run: - # curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - + # curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - # cat < /etc/apt/sources.list.d/kubernetes.list deb http://apt.kubernetes.io/ kubernetes-xenial main EOF @@ -218,15 +218,17 @@ See the [list of add-ons](/docs/admin/addons/) to explore other add-ons, includi * To uninstall the socks shop, run `kubectl delete -f microservices-demo/deploy/kubernetes/manifests` on the master. -* To undo what `kubeadm` did, simply delete the machines you created for this tutorial, or run the script below and then uninstall the packages. -
-
systemctl stop kubelet;
-  docker rm -f $(docker ps -q); mount | grep "/var/lib/kubelet/*" | awk '{print $3}' | xargs umount 1>/dev/null 2>/dev/null;
-  rm -rf /var/lib/kubelet /etc/kubernetes /var/lib/etcd /etc/cni;
-  ip link set cbr0 down; ip link del cbr0;
-  ip link set cni0 down; ip link del cni0;
-  systemctl start kubelet
-
+* To undo what `kubeadm` did, simply delete the machines you created for this tutorial, or run the script below and then start over or uninstall the packages. + +
+ Reset local state: +
systemctl stop kubelet;
+  docker rm -f -v $(docker ps -q);
+  find /var/lib/kubelet | xargs -n 1 findmnt -n -t tmpfs -o TARGET -T | uniq | xargs -r umount -v;
+  rm -r -f /etc/kubernetes /var/lib/kubelet /var/lib/etcd;
+  
+ If you wish to start over, run `systemctl start kubelet` followed by `kubeadm init` or `kubeadm join`. + ## Feedback From 3c94a1880ebf8125f63f549eee7635729285f250 Mon Sep 17 00:00:00 2001 From: Andrew Shu Date: Wed, 12 Oct 2016 09:16:24 -0700 Subject: [PATCH 18/21] Tutorial: Fix broken links on Basics Overview page --- docs/tutorials/kubernetes-basics/index.html | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/tutorials/kubernetes-basics/index.html b/docs/tutorials/kubernetes-basics/index.html index 723639552b..d678461e41 100644 --- a/docs/tutorials/kubernetes-basics/index.html +++ b/docs/tutorials/kubernetes-basics/index.html @@ -42,49 +42,49 @@
@@ -93,7 +93,7 @@ From cbb4d33b3edc8d2c889ad85618495db87a4ade28 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Wed, 12 Oct 2016 14:17:27 -0700 Subject: [PATCH 19/21] fix 404 redirect Signed-off-by: Jess Frazelle --- 404.md | 63 ++----------------------------------------------- js/redirects.js | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 61 deletions(-) create mode 100644 js/redirects.js diff --git a/404.md b/404.md index bf053c1e3b..e644c19ed2 100644 --- a/404.md +++ b/404.md @@ -3,66 +3,7 @@ layout: docwithnav title: 404 Error! permalink: /404.html --- - + + Sorry, this page was not found. :( diff --git a/js/redirects.js b/js/redirects.js new file mode 100644 index 0000000000..dc3cbb56ed --- /dev/null +++ b/js/redirects.js @@ -0,0 +1,60 @@ +$( document ).ready(function() { + var oldURLs=["/README.md","/README.html",".html",".md","/v1.1/","/v1.0/"]; + var fwdDirs=["examples/","cluster/","docs/devel","docs/design"]; + var doRedirect = false; + var notHere = false; + var forwardingURL=window.location.href; + + var redirects = [{ + "from": "third_party/swagger-ui", + "to": "http://kubernetes.io/kubernetes/third_party/swagger-ui/" + }, + { + "from": "resource-quota", + "to": "http://kubernetes.io/docs/admin/resourcequota/" + }, + { + "from": "horizontal-pod-autoscaler", + "to": "http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/" + }, + { + "from": "docs/roadmap", + "to": "https://github.com/kubernetes/kubernetes/milestones/" + }, + { + "from": "api-ref/", + "to": "https://github.com/kubernetes/kubernetes/milestones/" + }, + { + "from": "docs/user-guide/overview", + "to": "http://kubernetes.io/docs/whatisk8s/" + }]; + + for (i=0;i -1){ + notHere = true; + window.location.replace(redirects[i].to); + } + } + + for (i=0;i -1){ + var urlPieces = forwardingURL.split(fwdDirs[i]); + var newURL = "https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/" + fwdDirs[i] + urlPieces[1]; + notHere = true; + window.location.replace(newURL); + } + } + if (!notHere) { + for (i=0;i -1 && + forwardingURL.indexOf("404.html") < 0){ + doRedirect=true; + forwardingURL=forwardingURL.replace(oldURLs[i],"/"); + } + } + if (doRedirect){ + window.location.replace(forwardingURL); + }; + } +}); From 55076d553b5b7a6e6128aa5ebf6dcbe3c3320d11 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Wed, 12 Oct 2016 15:27:21 -0700 Subject: [PATCH 20/21] exclude sitemap, css and 404 from sitemap Signed-off-by: Jess Frazelle --- 404.md | 1 + robots.txt | 2 ++ sitemap.xml | 6 +++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/404.md b/404.md index e644c19ed2..3d32e81bcf 100644 --- a/404.md +++ b/404.md @@ -2,6 +2,7 @@ layout: docwithnav title: 404 Error! permalink: /404.html +no_canonical: true --- diff --git a/robots.txt b/robots.txt index 187d7c94bb..9bb39d8dbd 100644 --- a/robots.txt +++ b/robots.txt @@ -3,5 +3,7 @@ User-agent: * Disallow: /legacy/ Disallow: /v1.0/ Disallow: /v1.1/ +Disallow: /404/ +Disallow: 404.html SITEMAP: http://kubernetes.io/sitemap.xml diff --git a/sitemap.xml b/sitemap.xml index a965f4a570..ff1dd0d398 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -11,8 +11,8 @@ http://kubernetes.io/ {{ site.time | date_to_xmlschema }} -{% for page in site.pages %} +{% for page in site.pages %}{% if page.url != "/404.html" and page.url != "/sitemap.xml" and page.url != "/css/styles.css" %} http://kubernetes.io{{ page.url }} {% if page.date %}{{ page.date | date_to_xmlschema }}{% else %}{{ site.time | date_to_xmlschema }}{% endif %} -{% endfor %} - \ No newline at end of file +{% endif %}{% endfor %} + From d061e531931117d587a822334b02c804d7ad0e98 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Wed, 12 Oct 2016 13:43:39 -0700 Subject: [PATCH 21/21] dont set canonical tag for 404 page Signed-off-by: Jess Frazelle --- 404.md | 1 + _includes/head-header.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/404.md b/404.md index e644c19ed2..3d32e81bcf 100644 --- a/404.md +++ b/404.md @@ -2,6 +2,7 @@ layout: docwithnav title: 404 Error! permalink: /404.html +no_canonical: true --- diff --git a/_includes/head-header.html b/_includes/head-header.html index 12de81d975..0405f3699c 100644 --- a/_includes/head-header.html +++ b/_includes/head-header.html @@ -2,7 +2,7 @@ - + {% if !page.no_canonical %}{% endif %}