mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 19:52:42 +00:00
Clean up READMEs and broken stuff.
Move all support for clouds that are broken with this change into an `icebox` directory. We'll move that stuff back out as we fix it up.
This commit is contained in:
@@ -7,55 +7,63 @@ The example below creates a Kubernetes cluster with 4 worker node Virtual Machin
|
||||
1. You need a Google Cloud Platform account with billing enabled. Visit
|
||||
[http://cloud.google.com/console](http://cloud.google.com/console) for more details.
|
||||
2. Make sure you can start up a GCE VM. At least make sure you can do the [Create an instance](https://developers.google.com/compute/docs/quickstart#addvm) part of the GCE Quickstart.
|
||||
3. Make sure you can ssh into the VM without interactive prompts. You'll need to set up a ssh key and expose port 22 in the firewall if you choose to use a network other than the default network (`gcutil addfirewall --description "SSH allowed from anywhere" --allowed=tcp:22 default-ssh`)
|
||||
4. You need to have the Google Cloud Storage API, and the Google Cloud Storage JSON API enabled.
|
||||
3. Make sure you can ssh into the VM without interactive prompts.
|
||||
* Your GCE SSH key must either have no passcode or you need to be using `ssh-agent`.
|
||||
* Ensure the GCE firewall isn't blocking port 22 to your VMs. By default, this should work but if you have edited firewall rules or created a new non-default network, you'll need to expose it: `gcutil addfirewall --network=<network-name> --description "SSH allowed from anywhere" --allowed=tcp:22 default-ssh`
|
||||
4. You need to have the Google Cloud Storage API, and the Google Cloud Storage JSON API enabled. This can be done in the Google Cloud Console.
|
||||
|
||||
|
||||
### Prerequisites for your workstation
|
||||
|
||||
1. You must have Go (version 1.2 or later) installed: [www.golang.org](http://www.golang.org).
|
||||
2. You must have the [`gcloud` components](https://developers.google.com/cloud/sdk/) installed.
|
||||
1. Be running a Linux or Mac OS X.
|
||||
2. You must have the [Google Cloud SDK](https://developers.google.com/cloud/sdk/) installed. This will get you `gcloud`, `gcutil` and `gsutil`.
|
||||
3. Ensure that your `gcloud` components are up-to-date by running `gcloud components update`.
|
||||
4. Install godep (optional, only required when modifying package dependencies). [Instructions here](https://github.com/GoogleCloudPlatform/kubernetes#installing-godep)
|
||||
5. Get the Kubernetes source:
|
||||
* Kubernetes 0.3 \[[.tar.gz](https://github.com/GoogleCloudPlatform/kubernetes/archive/v0.3.tar.gz)\] \[[.zip](https://github.com/GoogleCloudPlatform/kubernetes/archive/v0.3.zip)\]
|
||||
4. If you want to build your own release, you need to have [Docker
|
||||
installed](https://docs.docker.com/installation/). On Mac OS X you can use
|
||||
boot2docker.
|
||||
5. Get or build a [binary release](binary_release.md)
|
||||
|
||||
### Setup
|
||||
### Starting a Cluster
|
||||
|
||||
The setup script builds Kubernetes, then creates Google Compute Engine instances, firewall rules, and routes:
|
||||
|
||||
```
|
||||
cd kubernetes
|
||||
hack/dev-build-and-up.sh
|
||||
```bash
|
||||
cluster/kube-up.sh
|
||||
```
|
||||
|
||||
The script above relies on Google Storage to deploy the software to instances running in GCE. It uses the Google Storage APIs so the "Google Cloud Storage JSON API" setting must be enabled for the project in the Google Developers Console (https://cloud.google.com/console#/project).
|
||||
The script above relies on Google Storage to stage the kuberntes release. It
|
||||
then will start (by default) a single master VM along with 4 worker VMs. You
|
||||
can tweak some of these parameters by editing `cluster/gce/config-default.sh`
|
||||
|
||||
The instances must also be able to connect to each other using their private IP. The script uses the "default" network which should have a firewall rule called "default-allow-internal" which allows traffic on any port on the private IPs.
|
||||
If this rule is missing from the default network or if you change the network being used in `cluster/config-default.sh` create a new rule with the following field values:
|
||||
* Source Ranges: 10.0.0.0/8
|
||||
* Allowed Protocols or Port: tcp:1-65535;udp:1-65535;icmp
|
||||
The instances must be able to connect to each other using their private IP. The
|
||||
script uses the "default" network which should have a firewall rule called
|
||||
"default-allow-internal" which allows traffic on any port on the private IPs.
|
||||
If this rule is missing from the default network or if you change the network
|
||||
being used in `cluster/config-default.sh` create a new rule with the following
|
||||
field values:
|
||||
|
||||
* Source Ranges: `10.0.0.0/8`
|
||||
* Allowed Protocols and Port: `tcp:1-65535;udp:1-65535;icmp`
|
||||
|
||||
### Running a container (simple version)
|
||||
|
||||
Once you have your instances up and running, the `build-go.sh` script sets up
|
||||
your Go workspace and builds the Go components.
|
||||
|
||||
The `kubecfg.sh` script spins up two containers, running [Nginx](http://nginx.org/en/) and with port 80 mapped to 8080:
|
||||
The `kubecfg.sh` line below spins up two containers running
|
||||
[Nginx](http://nginx.org/en/) with port 80 mapped to 8080:
|
||||
|
||||
```
|
||||
cd kubernetes
|
||||
hack/build-go.sh
|
||||
```bash
|
||||
cluster/kubecfg.sh -p 8080:80 run dockerfile/nginx 2 myNginx
|
||||
```
|
||||
|
||||
To stop the containers:
|
||||
```
|
||||
|
||||
```bash
|
||||
cluster/kubecfg.sh stop myNginx
|
||||
```
|
||||
|
||||
To delete the containers:
|
||||
```
|
||||
|
||||
```bash
|
||||
cluster/kubecfg.sh rm myNginx
|
||||
```
|
||||
|
||||
@@ -66,14 +74,14 @@ Assuming you've run `hack/dev-build-and-up.sh` and `hack/build-go.sh`, you
|
||||
can create a pod like this:
|
||||
|
||||
|
||||
```
|
||||
```bash
|
||||
cd kubernetes
|
||||
cluster/kubecfg.sh -c api/examples/pod.json create /pods
|
||||
```
|
||||
|
||||
Where pod.json contains something like:
|
||||
|
||||
```
|
||||
```json
|
||||
{
|
||||
"id": "php",
|
||||
"kind": "Pod",
|
||||
@@ -109,20 +117,20 @@ Where pod.json contains something like:
|
||||
|
||||
You can see your cluster's pods:
|
||||
|
||||
```
|
||||
```bash
|
||||
cluster/kubecfg.sh list pods
|
||||
```
|
||||
|
||||
and delete the pod you just created:
|
||||
|
||||
```
|
||||
```bash
|
||||
cluster/kubecfg.sh delete pods/php
|
||||
```
|
||||
|
||||
Look in `api/examples/` for more examples
|
||||
Look in `examples/` for more examples
|
||||
|
||||
### Tearing down the cluster
|
||||
```
|
||||
```bash
|
||||
cd kubernetes
|
||||
cluster/kube-down.sh
|
||||
```
|
||||
|
Reference in New Issue
Block a user