-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Federation] Document simplified federation control plane deployment via kubefed. #1822
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
--- | ||
assignees: | ||
- madhusudancs | ||
|
||
--- | ||
Kubernetes v1.5 introduced a new command line tool called `kubefed` | ||
to facilitate the administration of cluster federations. `kubefed` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "to facilitate the adminstration of cluster federations" -> "to help you administrate your federated clusters." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @devin-donnelly is it right to say "to help you administrate your federation"? I don't want to say "federated clusters" because what they are managing is a federation control plane which is an entity in itself. |
||
stands for "Kubernetes Federate". It aids in both deploying a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought it stood for "Kubernetes Federation" :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nikhiljindal we wanted to choose a verb, like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sentence is probably not necessary anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, removed. |
||
Kubernetes Cluster Federation control plane and adding/removing | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. " There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
clusters from it. | ||
|
||
This guide explains how to administer a Kubernetes Cluster Federation | ||
using `kubefed`. | ||
|
||
`kubefed` is considered alpha in Kubernetes v1.5. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set this off with a blockquote, like below: "> Note: |
||
|
||
* TOC | ||
{:toc} | ||
|
||
## Prerequisites | ||
|
||
This guide assumes that you have a running Kubernetes cluster. Please | ||
see one of the [getting started](/docs/getting-started-guides/) guides | ||
for installation instructions for your platform. | ||
|
||
## Getting `kubefed` | ||
|
||
Download the Kubernetes client tarball corresponding to a release | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mentioned 1.5. PTAL. |
||
[from the release page](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md), | ||
extract the binaries in the tarball to one of the directories | ||
in your `$PATH` and set the executable permission on those binaries. | ||
|
||
```shell | ||
curl -O https://storage.googleapis.com/kubernetes-release/release/v1.5.0/kubernetes-client-linux-amd64.tar.gz | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This path doesn't exist yet. Are you sure that 1.5 will be released in this path? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mwielgus yeah, I am pretty sure. A good test is replacing |
||
tar -xzvf kubernetes-client-linux-amd64.tar.gz | ||
sudo cp kubernetes/client/bin/kubefed /usr/local/bin | ||
sudo chmod +x /usr/local/bin/kubefed | ||
sudo cp kubernetes/client/bin/kubectl /usr/local/bin | ||
sudo chmod +x /usr/local/bin/kubectl | ||
``` | ||
|
||
## Choosing a host cluster. | ||
|
||
Choose one of your Kubernetes clusters as a cluster where you want to | ||
host the federation control plane components. We refer to this cluster | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid "we". "You'll need to choose one of your Kubernetes clusters to be the host cluster. The host cluster hosts the components that make up your federation control plane. Ensure that you have a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
as a "host cluster" henceforth. Ensure that you have a kubeconfig entry | ||
in your local kubeconfig corresponding to this cluster. You can verify | ||
this by running: | ||
|
||
```shell | ||
kubectl config get-contexts | ||
``` | ||
|
||
and ensuring that there is a context corresponding to your host | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you show an example of successful output? "The output should contain a context corresponding to your host cluster, similar to the following:" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
cluster. | ||
|
||
Please also make a note of this context because you will need it next. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "You'll need to provide the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, but with some additional parenthesized text. PTAL. |
||
|
||
|
||
## Deploying a federation control plane. | ||
|
||
Deploying a federation control plane on your host cluster is as simple | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "To deploy a federation control plane on your host cluster, run
The following example command deploys a federation control plane with the name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
as running: | ||
|
||
```shell | ||
kubefed init fellowship --host-cluster-context=rivendell --dns-zone-name="example.com" | ||
``` | ||
|
||
where `fellowship` is the name of the federation, `rivendell` is the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace paragraph with: "The domain suffix you specify in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
host cluster context from the previous step and `example.com` is the | ||
domain name suffix that you want for your federated services. This has | ||
to be a real domain that you control over and is programmable by your | ||
DNS provider. | ||
|
||
`kubefed init` sets up the federation control plane in the host | ||
cluster and also adds an entry for the federation API server in your | ||
local kubeconfig. However, in this alpha release it does not | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Note that in the alpha release in Kubernetes 1.5, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
automatically set the current context to the newly deployed federation. | ||
You can set this by running: | ||
|
||
```shell | ||
kubectl config use-context fellowship | ||
``` | ||
|
||
where `fellowship` is the name of your federation. | ||
|
||
## Joining a cluster | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously (in the introduction) you referred to this as "adding" a cluster to the federation. That makes more sense and I would stick with it. You can still say "You can add a cluster to an by running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a cluster to a federation |
||
|
||
Cluster Federation allows you to manage your workload across multiple | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Too much background/a little wordy. How about: "Once you've deployed a cluster federation, you'll need to make the federation control plane aware of the clusters the federation should manage. You can add a cluster to your federation by using the To use The following example command adds the cluster There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @devin-donnelly this sounds much better. I changed the first sentence to: "Once you've deployed a federation control plane, you'll need to make that control plane aware of the clusters it should manage. " Does that sound right? |
||
clusters. In order to do that, a federation control plane must be | ||
aware of the clusters that it is responsible for managing. You can | ||
teach the federation control plane about a cluster by joining that | ||
cluster to the federation. | ||
|
||
To join a cluster to a federation run: | ||
|
||
``` | ||
kubfed join gondor --host-cluster-context=rivendell | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kubfed -> kubefed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops. Fixed. |
||
``` | ||
|
||
where `gondor` is the name of the cluster you are joining and | ||
`rivendell` is the federation control plane's host cluster. | ||
|
||
### Naming rules and customization | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try not to nest a subheading directly underneath a section heading. The "#### Cluster name" heading really only pertains to the first sentence anyway; please remove. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. Removed. |
||
#### Cluster name | ||
|
||
Cluster name supplied to `kubefed join` must be a valid RFC 1035 label. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "The cluster name you supply to |
||
|
||
Furthermore, federation control plane requires credentials of the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "The federation control plane uses the cluster name to obtain credentials for the cluster you add to the federation by looking up the credentials in the local There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with this wording is, it doesn't explicitly state that the cluster name in the command is matched to the context name in the kubeconfig. There is also a concept of cluster name in kubeconfig and we need to ensure that people don't get confused about these two. How do we reword for that? |
||
joined clusters to operate on them. These credentials are obtained | ||
from the local kubeconfig. `kubefed join` uses the cluster name | ||
specified as the argument to look for the cluster's context in the | ||
local kubeconfig. If it fails to find a matching context, it exits | ||
with an error. | ||
|
||
It is particularly a problem in the cases where context names | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "This might cause issues in cases where context names for each cluster in the federation don't follow RFC 1035 label naming rules. In such cases, you can specify a cluster name that conforms..." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
for the clusters don't follow RFC 1035 label naming rules. In these | ||
cases, you could specify a cluster name that conforms to the RFC 1035 | ||
label naming rules and specify the cluster context using the | ||
`--cluster-context` flag. For example, if context of the cluster your | ||
are joining is `gondor_needs-no_king`, then you can | ||
join the cluster by running: | ||
|
||
```shell | ||
kubfed join gondor --host-cluster-context=rivendell --cluster-context=gondor_needs-no_king | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kubfed -> kubefed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
``` | ||
|
||
#### Secret name | ||
|
||
Cluster credentials required by the federation control plane as | ||
described above are stored as a secret in the host cluster. The name | ||
of the secret is also derived from the cluster name. | ||
|
||
However, the name of a secret object in Kubernetes should conform | ||
to the subdomain name specification described in RFC 1123. If this | ||
isn't case, you can pass the secret name to `kubefed join` using the | ||
`--secret-name` flag. For example, if the cluster name is `noldor` and | ||
the secret name is `11kingdom`, you can join the cluster by | ||
running: | ||
|
||
```shell | ||
kubfed join noldor --host-cluster-context=rivendell --secret-name=11kingdom | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kubfed -> kubefed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops again! Thanks! Fixed. |
||
``` | ||
|
||
## Unjoining a cluster: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing a cluster from a federation |
||
|
||
Unjoining a cluster from federation is as simple as running: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "To remove a cluster from a federation, run the |
||
|
||
``` | ||
kubfed unjoin gondor --host-cluster-context=rivendell | ||
``` | ||
|
||
where `gondor` is the cluster name you specified while joining the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove paragraph. |
||
cluster and `rivendell` is the federation control plane's host cluster. | ||
|
||
## Turning down the federation control plane: | ||
|
||
Proper cleanup of federation control plane is not fully implemented in | ||
this alpha release of `kubefed`. However, for the time being, deleting | ||
the federation system namespace should remove all the resources except | ||
the persistent storage volume dynamically provisioned for the | ||
federation control plane's etcd. This can be accomplished by running: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Y"ou can delete the federation namespace by running the following command:" |
||
|
||
``` | ||
$ kubectl delete ns federation-system | ||
``` | ||
|
||
Also, you might not want to delete the storage volume that stores | ||
the state of your federation control plane. You can then use that | ||
storage volume to resume your federation control plane. We are | ||
evaluating various alternatives to handle this case correctly and that's the reason for not implementing federation control plane turn down in this alpha release. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Last sentence is unnecessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the whole paragraph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid ast tense.
"Kubernetes version 1.5 includes a new command line tool..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.