You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ launching a Kubernetes cluster hosted on AWS.
39
39
* Ability to generate configuration files for AWS [CloudFormation](https://aws.amazon.com/cloudformation/) and Terraform [Terraform configuration](/docs/terraform.md)
Copy file name to clipboardexpand all lines: docs/arguments.md
+8-4
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,6 @@
1
-
# Detailed description of arguments
1
+
# Detailed description of a few selected arguments
2
+
3
+
This list is not the full list, but a few arguments that where choosen.
2
4
3
5
## admin-access
4
6
@@ -24,7 +26,7 @@ See the docs in [cluster_spec.md#adminaccess](cluster_spec.md#adminaccess)
24
26
`dns-zone` controls the Route53 hosted zone in which DNS records will be created. It can either by the name
25
27
of the hosted zone (`example.com`), or it can be the ID of the hosted zone (`Z1GABCD1ABC2DEF`)
26
28
27
-
Suppose you're creating a cluster named "dev.kubernetes.example.com`:
29
+
Suppose you are creating a cluster named "dev.kubernetes.example.com`:
28
30
29
31
* You can specify a `--dns-zone=example.com` (you can have subdomains in a hosted zone)
30
32
* You could also use `--dns-zone=kubernetes.example.com`
@@ -63,9 +65,9 @@ Values:
63
65
64
66
`out` determines the directory into which kubectl will write the target output. It defaults to `out/terraform`
65
67
66
-
# YAML-only Arguments
68
+
# API only Arguments
67
69
68
-
Certain arguments can only be passed via YAML, eg, `kops edit cluster`. The following documents some of the more interesting or lesser-known options.
70
+
Certain arguments can only be passed via the API, eg, `kops edit cluster`. The following documents some of the more interesting or lesser-known options.
69
71
70
72
## kubeletPreferredAddressTypes
71
73
@@ -79,3 +81,5 @@ kubeAPIServer:
79
81
- InternalIP
80
82
- ExternalIP
81
83
```
84
+
85
+
More information about using YAML is available [here](manifests_and_customizing_via_api.md).
Copy file name to clipboardexpand all lines: docs/cluster_spec.md
+32-3
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,9 @@
1
1
# Description of Keys in `config` and `cluster.spec`
2
2
3
-
This list is not complete, but aims to document any keys that are less than self-explanatory.
3
+
This list is not complete but aims to document any keys that are less than self-explanatory. Our [godoc](https://godoc.org/k8s.io/kops/pkg/apis/kops) reference provides a more detailed list of API values. [ClusterSpec](https://godoc.org/k8s.io/kops/pkg/apis/kops#ClusterSpec), defined as `kind: Cluster` in YAML, and [InstanceGroup](https://godoc.org/k8s.io/kops/pkg/apis/kops#InstanceGroup), defined as `kind: InstanceGroup` in YAML, are the two top-level API values used to describe a cluster.
4
4
5
5
## spec
6
6
7
-
8
7
### api
9
8
10
9
This object configures how we expose the API:
@@ -159,9 +158,39 @@ Will result in the flag `--feature-gates=ExperimentalCriticalPodAnnotation=true,
159
158
160
159
### networkID
161
160
162
-
On AWS, this is the id of the VPC the cluster is created in. If creating a cluster from scratch, this field doesn't need to be specified at create time; `kops` will create a `VPC` for you.
161
+
On AWS, this is the id of the VPC the cluster is created in. If creating a cluster from scratch, this field does not need to be specified at create time; `kops` will create a `VPC` for you.
163
162
164
163
```yaml
165
164
spec:
166
165
networkID: vpc-abcdefg1
167
166
```
167
+
168
+
More information about running in an existing VPC is [here](run_in_existing_vpc.md).
169
+
170
+
### hooks
171
+
172
+
Hooks allow the execution of a container before the installation of Kubneretes on every node in a cluster. For intance you can install nvidia drivers for using GPUs.
KOPS operates off of a config spec file that is generated during the create phase. It is uploaded to the amazon s3 bucket that is passed in during create.
3
4
4
5
If you download the config spec file on a running cluster that is configured the way you like it, you can just pass that config spec file in to the create command and have kops create the cluster for you , `kops create -f spec_file` in a completely unattended manor.
5
6
6
-
## How to download the config spec file. ( 2 possible ways )
7
-
8
-
Let's say you create your cluster with the following configuration options:
7
+
Let us say you create your cluster with the following configuration options:
9
8
10
9
```
11
-
declare -x KOPS_STATE_STORE=s3://k8s-us-west
12
-
declare -x CLOUD=aws
13
-
declare -x ZONE="us-west-1a"
14
-
declare -x MASTER_ZONES="us-west-1a"
15
-
declare -x NAME=westtest.c.foo.com
16
-
declare -x K8S_VERSION=1.4.6
17
-
declare -x NETWORKCIDER="10.240.0.0/16"
18
-
declare -x MASTER_SIZE="t2.medium"
19
-
declare -x WORKER_SIZE="t2.large"
10
+
export KOPS_STATE_STORE=s3://k8s-us-west
11
+
export CLOUD=aws
12
+
export ZONE="us-west-1a"
13
+
export MASTER_ZONES="us-west-1a"
14
+
export NAME=k8s.example.com
15
+
export K8S_VERSION=1.6.4
16
+
export NETWORKCIDER="10.240.0.0/16"
17
+
export MASTER_SIZE="m3.large"
18
+
export WORKER_SIZE="m4.large"
20
19
```
21
20
Next you call the kops command to create the cluster in your terminal:
You can simply use the kops command `kops get cluster -o yaml > a_fun_name_you_will_remember.yml`
38
+
You can simply use the kops command `kops get --name $NAME -o yaml > a_fun_name_you_will_remember.yml`
40
39
41
-
Note: for the above command to work the cluster NAME and the KOPS_STATE_STORE will have to be exported in your environment.
40
+
Note: for the above command to work the cluster NAME and the KOPS_STATE_STORE will have to be exported in your environment.
42
41
43
-
### Method Two - Manual method directly from s3
42
+
For more information on how to use and modify the configurations see (here)[manifests_and_customizing_via_api.md].
44
43
45
-
Your spec file will be located in your s3 bucket, in the location `s3://k8s-us-west/$NAME/config`. Using the above as an example the config file is located at `s3://k8s-us-west/westtest.c.foo.com/config`
44
+
## Managing instance groups
46
45
47
-
To download this file via the aws cli you can use the aws s3 copy command. Using the above cluster as an example the command would be
You can also manage instance groups in seperate YAML files as well. The command `kops get --name $NAME -o yaml > $NAME.yml` exports the entire clsuter. An option is to have a YAML file for the cluster, and individual YAML files for the instance groups. This allows you to do stuff like:
50
47
48
+
```shell
49
+
if! kops get cluster --name "$NAME";then
50
+
kops create -f "kops/$CLUSTER/$REGION.yaml"
51
+
else
52
+
kops replace -f "kops/$CLUSTER/$REGION.yaml"
53
+
fi
51
54
55
+
forigin kops/$CLUSTER/instancegroup/*;do
56
+
if! kops get ig --name "$NAME""$(basename "$ig")";then
0 commit comments