Skip to content

Commit fef9989

Browse files
charlie-haleysmira
authored andcommitted
chore: pin kubernetes version to talosctl gen config
Pin talos default k8s version to `talosctl gen config` Signed-off-by: Charlie Haley <[email protected]> Signed-off-by: Andrey Smirnov <[email protected]>
1 parent bcf9281 commit fef9989

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎cmd/talosctl/cmd/mgmt/cluster/create.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ func init() {
838838
createCmd.Flags().DurationVar(&clusterWaitTimeout, "wait-timeout", 20*time.Minute, "timeout to wait for the cluster to be ready")
839839
createCmd.Flags().BoolVar(&forceInitNodeAsEndpoint, "init-node-as-endpoint", false, "use init node as endpoint instead of any load balancer endpoint")
840840
createCmd.Flags().StringVar(&forceEndpoint, "endpoint", "", "use endpoint instead of provider defaults")
841-
createCmd.Flags().StringVar(&kubernetesVersion, "kubernetes-version", "", fmt.Sprintf("desired kubernetes version to run (default %q)", constants.DefaultKubernetesVersion))
841+
createCmd.Flags().StringVar(&kubernetesVersion, "kubernetes-version", constants.DefaultKubernetesVersion, "desired kubernetes version to run")
842842
createCmd.Flags().StringVarP(&inputDir, "input-dir", "i", "", "location of pre-generated config files")
843843
createCmd.Flags().StringSliceVar(&cniBinPath, "cni-bin-path", []string{filepath.Join(defaultCNIDir, "bin")}, "search path for CNI binaries (VM only)")
844844
createCmd.Flags().StringVar(&cniConfDir, "cni-conf-dir", filepath.Join(defaultCNIDir, "conf.d"), "CNI config directory path (VM only)")

‎cmd/talosctl/cmd/mgmt/config.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func init() {
272272
genConfigCmd.Flags().StringVar(&genConfigCmdFlags.dnsDomain, "dns-domain", "cluster.local", "the dns domain to use for cluster")
273273
genConfigCmd.Flags().StringVar(&genConfigCmdFlags.configVersion, "version", "v1alpha1", "the desired machine config version to generate")
274274
genConfigCmd.Flags().StringVar(&genConfigCmdFlags.talosVersion, "talos-version", "", "the desired Talos version to generate config for (backwards compatibility, e.g. v0.8)")
275-
genConfigCmd.Flags().StringVar(&genConfigCmdFlags.kubernetesVersion, "kubernetes-version", "", "desired kubernetes version to run")
275+
genConfigCmd.Flags().StringVar(&genConfigCmdFlags.kubernetesVersion, "kubernetes-version", constants.DefaultKubernetesVersion, "desired kubernetes version to run")
276276
genConfigCmd.Flags().StringVarP(&genConfigCmdFlags.outputDir, "output-dir", "o", "", "destination to output generated files")
277277
genConfigCmd.Flags().StringArrayVar(&genConfigCmdFlags.configPatch, "config-patch", nil, "patch generated machineconfigs (applied to all node types), use @file to read a patch from file")
278278
genConfigCmd.Flags().StringArrayVar(&genConfigCmdFlags.configPatchControlPlane, "config-patch-control-plane", nil, "patch generated machineconfigs (applied to 'init' and 'controlplane' types)")

‎hack/release.toml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ from files with `@file.json` syntax, and support loading from YAML format.
9696
Talos now accepts static pod definitions in the `.machine.pods` key of the machine configuration.
9797
Please note that static pod definitions are not validated by Talos.
9898
Static pod definitions can be updated without a node reboot.
99+
"""
100+
101+
[notes.k8sversion]
102+
title = "Pinned Kubernets Version"
103+
description="""\
104+
Command `talosctl gen config` now defaults to Kubernetes version pinning in the generate machine configuration.
105+
Previously default was to omit explicit Kubernetes version, so Talos picked up the default version it was built against.
106+
Old behavior can be achieved by specifiying empty flag value: `--kubernetes-version=`.
99107
"""
100108

101109
[make_deps]

‎website/content/docs/v0.15/Reference/cli.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ talosctl gen config <cluster name> <cluster endpoint> [flags]
10921092
-h, --help help for config
10931093
--install-disk string the disk to install to (default "/dev/sda")
10941094
--install-image string the image used to perform an installation (default "ghcr.io/talos-systems/installer:latest")
1095-
--kubernetes-version string desired kubernetes version to run
1095+
--kubernetes-version string desired kubernetes version to run (default "1.23.3")
10961096
-o, --output-dir string destination to output generated files
10971097
-p, --persist the desired persist value for configs (default true)
10981098
--registry-mirror strings list of registry mirrors to use in format: <registry host>=<mirror URL>

0 commit comments

Comments
 (0)