kops/cmd/kops
Kubernetes Submit Queue 10ce978b64 Merge pull request #3040 from mad01/templating
Automatic merge from submit-queue

MVP of templating 

MVP implementation of templating to generate cluster.yaml file: related to #2404 implementation is using the `text/template`

```bash
cat > values.yaml <<EOF
clusterName: eu1
kubernetesVersion: 1.7.1
dnsZone: k8s.example.com
awsRegion: eu-west-1
EOF
```

```bash
cat > cluster.tmpl.yaml <<EOF
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  labels:
	kops.k8s.io/cluster: {{.clusterName}}.{{.dnsZone}}
  name: nodes
spec:
  image: coreos.com/CoreOS-stable-1409.6.0-hvm
  machineType: m4.large
  maxPrice: "0.5"
  maxSize: 2
  minSize: 15
  role: Node
  rootVolumeSize: 100
  subnets:
  - {{.awsRegion}}a
  - {{.awsRegion}}b
  - {{.awsRegion}}c

EOF
```

running the templating command
```bash
  kops toolbox template \
      --values values.yaml \
      --template cluster.tmpl.yaml \
      --output cluster.yaml
```

output
```bash
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  labels:
	kops.k8s.io/cluster: eu1.k8s.example.com
  name: nodes
spec:
  image: coreos.com/CoreOS-stable-1409.6.0-hvm
  machineType: m4.large
  maxPrice: "0.5"
  maxSize: 2
  minSize: 15
  role: Node
  rootVolumeSize: 100
  subnets:
  - eu-west-1a
  - eu-west-1b
  - eu-west-1c
```
2017-08-04 09:26:41 -07:00
..
util Support generated clientset as alternative to vfs clientset 2017-06-20 22:29:37 -04:00
completion.go fixing bug with using shell flag 2017-06-30 13:03:45 -06:00
create.go Fix more instances where cluster could be nil 2017-07-23 23:39:57 -04:00
create_cluster.go Merge pull request #3026 from justinsb/repoint_pause_2 2017-07-22 19:01:31 -07:00
create_cluster_integration_test.go Create test for ssh-access 2017-07-22 01:45:03 -04:00
create_cluster_test.go go fmt fixes and apimachinery run 2017-02-22 09:51:18 -08:00
create_ig.go review doc on creating instance group 2017-07-06 16:02:21 +02:00
create_secret.go Incorporate review feedback 2017-08-01 13:15:19 -07:00
create_secret_dockerconfig.go Incorporate review feedback 2017-08-01 13:15:19 -07:00
create_secret_sshpublickey.go Work on cli documentation 2017-05-07 21:03:29 -06:00
create_secret_tls.go fixing more headers 2016-10-15 19:20:56 -06:00
createcluster_test.go Add --master-count flag, to make it easy to run masters in the same AZ 2017-01-31 01:11:06 -05:00
delete.go Fixing typo and grammar 2017-06-20 11:37:33 -06:00
delete_cluster.go Honor shared tags when deleting subnets/vpcs 2017-07-15 23:19:52 -04:00
delete_confirm_test.go Refactor delete commands 2017-01-21 13:47:07 -05:00
delete_instancegroup.go Support generated clientset as alternative to vfs clientset 2017-06-20 22:29:37 -04:00
delete_secret.go Work on cli documentation 2017-05-07 21:03:29 -06:00
describe.go Work on cli documentation 2017-05-07 21:03:29 -06:00
describe_secrets.go Work on cli documentation 2017-05-07 21:03:29 -06:00
edit.go fix "dederation" 2017-07-25 15:31:46 -04:00
edit_cluster.go Remap pause image through our AssetBuilder 2017-07-22 00:35:37 -04:00
edit_federation.go fix "dederation" 2017-07-25 15:33:36 -04:00
edit_instancegroup.go Remap pause image through our AssetBuilder 2017-07-22 00:35:37 -04:00
editor.go fixing more headers 2016-10-15 19:20:56 -06:00
export.go Work on cli documentation 2017-05-07 21:03:29 -06:00
export_kubecfg.go Work on cli documentation 2017-05-07 21:03:29 -06:00
gen_help_docs.go Try adding header to generated CLI docs 2017-07-15 13:14:21 -04:00
get.go Support generated clientset as alternative to vfs clientset 2017-06-20 22:29:37 -04:00
get_cluster.go adding warning about --full 2017-07-15 11:16:59 -06:00
get_federation.go Support generated clientset as alternative to vfs clientset 2017-06-20 22:29:37 -04:00
get_instancegroups.go Avoid panic when cluster not found 2017-07-23 23:21:50 -04:00
get_secrets.go Cleanup get command 2017-05-18 14:22:02 -04:00
import.go Work on cli documentation 2017-05-07 21:03:29 -06:00
import_cluster.go Support generated clientset as alternative to vfs clientset 2017-06-20 22:29:37 -04:00
integration_test.go Updates to fix unit tests 2017-07-08 18:46:01 -04:00
main.go Revert "Revert "Load protokube from http/https"" 2017-01-04 09:32:24 -08:00
pkix.go fixing more headers 2016-10-15 19:20:56 -06:00
replace.go Fix more instances where cluster could be nil 2017-07-23 23:39:57 -04:00
rollingupdate.go Work on cli documentation 2017-05-07 21:03:29 -06:00
rollingupdatecluster.go Fix for the instructions about using KOPS_FEATURE_FLAGS for drain and validate. 2017-07-20 16:19:24 +02:00
root.go Code changes for 1.7 2017-07-02 13:10:28 -04:00
status_discovery.go Use LB IP address for private dns 2017-04-25 01:32:27 -04:00
toolbox.go MPV implementation of templating to generate cluster.yaml file: related to #2404 2017-07-25 10:23:59 +02:00
toolbox_convert_imported.go Fix more instances where cluster could be nil 2017-07-23 23:39:57 -04:00
toolbox_dump.go Support generated clientset as alternative to vfs clientset 2017-06-20 22:29:37 -04:00
toolbox_template.go change template func to take out io.Writer from function not directly use os.Stdout 2017-07-26 11:19:25 +02:00
update.go Work on cli documentation 2017-05-07 21:03:29 -06:00
update_cluster.go Wiring up lifecycle 2017-07-15 22:03:54 -04:00
update_federation.go Fix typos in docs 2017-07-14 19:52:51 +01:00
upgrade.go Fix typos in upgrade cluster docs 2017-07-04 00:50:47 +02:00
upgrade_cluster.go Remap pause image through our AssetBuilder 2017-07-22 00:35:37 -04:00
validate.go Work on cli documentation 2017-05-07 21:03:29 -06:00
validate_cluster.go Support generated clientset as alternative to vfs clientset 2017-06-20 22:29:37 -04:00
version.go Work on cli documentation 2017-05-07 21:03:29 -06:00