Skip to content

Commit

Permalink
Merge pull request #9626 from FrankYang0529/fix/render-double-curly-b…
Browse files Browse the repository at this point in the history
…races

fix(docs): render double curly braces
  • Loading branch information
k8s-ci-robot authored Jul 24, 2020
2 parents a7023ce + 00325f5 commit 0bf5441
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
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

0 comments on commit 0bf5441

Please sign in to comment.