Skip to content
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

fix(docs): render double curly braces #9626

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/development/adding_a_feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ one file per range of Kubernetes versions. These files are referenced by upup/pk
First we add to the `cilium-config` ConfigMap:

```go
{{ with .Ipam }}
ipam: {{ . }}
{{ if eq . "eni" }}
{{ '{{ with .Ipam }}' }}
ipam: {{ '{{ . }}' }}
{{ '{{ if eq . "eni" }}' }}
enable-endpoint-routes: "true"
auto-create-cilium-node-resource: "true"
blacklist-conflicting-routes: "false"
{{ end }}
{{ end }}
{{ '{{ end }}' }}
{{ '{{ end }}' }}
```

Then we conditionally move cilium-operator to masters:

```go
{{ if eq .Ipam "eni" }}
{{ '{{ if eq .Ipam "eni" }}' }}
nodeSelector:
node-role.kubernetes.io/master: ""
tolerations:
Expand All @@ -84,7 +84,7 @@ Then we conditionally move cilium-operator to masters:
key: node.kubernetes.io/unreachable
operator: Exists
tolerationSeconds: 300
{{ end }}
{{ '{{ end }}' }}
```

## Configuring kubelet
Expand Down
26 changes: 13 additions & 13 deletions docs/operations/cluster_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
metadata:
labels:
kops.k8s.io/cluster: {{.clusterName}}.{{.dnsZone}}
kops.k8s.io/cluster: {{ '{{.clusterName}}.{{.dnsZone}}' }}
name: nodes
spec:
image: coreos.com/CoreOS-stable-1409.6.0-hvm
kubernetesVersion: {{.kubernetesVersion}
kubernetesVersion: {{ '{{.kubernetesVersion}}' }}
machineType: m4.large
maxPrice: "0.5"
maxSize: 20
minSize: 15
role: Node
rootVolumeSize: 100
subnets:
- {{.awsRegion}}a
- {{.awsRegion}}b
- {{.awsRegion}}c
- {{ '{{.awsRegion}}' }}a
- {{ '{{.awsRegion}}' }}b
- {{ '{{.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 be 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 can override.
Expand Down Expand Up @@ -108,26 +108,26 @@ The example below assumes you have placed the appropriate files i.e. *(nodes.jso
apiVersion: kops.k8s.io/v1alpha2
kind: Cluster
metadata:
name: {{ .environment }}.{{ .dns_zone }}
name: {{ '{{ .environment }}.{{ .dns_zone }}' }}
spec:
docker:
{{ include "docker" . | indent 4 }}
{{ '{{ include "docker" . | indent 4 }}' }}
additionalPolicies:
master: |
{{ include "masters.json" . | indent 6 }}
{{ '{{ include "masters.json" . | indent 6 }}' }}
node: |
{{ include "nodes.json" . | indent 6 }}
{{ '{{ include "nodes.json" . | indent 6 }}' }}
```

### Template Functions

The entire set of https://github.com/Masterminds/sprig functions are available within the templates for you. Note if you want to use the 'defaults' functions switch off the verification check on the command line by `--fail-on-missing=false`;

```YAML
image: {{ default $image $node.image }}
machineType: {{ default $instance $node.machine_type }}
maxSize: {{ default "10" $node.max_size }}
minSize: {{ default "1" $node.min_size }}
image: {{ '{{ default $image $node.image }}' }}
machineType: {{ '{{ default $instance $node.machine_type }}' }}
maxSize: {{ '{{ default "10" $node.max_size }}' }}
minSize: {{ '{{ default "1" $node.min_size }}' }}
```

### Formatting
Expand Down