talos/pkg/userdata/generate/talosconfig.go
Seán C McCord beecb70374 feat: Allow spec of canonical controlplane addr
Broke the binding between the discrete IP addresses of the control plane
elements and the ControlPlaneEndpoint.  This allows the specification of
a canonical controlplane address which may optionally be a DNS name.

Fixes #1131

Signed-off-by: Seán C McCord <ulexus@gmail.com>
2019-09-08 17:18:52 -07:00

20 lines
595 B
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
// Talosconfig returns the talos admin Talos config.
func Talosconfig(in *Input) (string, error) {
return renderTemplate(in, talosconfigTempl)
}
const talosconfigTempl = `context: {{ .ClusterName }}
contexts:
{{ .ClusterName }}:
target: "{{ .GetAPIServerEndpoint "" }}"
ca: {{ .Certs.OsCert }}
crt: {{ .Certs.AdminCert }}
key: {{ .Certs.AdminKey }}
`