-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toolbox Templating Docs #3800
Toolbox Templating Docs #3800
Conversation
gambol99
commented
Nov 8, 2017
- adding additional documentation about the toolbox template command
@KashifSaadat if you can |
/assign @chrislovecnm |
docs/cluster_template.md
Outdated
@@ -30,6 +30,8 @@ spec: | |||
- {{.awsRegion}}c | |||
``` | |||
|
|||
You can pass configuration such as an environment file by using the `--values PATH` command line option. Note `--values` is a slice so can defined multiple times; the configuration is overridden by each configuration file (so order is important assuming duplicating values); a use-case for this would be a default configuration which upstream clusters are override. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor corrections:
- Note
--values
is a slice so can be defined multiple times - a use-case for this would be a default configuration which upstream clusters can override.
docs/cluster_template.md
Outdated
|
||
### Formatting | ||
|
||
Formatting in golang templates is an pain! at the start or at the end of a statement can be infuriating to get right, so a `--format-yaml=true` *(defaults to false)* command line option has been added. This will first unmarshal the generated content *(performing a syntax verification)* and then marshal back the content removing all those nasty formatting issues, newlines etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicks:
- Formatting in golang templates is a pain! At the..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just little bits of rewording
LGTM!
- adding additional documentation about the toolbox template command
654053a
to
80c2bb9
Compare
@gambol99 / @KashifSaadat it is good to add the label retest-not-required-docs-only so that e2e does not have to run twice. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrislovecnm The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest |
/test pull-kops-e2e-kubernetes-aws |
Automatic merge from submit-queue. |
image: {{ default $image $node.image }} | ||
machineType: {{ default $instance $node.machine_type }} | ||
maxSize: {{ default "10" $node.max_size }} | ||
minSize: {{ default "1" $node.min_size }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to resurrect an old PR, but where does $node
come from in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arrh .. yes .. I probably shouldn't have included this .. It was a copy and paste from our deployment repo, where we using a common template for all instancegroup .. so our environment file would have something like
node_pools:
- name: compute
min_size: 2
- name: ingress
instance: t2.medium
{{- $base := . -}}
{{- $dns_zone := .dns_zone -}}
{{- $enable_bastion := .enable_bastion -}}
{{- $env := env "ENVIRONMENT" -}}
{{- $image := .coreos_version -}}
{{- $instance := .compute_size -}}
{{- $size := .compute_root -}}
{{- $subnets := .compute_subnets -}}
{{- range $index, $node := .node_pools -}}
{{- if $index }}
---
{{ end }}apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
labels:
kops.k8s.io/cluster: {{ $env }}.{{ $dns_zone }}
name: {{ $node.name }}
spec:
{{- if (and (eq $enable_bastion false) ($node.security_groups)) }}
additionalSecurityGroups:
{{- range $node.security_groups }}
- {{ . }}
{{- end }}
{{- end }}
cloudLabels:
{{- if or (not $node.cloud_labels) (not (hasKey $node.cloud_labels "role")) }}
role: {{ $node.name }}
{{- end }}
{{- if $node.cloud_labels }}
{{- range $name, $value := $node.cloud_labels }}
{{ $name }}: {{ $value }}
{{- end }}
{{- end }}
image: {{ default $image $node.image }}
machineType: {{ default $instance $node.machine_type }}
maxSize: {{ default "10" $node.max_size }}
minSize: {{ default "1" $node.min_size }}
nodeLabels:
{{- if or (not $node.node_labels) (not (hasKey $node.node_labels "role")) }}
role: {{ $node.name }}
{{- end }}
{{- if $node.node_labels }}
{{- range $name, $value := $node.node_labels }}
{{ $name }}: {{ $value }}
{{- end }}
{{- end }}
role: {{ default "Node" $node.role }}
rootVolumeSize: {{ default $size $node.root_size }}
subnets:
{{- $networks := default $subnets $node.subnets }}
{{- range $networks }}
{{- if typeIs "map[string]interface {}" . }}
- {{ .name }}
{{- else }}
- {{ . }}
{{- end }}
{{- end }}
{{- if $node.taints }}
taints:
{{- range $node.taints }}
- {{ .}}
{{- end }}
{{- end }}
{{- end }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it might be something like that, and that example was what I was after. Thanks for sharing!