Merge pull request #8276 from antoineco/aws-update
refresh aws getting-started pages and templates
This commit is contained in:
commit
f701eba672
@ -20,7 +20,7 @@ Bare-metal | custom | Fedora | flannel | [docs](../../docs/getting-s
|
|||||||
libvirt | custom | Fedora | flannel | [docs](../../docs/getting-started-guides/fedora/flannel_multi_node_cluster.md) | Community ([@aveshagarwal](https://github.com/aveshagarwal))| Tested with 0.15.0
|
libvirt | custom | Fedora | flannel | [docs](../../docs/getting-started-guides/fedora/flannel_multi_node_cluster.md) | Community ([@aveshagarwal](https://github.com/aveshagarwal))| Tested with 0.15.0
|
||||||
KVM | custom | Fedora | flannel | [docs](../../docs/getting-started-guides/fedora/flannel_multi_node_cluster.md) | Community ([@aveshagarwal](https://github.com/aveshagarwal))| Tested with 0.15.0
|
KVM | custom | Fedora | flannel | [docs](../../docs/getting-started-guides/fedora/flannel_multi_node_cluster.md) | Community ([@aveshagarwal](https://github.com/aveshagarwal))| Tested with 0.15.0
|
||||||
Mesos/GCE | | | | [docs](../../docs/getting-started-guides/mesos.md) | [Community](https://github.com/mesosphere/kubernetes-mesos) ([@jdef](https://github.com/jdef)) | Uses K8s v0.11.2
|
Mesos/GCE | | | | [docs](../../docs/getting-started-guides/mesos.md) | [Community](https://github.com/mesosphere/kubernetes-mesos) ([@jdef](https://github.com/jdef)) | Uses K8s v0.11.2
|
||||||
AWS | CoreOS | CoreOS | flannel | [docs](../../docs/getting-started-guides/coreos.md) | Community | Uses K8s version 0.16.1
|
AWS | CoreOS | CoreOS | flannel | [docs](../../docs/getting-started-guides/coreos.md) | Community | Uses K8s version 0.17.0
|
||||||
GCE | CoreOS | CoreOS | flannel | [docs](../../docs/getting-started-guides/coreos.md) | Community (@kelseyhightower) | Uses K8s version 0.15.0
|
GCE | CoreOS | CoreOS | flannel | [docs](../../docs/getting-started-guides/coreos.md) | Community (@kelseyhightower) | Uses K8s version 0.15.0
|
||||||
Vagrant | CoreOS | CoreOS | flannel | [docs](../../docs/getting-started-guides/coreos.md) | Community ( [@pires](https://github.com/pires), [@AntonioMeireles](https://github.com/AntonioMeireles) ) | Uses K8s version 0.15.0
|
Vagrant | CoreOS | CoreOS | flannel | [docs](../../docs/getting-started-guides/coreos.md) | Community ( [@pires](https://github.com/pires), [@AntonioMeireles](https://github.com/AntonioMeireles) ) | Uses K8s version 0.15.0
|
||||||
Bare-metal (Offline) | CoreOS | CoreOS | flannel | [docs](../../docs/getting-started-guides/coreos/bare_metal_offline.md) | Community([@jeffbean](https://github.com/jeffbean)) | Uses K8s version 0.15.0
|
Bare-metal (Offline) | CoreOS | CoreOS | flannel | [docs](../../docs/getting-started-guides/coreos/bare_metal_offline.md) | Community([@jeffbean](https://github.com/jeffbean)) | Uses K8s version 0.15.0
|
||||||
|
@ -1,56 +1,60 @@
|
|||||||
__Note (11/21/2014): This mostly works, but doesn't currently register minions correctly.__
|
# Getting started on Amazon EC2 with CoreOS
|
||||||
|
|
||||||
|
The example below creates an elastic Kubernetes cluster with a custom number of worker nodes and a master.
|
||||||
|
|
||||||
# Getting started on Amazon EC2
|
**Warning:** contrary to the [supported procedure](aws.md), the examples below provision Kubernetes with an insecure API server (plain HTTP,
|
||||||
|
no security tokens, no basic auth). For demonstration purposes only.
|
||||||
The example below creates an elastic Kubernetes cluster with 3 worker nodes and a master.
|
|
||||||
|
|
||||||
## Highlights
|
## Highlights
|
||||||
|
|
||||||
* Cluster bootstrapping using [cloud-config](https://coreos.com/docs/cluster-management/setup/cloudinit-cloud-config)
|
* Cluster bootstrapping using [cloud-config](https://coreos.com/docs/cluster-management/setup/cloudinit-cloud-config/)
|
||||||
* Cross container networking with [flannel](https://github.com/coreos/flannel#flannel)
|
* Cross container networking with [flannel](https://github.com/coreos/flannel#flannel)
|
||||||
* Auto worker registration with [kube-register](https://github.com/kelseyhightower/kube-register#kube-register)
|
* Auto worker registration with [kube-register](https://github.com/kelseyhightower/kube-register#kube-register)
|
||||||
* Kubernetes v0.10.1 [official binaries](https://github.com/GoogleCloudPlatform/kubernetes/releases/tag/v0.10.1)
|
* Kubernetes v0.17.0 [official binaries](https://github.com/GoogleCloudPlatform/kubernetes/releases/tag/v0.17.0)
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
* [kubectl CLI](aws/kubectl.md)
|
|
||||||
* [aws CLI](http://aws.amazon.com/cli)
|
* [aws CLI](http://aws.amazon.com/cli)
|
||||||
* [CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/#choosing-a-channel)
|
* [CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/)
|
||||||
|
* [kubectl CLI](aws/kubectl.md)
|
||||||
|
|
||||||
## Starting a Cluster
|
## Starting a Cluster
|
||||||
|
|
||||||
### Cloud Formation
|
### CloudFormation
|
||||||
|
|
||||||
The [cloudformation-template.json](aws/cloudformation-template.json) can be used to bootstrap a Kubernetes cluster with a single command.
|
The [cloudformation-template.json](aws/cloudformation-template.json) can be used to bootstrap a Kubernetes cluster with a single command:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
aws cloudformation create-stack --stack-name kubernetes --region us-west-2 \
|
aws cloudformation create-stack --stack-name kubernetes --region us-west-2 \
|
||||||
--template-body file://aws/cloudformation-template.json \
|
--template-body file://aws/cloudformation-template.json \
|
||||||
--parameters ParameterKey=KeyPair,ParameterValue=<keypair>
|
--parameters ParameterKey=KeyPair,ParameterValue=<keypair> \
|
||||||
|
--parameters ParameterKey=ClusterSize,ParameterValue=<cluster_size> \
|
||||||
|
--parameters ParameterKey=VpcId,ParameterValue=<vpc_id> \
|
||||||
|
--parameters ParameterKey=SubnetId,ParameterValue=<subnet_id> \
|
||||||
|
--parameters ParameterKey=SubnetAZ,ParameterValue=<subnet_az> \
|
||||||
```
|
```
|
||||||
|
|
||||||
It will take a few minutes for the entire stack to come up. You can monitor the stack progress with the following command:
|
It will take a few minutes for the entire stack to come up. You can monitor the stack progress with the following command:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
aws cloudformation describe-stack-events --stack-name kubernetes
|
aws cloudformation describe-stack-events --stack-name kubernetes
|
||||||
```
|
```
|
||||||
|
|
||||||
> Record the Kubernetes Master IP address
|
Record the Kubernetes Master IP address:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
aws cloudformation describe-stacks --stack-name kubernetes
|
aws cloudformation describe-stacks --stack-name kubernetes
|
||||||
```
|
```
|
||||||
|
|
||||||
[Skip to kubectl client configuration](#configure-the-kubectl-ssh-tunnel)
|
[Skip to kubectl client configuration](#configure-the-kubectl-ssh-tunnel)
|
||||||
|
|
||||||
### Manually
|
### AWS CLI
|
||||||
|
|
||||||
The following commands shall use the latest CoreOS alpha AMI for the `us-west-2` region. For a list of different regions and corresponding AMI IDs see the [CoreOS EC2 cloud provider documentation](https://coreos.com/docs/running-coreos/cloud-providers/ec2/#choosing-a-channel).
|
The following commands shall use the latest CoreOS alpha AMI for the `us-west-2` region. For a list of different regions and corresponding AMI IDs see the [CoreOS EC2 cloud provider documentation](https://coreos.com/docs/running-coreos/cloud-providers/ec2/#choosing-a-channel).
|
||||||
|
|
||||||
#### Create the Kubernetes Security Group
|
#### Create the Kubernetes Security Group
|
||||||
|
|
||||||
```
|
```bash
|
||||||
aws ec2 create-security-group --group-name kubernetes --description "Kubernetes Security Group"
|
aws ec2 create-security-group --group-name kubernetes --description "Kubernetes Security Group"
|
||||||
aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 22 --cidr 0.0.0.0/0
|
aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 22 --cidr 0.0.0.0/0
|
||||||
aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 80 --cidr 0.0.0.0/0
|
aws ec2 authorize-security-group-ingress --group-name kubernetes --protocol tcp --port 80 --cidr 0.0.0.0/0
|
||||||
@ -64,19 +68,19 @@ aws ec2 authorize-security-group-ingress --group-name kubernetes --source-securi
|
|||||||
|
|
||||||
#### Launch the master
|
#### Launch the master
|
||||||
|
|
||||||
*Attention:* Replace ```<ami_image_id>``` below for a [suitable version of CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/#choosing-a-channel).
|
*Attention:* replace `<ami_image_id>` below for a [suitable version of CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/).
|
||||||
|
|
||||||
```
|
```bash
|
||||||
aws ec2 run-instances --image-id <ami_image_id> --key-name <keypair> \
|
aws ec2 run-instances --image-id <ami_image_id> --key-name <keypair> \
|
||||||
--region us-west-2 --security-groups kubernetes --instance-type m3.medium \
|
--region us-west-2 --security-groups kubernetes --instance-type m3.medium \
|
||||||
--user-data file://master.yaml
|
--user-data file://master.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
> Record the `InstanceId` for the master.
|
Record the `InstanceId` for the master.
|
||||||
|
|
||||||
Gather the public and private IPs for the master node:
|
Gather the public and private IPs for the master node:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
aws ec2 describe-instances --instance-id <instance-id>
|
aws ec2 describe-instances --instance-id <instance-id>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -103,9 +107,9 @@ Edit `node.yaml` and replace all instances of `<master-private-ip>` with the **p
|
|||||||
|
|
||||||
### Launch 3 worker nodes
|
### Launch 3 worker nodes
|
||||||
|
|
||||||
*Attention:* Replace ```<ami_image_id>``` below for a [suitable version of CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/#choosing-a-channel).
|
*Attention:* Replace `<ami_image_id>` below for a [suitable version of CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/#choosing-a-channel).
|
||||||
|
|
||||||
```
|
```bash
|
||||||
aws ec2 run-instances --count 3 --image-id <ami_image_id> --key-name <keypair> \
|
aws ec2 run-instances --count 3 --image-id <ami_image_id> --key-name <keypair> \
|
||||||
--region us-west-2 --security-groups kubernetes --instance-type m3.medium \
|
--region us-west-2 --security-groups kubernetes --instance-type m3.medium \
|
||||||
--user-data file://node.yaml
|
--user-data file://node.yaml
|
||||||
@ -113,9 +117,9 @@ aws ec2 run-instances --count 3 --image-id <ami_image_id> --key-name <keypair> \
|
|||||||
|
|
||||||
### Add additional worker nodes
|
### Add additional worker nodes
|
||||||
|
|
||||||
*Attention:* Replace ```<ami_image_id>``` below for a [suitable version of CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/#choosing-a-channel).
|
*Attention:* replace `<ami_image_id>` below for a [suitable version of CoreOS image for AWS](https://coreos.com/docs/running-coreos/cloud-providers/ec2/#choosing-a-channel).
|
||||||
|
|
||||||
```
|
```bash
|
||||||
aws ec2 run-instances --count 1 --image-id <ami_image_id> --key-name <keypair> \
|
aws ec2 run-instances --count 1 --image-id <ami_image_id> --key-name <keypair> \
|
||||||
--region us-west-2 --security-groups kubernetes --instance-type m3.medium \
|
--region us-west-2 --security-groups kubernetes --instance-type m3.medium \
|
||||||
--user-data file://node.yaml
|
--user-data file://node.yaml
|
||||||
@ -125,7 +129,7 @@ aws ec2 run-instances --count 1 --image-id <ami_image_id> --key-name <keypair> \
|
|||||||
|
|
||||||
This command enables secure communication between the kubectl client and the Kubernetes API.
|
This command enables secure communication between the kubectl client and the Kubernetes API.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
ssh -f -nNT -L 8080:127.0.0.1:8080 core@<master-public-ip>
|
ssh -f -nNT -L 8080:127.0.0.1:8080 core@<master-public-ip>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -133,7 +137,7 @@ ssh -f -nNT -L 8080:127.0.0.1:8080 core@<master-public-ip>
|
|||||||
|
|
||||||
Once the worker instances have fully booted, they will be automatically registered with the Kubernetes API server by the kube-register service running on the master node. It may take a few mins.
|
Once the worker instances have fully booted, they will be automatically registered with the Kubernetes API server by the kube-register service running on the master node. It may take a few mins.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
kubectl get nodes
|
kubectl get nodes
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -141,49 +145,47 @@ kubectl get nodes
|
|||||||
|
|
||||||
Create a pod manifest: `pod.json`
|
Create a pod manifest: `pod.json`
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"id": "hello",
|
"apiVersion": "v1beta3",
|
||||||
"kind": "Pod",
|
"kind": "Pod",
|
||||||
"apiVersion": "v1beta1",
|
"metadata": {
|
||||||
"desiredState": {
|
"name": "hello",
|
||||||
"manifest": {
|
"labels": {
|
||||||
"version": "v1beta1",
|
"name": "hello",
|
||||||
"id": "hello",
|
"environment": "testing"
|
||||||
"containers": [{
|
|
||||||
"name": "hello",
|
|
||||||
"image": "quay.io/kelseyhightower/hello",
|
|
||||||
"ports": [{
|
|
||||||
"containerPort": 80,
|
|
||||||
"hostPort": 80
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"labels": {
|
"spec": {
|
||||||
"name": "hello",
|
"containers": [{
|
||||||
"environment": "testing"
|
"name": "hello",
|
||||||
|
"image": "quay.io/kelseyhightower/hello",
|
||||||
|
"ports": [{
|
||||||
|
"containerPort": 80,
|
||||||
|
"hostPort": 80
|
||||||
|
}]
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Create the pod using the kubectl command line tool
|
### Create the pod using the kubectl command line tool
|
||||||
|
|
||||||
```
|
```bash
|
||||||
kubectl create -f pod.json
|
kubectl create -f pod.json
|
||||||
```
|
```
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
|
|
||||||
```
|
```bash
|
||||||
kubectl get pods
|
kubectl get pods
|
||||||
```
|
```
|
||||||
|
|
||||||
> Record the **Host** of the pod, which should be the private IP address.
|
Record the **Host** of the pod, which should be the private IP address.
|
||||||
|
|
||||||
Gather the public IP address for the worker node.
|
Gather the public IP address for the worker node.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
aws ec2 describe-instances --filters 'Name=private-ip-address,Values=<host>'
|
aws ec2 describe-instances --filters 'Name=private-ip-address,Values=<host>'
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -207,6 +209,6 @@ Visit the public IP address in your browser to view the running pod.
|
|||||||
|
|
||||||
### Delete the pod
|
### Delete the pod
|
||||||
|
|
||||||
```
|
```bash
|
||||||
kubectl delete pods hello
|
kubectl delete pods hello
|
||||||
```
|
```
|
||||||
|
@ -1,38 +1,52 @@
|
|||||||
## Getting started on AWS
|
# Getting started on AWS EC2
|
||||||
|
|
||||||
### Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
1. You need an AWS account. Visit [http://aws.amazon.com](http://aws.amazon.com) to get started
|
1. You need an AWS account. Visit [http://aws.amazon.com](http://aws.amazon.com) to get started
|
||||||
2. Install and configure [AWS Command Line Interface](http://aws.amazon.com/cli)
|
2. Install and configure [AWS Command Line Interface](http://aws.amazon.com/cli)
|
||||||
3. You need an AWS [instance profile and role](http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html) with EC2 full access.
|
3. You need an AWS [instance profile and role](http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html) with EC2 full access.
|
||||||
|
|
||||||
### Cluster turnup
|
## Cluster turnup
|
||||||
|
### Supported procedure: `get-kube`
|
||||||
Using ```wget```
|
```bash
|
||||||
```sh
|
#Using wget
|
||||||
export KUBERNETES_PROVIDER=aws; wget -q -O - https://get.k8s.io | bash
|
export KUBERNETES_PROVIDER=aws; wget -q -O - https://get.k8s.io | bash
|
||||||
```
|
|
||||||
|
|
||||||
or if you prefer ```curl```
|
#Using cURL
|
||||||
|
|
||||||
```sh
|
|
||||||
export KUBERNETES_PROVIDER=aws; curl -sS https://get.k8s.io | bash
|
export KUBERNETES_PROVIDER=aws; curl -sS https://get.k8s.io | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: This script calls [cluster/kube-up.sh](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/cluster/kube-up.sh)
|
NOTE: This script calls [cluster/kube-up.sh](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/cluster/kube-up.sh)
|
||||||
which in turn calls [cluster/aws/util.sh](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/cluster/aws/util.sh)
|
which in turn calls [cluster/aws/util.sh](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/cluster/aws/util.sh)
|
||||||
using [cluster/aws/config-default.sh](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/cluster/aws/config-default.sh).
|
using [cluster/aws/config-default.sh](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/cluster/aws/config-default.sh).
|
||||||
By default, the script will provision a new VPC and a 4 node k8s cluster in us-west-2 (Oregon). It'll also try to create or reuse
|
|
||||||
a keypair called "kubernetes", and IAM profiles called "kubernetes-master" and "kubernetes-minion". If these already exist, make
|
|
||||||
sure you want them to be used here. You can override the variables defined in config-default.sh to change this behavior.
|
|
||||||
|
|
||||||
Once the cluster is up, it will print the ip address of your cluster, this process takes about 5 to 10 minutes.
|
This process takes about 5 to 10 minutes. Once the cluster is up, the IP addresses of your master and node(s) will be printed,
|
||||||
|
as well as information about the default services running in the cluster (monitoring, logging, dns). User credentials and security
|
||||||
|
tokens are written in `~/.kube/kubeconfig`, they will be necessary to use the CLI or the HTTP Basic Auth.
|
||||||
|
|
||||||
```
|
By default, the script will provision a new VPC and a 4 node k8s cluster in us-west-2a (Oregon) with `t2.micro` instances running on Ubuntu.
|
||||||
export KUBERNETES_MASTER=https://<ip-address>
|
You can override the variables defined in [config-default.sh](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/cluster/aws/config-default.sh) to change this behavior as follows:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export KUBE_AWS_ZONE=eu-west-1c
|
||||||
|
export NUM_MINIONS=2
|
||||||
|
export MINION_SIZE=m3.medium
|
||||||
|
export AWS_S3_REGION=eu-west-1
|
||||||
|
export AWS_S3_BUCKET=mycompany-kubernetes-artifacts
|
||||||
|
export INSTANCE_PREFIX=k8s
|
||||||
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
Copy the appropriate ```kubectl``` binary to somewhere in your ```PATH```, for example:
|
It will also try to create or reuse a keypair called "kubernetes", and IAM profiles called "kubernetes-master" and "kubernetes-minion".
|
||||||
|
If these already exist, make sure you want them to be used here.
|
||||||
|
|
||||||
|
### Alternatives
|
||||||
|
A contributed [example](aws-coreos.md) allows you to setup a Kubernetes cluster based on [CoreOS](http://www.coreos.com), either using
|
||||||
|
AWS CloudFormation or EC2 with user data (cloud-config).
|
||||||
|
|
||||||
|
## Getting started with your cluster
|
||||||
|
### Command line administration tool: `kubectl`
|
||||||
|
Copy the appropriate `kubectl` binary to any location defined in your `PATH` environment variable, for example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# OS X
|
# OS X
|
||||||
@ -42,24 +56,26 @@ sudo cp kubernetes/platforms/darwin/amd64/kubectl /usr/local/bin/kubectl
|
|||||||
sudo cp kubernetes/platforms/linux/amd64/kubectl /usr/local/bin/kubectl
|
sudo cp kubernetes/platforms/linux/amd64/kubectl /usr/local/bin/kubectl
|
||||||
```
|
```
|
||||||
|
|
||||||
|
An up-to-date documentation page for this tool is available here: [kubectl manual](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/kubectl.md)
|
||||||
|
|
||||||
### Getting started with your cluster
|
By default, `kubectl` will use the `kubeconfig` file generated during the cluster startup for authenticating against the API.
|
||||||
See [a simple nginx example](../../examples/simple-nginx.md) to try out your new cluster.
|
For more information, please read [kubeconfig files](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/kubeconfig-file.md)
|
||||||
|
|
||||||
For more complete applications, please look in the [examples directory](../../examples)
|
### Examples
|
||||||
|
See [a simple nginx example](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/examples/simple-nginx.md) to try out your new cluster.
|
||||||
|
|
||||||
|
The "Guestbook" application is another popular example to get started with Kubernetes: [guestbook example](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/guestbook)
|
||||||
|
|
||||||
|
For more complete applications, please look in the [examples directory](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/examples)
|
||||||
|
|
||||||
|
## Tearing down the cluster
|
||||||
|
Make sure the environment variables you used to provision your cluster are still exported, then call the following script inside the
|
||||||
|
`kubernetes` directory:
|
||||||
|
|
||||||
### Tearing down the cluster
|
|
||||||
```bash
|
```bash
|
||||||
cd kubernetes
|
|
||||||
cluster/kube-down.sh
|
cluster/kube-down.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### Running examples
|
## Further reading
|
||||||
|
Please see the [Kubernetes docs](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/docs) for more details on administering
|
||||||
Take a look at [next steps](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/guestbook)
|
and using a Kubernetes cluster.
|
||||||
|
|
||||||
### Cloud Formation [optional]
|
|
||||||
There is a contributed [example](aws-coreos.md) from [CoreOS](http://www.coreos.com) using Cloud Formation.
|
|
||||||
|
|
||||||
### Further reading
|
|
||||||
Please see the [Kubernetes docs](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/docs) for more details on administering and using a Kubernetes cluster.
|
|
||||||
|
@ -100,7 +100,7 @@ coreos:
|
|||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kubectl
|
ExecStart=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kubectl
|
||||||
ExecStart=/usr/bin/chmod +x /opt/bin/kubectl
|
ExecStart=/usr/bin/chmod +x /opt/bin/kubectl
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=true
|
RemainAfterExit=true
|
||||||
@ -114,7 +114,7 @@ coreos:
|
|||||||
After=etcd2-waiter.service
|
After=etcd2-waiter.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kube-apiserver
|
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kube-apiserver
|
||||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver
|
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver
|
||||||
ExecStart=/opt/bin/kube-apiserver \
|
ExecStart=/opt/bin/kube-apiserver \
|
||||||
--insecure-bind-address=0.0.0.0 \
|
--insecure-bind-address=0.0.0.0 \
|
||||||
@ -132,7 +132,7 @@ coreos:
|
|||||||
After=kube-apiserver.service
|
After=kube-apiserver.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kube-controller-manager
|
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kube-controller-manager
|
||||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager
|
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager
|
||||||
ExecStart=/opt/bin/kube-controller-manager \
|
ExecStart=/opt/bin/kube-controller-manager \
|
||||||
--master=127.0.0.1:8080
|
--master=127.0.0.1:8080
|
||||||
@ -148,7 +148,7 @@ coreos:
|
|||||||
After=kube-apiserver.service
|
After=kube-apiserver.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kube-scheduler
|
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kube-scheduler
|
||||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-scheduler
|
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-scheduler
|
||||||
ExecStart=/opt/bin/kube-scheduler \
|
ExecStart=/opt/bin/kube-scheduler \
|
||||||
--master=127.0.0.1:8080
|
--master=127.0.0.1:8080
|
||||||
|
@ -48,7 +48,7 @@ coreos:
|
|||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kubelet
|
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kubelet
|
||||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet
|
ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet
|
||||||
# wait for kubernetes master to be up and ready
|
# wait for kubernetes master to be up and ready
|
||||||
ExecStartPre=/opt/bin/wupiao <master-private-ip> 8080
|
ExecStartPre=/opt/bin/wupiao <master-private-ip> 8080
|
||||||
@ -67,7 +67,7 @@ coreos:
|
|||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kube-proxy
|
ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kube-proxy
|
||||||
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy
|
ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy
|
||||||
# wait for kubernetes master to be up and ready
|
# wait for kubernetes master to be up and ready
|
||||||
ExecStartPre=/opt/bin/wupiao <master-private-ip> 8080
|
ExecStartPre=/opt/bin/wupiao <master-private-ip> 8080
|
||||||
|
@ -1,37 +1,37 @@
|
|||||||
{
|
{
|
||||||
"AWSTemplateFormatVersion": "2010-09-09",
|
"AWSTemplateFormatVersion": "2010-09-09",
|
||||||
"Description": "Kubernetes 0.16.1 on EC2 powered by CoreOS 668.2.0 (alpha)",
|
"Description": "Kubernetes 0.17.0 on EC2 powered by CoreOS 681.0.0 (alpha)",
|
||||||
"Mappings": {
|
"Mappings": {
|
||||||
"RegionMap": {
|
"RegionMap": {
|
||||||
"eu-central-1" : {
|
"eu-central-1" : {
|
||||||
"AMI" : "ami-5a330c47"
|
"AMI" : "ami-4c4f7151"
|
||||||
},
|
},
|
||||||
"ap-northeast-1" : {
|
"ap-northeast-1" : {
|
||||||
"AMI" : "ami-905c9f90"
|
"AMI" : "ami-3a35fd3a"
|
||||||
},
|
},
|
||||||
"us-gov-west-1" : {
|
"us-gov-west-1" : {
|
||||||
"AMI" : "ami-d1debff2"
|
"AMI" : "ami-57117174"
|
||||||
},
|
},
|
||||||
"sa-east-1" : {
|
"sa-east-1" : {
|
||||||
"AMI" : "ami-d365e1ce"
|
"AMI" : "ami-fbcc4ae6"
|
||||||
},
|
},
|
||||||
"ap-southeast-2" : {
|
"ap-southeast-2" : {
|
||||||
"AMI" : "ami-7db5c947"
|
"AMI" : "ami-593c4263"
|
||||||
},
|
},
|
||||||
"ap-southeast-1" : {
|
"ap-southeast-1" : {
|
||||||
"AMI" : "ami-06c8f454"
|
"AMI" : "ami-3a083668"
|
||||||
},
|
},
|
||||||
"us-east-1" : {
|
"us-east-1" : {
|
||||||
"AMI" : "ami-2cd3dc44"
|
"AMI" : "ami-40322028"
|
||||||
},
|
},
|
||||||
"us-west-2" : {
|
"us-west-2" : {
|
||||||
"AMI" : "ami-69447259"
|
"AMI" : "ami-23b58613"
|
||||||
},
|
},
|
||||||
"us-west-1" : {
|
"us-west-1" : {
|
||||||
"AMI" : "ami-d524c891"
|
"AMI" : "ami-15618f51"
|
||||||
},
|
},
|
||||||
"eu-west-1" : {
|
"eu-west-1" : {
|
||||||
"AMI" : "ami-c5b7d8b2"
|
"AMI" : "ami-8d1164fa"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -243,7 +243,7 @@
|
|||||||
" Requires=network-online.target\n",
|
" Requires=network-online.target\n",
|
||||||
" After=network-online.target\n\n",
|
" After=network-online.target\n\n",
|
||||||
" [Service]\n",
|
" [Service]\n",
|
||||||
" ExecStart=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kubectl\n",
|
" ExecStart=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kubectl\n",
|
||||||
" ExecStart=/usr/bin/chmod +x /opt/bin/kubectl\n",
|
" ExecStart=/usr/bin/chmod +x /opt/bin/kubectl\n",
|
||||||
" Type=oneshot\n",
|
" Type=oneshot\n",
|
||||||
" RemainAfterExit=true\n",
|
" RemainAfterExit=true\n",
|
||||||
@ -256,7 +256,7 @@
|
|||||||
" Requires=etcd2-waiter.service\n",
|
" Requires=etcd2-waiter.service\n",
|
||||||
" After=etcd2-waiter.service\n\n",
|
" After=etcd2-waiter.service\n\n",
|
||||||
" [Service]\n",
|
" [Service]\n",
|
||||||
" ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kube-apiserver\n",
|
" ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kube-apiserver\n",
|
||||||
" ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver\n",
|
" ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver\n",
|
||||||
" ExecStart=/opt/bin/kube-apiserver \\\n",
|
" ExecStart=/opt/bin/kube-apiserver \\\n",
|
||||||
" --insecure-bind-address=0.0.0.0 \\\n",
|
" --insecure-bind-address=0.0.0.0 \\\n",
|
||||||
@ -273,7 +273,7 @@
|
|||||||
" Requires=kube-apiserver.service\n",
|
" Requires=kube-apiserver.service\n",
|
||||||
" After=kube-apiserver.service\n\n",
|
" After=kube-apiserver.service\n\n",
|
||||||
" [Service]\n",
|
" [Service]\n",
|
||||||
" ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kube-controller-manager\n",
|
" ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kube-controller-manager\n",
|
||||||
" ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager\n",
|
" ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager\n",
|
||||||
" ExecStart=/opt/bin/kube-controller-manager \\\n",
|
" ExecStart=/opt/bin/kube-controller-manager \\\n",
|
||||||
" --master=127.0.0.1:8080\n",
|
" --master=127.0.0.1:8080\n",
|
||||||
@ -288,7 +288,7 @@
|
|||||||
" Requires=kube-apiserver.service\n",
|
" Requires=kube-apiserver.service\n",
|
||||||
" After=kube-apiserver.service\n\n",
|
" After=kube-apiserver.service\n\n",
|
||||||
" [Service]\n",
|
" [Service]\n",
|
||||||
" ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kube-scheduler\n",
|
" ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kube-scheduler\n",
|
||||||
" ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-scheduler\n",
|
" ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-scheduler\n",
|
||||||
" ExecStart=/opt/bin/kube-scheduler \\\n",
|
" ExecStart=/opt/bin/kube-scheduler \\\n",
|
||||||
" --master=127.0.0.1:8080\n",
|
" --master=127.0.0.1:8080\n",
|
||||||
@ -367,7 +367,7 @@
|
|||||||
" Requires=network-online.target\n",
|
" Requires=network-online.target\n",
|
||||||
" After=network-online.target\n\n",
|
" After=network-online.target\n\n",
|
||||||
" [Service]\n",
|
" [Service]\n",
|
||||||
" ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kubelet\n",
|
" ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kubelet\n",
|
||||||
" ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet\n",
|
" ExecStartPre=/usr/bin/chmod +x /opt/bin/kubelet\n",
|
||||||
" ExecStart=/opt/bin/kubelet \\\n",
|
" ExecStart=/opt/bin/kubelet \\\n",
|
||||||
" --api-servers=", {"Fn::GetAtt" :["KubernetesMasterInstance" , "PrivateIp"]}, ":8080 \\\n",
|
" --api-servers=", {"Fn::GetAtt" :["KubernetesMasterInstance" , "PrivateIp"]}, ":8080 \\\n",
|
||||||
@ -383,7 +383,7 @@
|
|||||||
" Requires=network-online.target\n",
|
" Requires=network-online.target\n",
|
||||||
" After=network-online.target\n\n",
|
" After=network-online.target\n\n",
|
||||||
" [Service]\n",
|
" [Service]\n",
|
||||||
" ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.16.1/bin/linux/amd64/kube-proxy\n",
|
" ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kube-proxy\n",
|
||||||
" ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy\n",
|
" ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-proxy\n",
|
||||||
" ExecStart=/opt/bin/kube-proxy \\\n",
|
" ExecStart=/opt/bin/kube-proxy \\\n",
|
||||||
" --master=http://", {"Fn::GetAtt" :["KubernetesMasterInstance" , "PrivateIp"]}, ":8080\n",
|
" --master=http://", {"Fn::GetAtt" :["KubernetesMasterInstance" , "PrivateIp"]}, ":8080\n",
|
||||||
|
@ -1,28 +1,21 @@
|
|||||||
# Install and configure kubectl
|
# Install and configure kubectl
|
||||||
|
|
||||||
## Download the kubectl CLI tool
|
## Download the kubectl CLI tool
|
||||||
|
```bash
|
||||||
### Darwin
|
### Darwin
|
||||||
|
wget https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/darwin/amd64/kubectl
|
||||||
```
|
|
||||||
wget https://storage.googleapis.com/kubernetes-release/release/v0.10.1/bin/darwin/amd64/kubectl
|
|
||||||
```
|
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
wget https://storage.googleapis.com/kubernetes-release/release/v0.17.0/bin/linux/amd64/kubectl
|
||||||
```
|
|
||||||
wget https://storage.googleapis.com/kubernetes-release/release/v0.10.1/bin/linux/amd64/kubectl
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Copy kubectl to your path
|
### Copy kubectl to your path
|
||||||
|
```bash
|
||||||
```
|
|
||||||
chmod +x kubectl
|
chmod +x kubectl
|
||||||
mv kubectl /usr/local/bin/
|
mv kubectl /usr/local/bin/
|
||||||
```
|
```
|
||||||
|
|
||||||
### Create a secure tunnel for API communication
|
### Create a secure tunnel for API communication
|
||||||
|
```bash
|
||||||
```
|
|
||||||
ssh -f -nNT -L 8080:127.0.0.1:8080 core@<master-public-ip>
|
ssh -f -nNT -L 8080:127.0.0.1:8080 core@<master-public-ip>
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user