Skip to content

Commit

Permalink
Updating Manifest documentation
Browse files Browse the repository at this point in the history
Added table of contents to document.  Updated command to include using
dry-run for the creations of YAML.
  • Loading branch information
chrislovecnm committed Dec 30, 2017
1 parent 48c6ac1 commit 90386ae
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions docs/manifests_and_customizing_via_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

This document also applies to using the `kops` API to customize a Kubernetes cluster with or without using YAML or JSON.

## Table of Contents

* [Using A Manifest to Manage kops Clusters](#using-a-manifest-to-manage-kops-clusters)
* [Background](#background)
* [Exporting a Cluster](#exporting-a-cluster)
* [YAML Examples](#yaml-examples)
* [Further References](#further-references)
* [Cluster Spec](#cluster-spec)
* [Instance Groups](#instance-groups)
* [Closing Thoughts](#closing-thoughts)

## Background

> We like to think of it as `kubectl` for Clusters.
Expand Down Expand Up @@ -34,13 +45,9 @@ export KOPS_STATE_STORE=s3://example-state-store
--node-size m4.xlarge \
--kubernetes-version v1.6.6 \
--master-size m4.large \
--vpc vpc-6335dd1a
```

The next step is to export the configuration to a YAML document. `kops` has a command that allows the export in a single YAML document, but since JSON files need to separate documents, we only export YAML with a single command. You can export JSON with multiple commands.

```shell
kops get $NAME -o yaml > $NAME.yaml
--vpc vpc-6335dd1a \
--dry-run \
-o yaml > $NAME.yaml
```

The above command exports a YAML document which contains the definition of the cluster, `kind: Cluster`, and the definitions of the instance groups, `kind: InstanceGroup`.
Expand Down Expand Up @@ -224,14 +231,6 @@ spec:
- us-east-2c
```
Next, delete the cluster from the state store. (**Note:** An alternative to deleting and then creating again from the new manifest might be to replace with `kops replace -f $NAME.yaml`)

```console
kops delete -f $NAME.yaml
# validate that you want to remove the cluster
kops delete -f $NAME.yaml --yes
```

## YAML Examples
With the above YAML file, a user can add configurations that are not available via the command line. For instance, you can add a `MaxPrice` value to a new instance group and use spot instances. Also add node and cloud labels for the new instance group.
Expand Down

0 comments on commit 90386ae

Please sign in to comment.