talos/pkg/userdata/generate/controlplane.go
Seán C McCord ae77d6e053 fix: format IPv6 host entries properly
This reworks a bunch of the formatting for the userdata generation to
output a cleaner talos config when using IPv6 masters and `osctl config
generate`.

Please note that this changes the scope of concern for master indexing,
keeping `osctl` blissfully unaware of the master-reference chaining.
All it does is report the index of the master it is trying to generate.
The generator itself handles the reference chaining.

Fixes #916, fixes #917, and fixes #918

Signed-off-by: Seán C McCord <ulexus@gmail.com>
2019-08-12 11:35:38 -07:00

42 lines
1.1 KiB
Go

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package generate
const controlPlaneTempl = `#!talos
version: ""
security:
os:
ca:
crt: "{{ .Certs.OsCert }}"
key: "{{ .Certs.OsKey }}"
kubernetes:
ca:
crt: "{{ .Certs.K8sCert }}"
key: "{{ .Certs.K8sKey }}"
services:
init:
cni: flannel
kubeadm:
certificateKey: '{{ .KubeadmTokens.CertKey }}'
configuration: |
apiVersion: kubeadm.k8s.io/v1beta1
kind: JoinConfiguration
controlPlane: {}
discovery:
bootstrapToken:
token: '{{ .KubeadmTokens.BootstrapToken }}'
unsafeSkipCAVerification: true
apiServerEndpoint: "{{ .GetControlPlaneEndpoint "6443" }}"
nodeRegistration:
taints: []
kubeletExtraArgs:
node-labels: ""
feature-gates: ExperimentalCriticalPodAnnotation=true
trustd:
token: '{{ .TrustdInfo.Token }}'
endpoints: [ {{ .Endpoints }} ]
certSANs: [ "{{ .IP }}" ]
`