Skip to content

Commit

Permalink
Use env var for all examples
Browse files Browse the repository at this point in the history
  • Loading branch information
elithrar committed Dec 28, 2018
1 parent 3d6b8a4 commit b79b0aa
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions docs/tutorial/gce.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ kops needs a state store, to hold the configuration for your clusters. The simp
for Google Cloud is to store it in a Google Cloud Storage bucket in the same account, so that's how we'll
start.

So, just create an empty bucket - you can use any name: `gsutil mb gs://kubernetes-clusters/`
So, just create an empty bucket - you can use any (available) name - e.g. `gsutil mb gs://kubernetes-clusters/`

Further, rather than typing the `--state` argument every time, it's much easier to export the `KOPS_STATE_STORE`
environment variable:

```
export KOPS_STATE_STORE=gs://kubernetes-clusters/
```

You can also put this in your `~/.bashrc` or similar.

# Creating our first cluster

Expand All @@ -26,12 +35,14 @@ So, just create an empty bucket - you can use any name: `gsutil mb gs://kubernet
```
PROJECT=`gcloud config get-value project`
export KOPS_FEATURE_FLAGS=AlphaAllowGCE # to unlock the GCE features
kops create cluster simple.k8s.local --zones us-central1-a --state gs://kubernetes-clusters/ --project=${PROJECT}
kops create cluster simple.k8s.local --zones us-central1-a --state ${KOPS_STATE_STORE}/ --project=${PROJECT}
```

You can now list the Cluster objects in your kops state store (the GCS bucket we created):
You can now list the Cluster objects in your kops state store (the GCS bucket
we created).

`kops get cluster --state gs://kubernetes-clusters/`
```
kops get cluster --state ${KOPS_STATE_STORE}
```
NAME CLOUD ZONES
Expand All @@ -49,7 +60,7 @@ objects on a kubernetes cluster.
You can see the details of your Cluster object by doing:
`> kops get cluster --state gs://kubernetes-clusters/ simple.k8s.local -oyaml`
`> kops get cluster --state ${KOPS_STATE_STORE}/ simple.k8s.local -oyaml`
```
apiVersion: kops/v1alpha2
kind: Cluster
Expand Down Expand Up @@ -99,7 +110,7 @@ spec:
Similarly, you can also see your InstanceGroups using:
`kops get instancegroup --state gs://kubernetes-clusters/ --name simple.k8s.local`
`kops get instancegroup --state ${KOPS_STATE_STORE}/ --name simple.k8s.local`
```
NAME ROLE MACHINETYPE MIN MAX SUBNETS
master-us-central1-a Master n1-standard-1 1 1 us-central1
Expand All @@ -116,17 +127,6 @@ and one for our nodes (and we have two nodes configured).
We'll see a lot more of Cluster objects and InstanceGroups as we use kops to reconfigure clusters. But let's get
on with our first cluster.
# Export KOPS_STATE_STORE

Rather than typing the `--state` argument every time, it's much easier to export the `KOPS_STATE_STORE`
environment variable:

```
export KOPS_STATE_STORE=gs://kubernetes-clusters/
```

You can also put this in your `~/.bashrc` or similar.

# Creating a cluster
`kops create cluster` created the Cluster object & InstanceGroup object in our state store,
Expand Down

0 comments on commit b79b0aa

Please sign in to comment.