Skip to content

Commit

Permalink
chore: Rename "APIServerSANs" -> "APIServerExtraSANs"
Browse files Browse the repository at this point in the history
  • Loading branch information
maksym-iv-elf committed Oct 8, 2024
1 parent e2cdf84 commit 5ff1b42
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/config/v1alpha4/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ type Networking struct {
//
// Defaults to 127.0.0.1
APIServerAddress string `yaml:"apiServerAddress,omitempty" json:"apiServerAddress,omitempty"`
// APIServerSANs is the list of additional SANs to add to the Kubernetes API server certificate
// APIServerExtraSANs is the list of additional SANs to add to the Kubernetes API server certificate
//
// Defaults to []
APIServerSANs []string `yaml:"apiServerSANs,omitempty" json:"apiServerSANs,omitempty"`
APIServerExtraSANs []string `yaml:"apiServerExtraSANs,omitempty" json:"apiServerExtraSANs,omitempty"`
// PodSubnet is the CIDR used for pod IPs
// kind will select a default if unspecified
PodSubnet string `yaml:"podSubnet,omitempty" json:"podSubnet,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/internal/create/actions/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (a *Action) Execute(ctx *actions.ActionContext) error {
ControlPlaneEndpoint: controlPlaneEndpoint,
APIBindPort: common.APIServerInternalPort,
APIServerAddress: ctx.Config.Networking.APIServerAddress,
APIServerSANs: ctx.Config.Networking.APIServerSANs,
APIServerExtraSANs: ctx.Config.Networking.APIServerExtraSANs,
Token: kubeadm.Token,
PodSubnet: ctx.Config.Networking.PodSubnet,
KubeProxyMode: string(ctx.Config.Networking.KubeProxyMode),
Expand Down
6 changes: 3 additions & 3 deletions pkg/cluster/internal/kubeadm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type ConfigData struct {
APIServerAddress string

// The API server SANs to add to the API Server certificates
APIServerSANs []string
APIServerExtraSANs []string

// this should really be used for the --provider-id flag
// ideally cluster config should not depend on the node backend otherwise ...
Expand Down Expand Up @@ -202,7 +202,7 @@ controlPlaneEndpoint: "{{ .ControlPlaneEndpoint }}"
# so we need to ensure the cert is valid for localhost so we can talk
# to the cluster after rewriting the kubeconfig to point to localhost
apiServer:
certSANs: [localhost, "{{.APIServerAddress}}", {{ range .APIServerSANs}}"{{.}}",{{end}}]
certSANs: [localhost, "{{.APIServerAddress}}", {{ range .APIServerExtraSANs}}"{{.}}",{{end}}]
extraArgs:
"runtime-config": "{{ .RuntimeConfigString }}"
{{ if .FeatureGates }}
Expand Down Expand Up @@ -345,7 +345,7 @@ controlPlaneEndpoint: "{{ .ControlPlaneEndpoint }}"
# so we need to ensure the cert is valid for localhost so we can talk
# to the cluster after rewriting the kubeconfig to point to localhost
apiServer:
certSANs: [localhost, "{{.APIServerAddress}}", {{ range .APIServerSANs}}"{{.}}",{{end}}]
certSANs: [localhost, "{{.APIServerAddress}}", {{ range .APIServerExtraSANs}}"{{.}}",{{end}}]
extraArgs:
"runtime-config": "{{ .RuntimeConfigString }}"
{{ if .FeatureGates }}
Expand Down
2 changes: 1 addition & 1 deletion pkg/internal/apis/config/convert_v1alpha4.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func convertv1alpha4Networking(in *v1alpha4.Networking, out *Networking) {
out.IPFamily = ClusterIPFamily(in.IPFamily)
out.APIServerPort = in.APIServerPort
out.APIServerAddress = in.APIServerAddress
out.APIServerSANs = in.APIServerSANs
out.APIServerExtraSANs = in.APIServerExtraSANs
out.PodSubnet = in.PodSubnet
out.KubeProxyMode = ProxyMode(in.KubeProxyMode)
out.ServiceSubnet = in.ServiceSubnet
Expand Down
4 changes: 2 additions & 2 deletions pkg/internal/apis/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ type Networking struct {
//
// Defaults to 127.0.0.1
APIServerAddress string
// APIServerSANs is the list of additional SANs to add to the Kubernetes API server certificate
// APIServerExtraSANs is the list of additional SANs to add to the Kubernetes API server certificate
//
// Defaults to []
APIServerSANs []string
APIServerExtraSANs []string
// PodSubnet is the CIDR used for pod IPs
// kind will select a default if unspecified
PodSubnet string
Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/user/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ to anything other than loopback.{{</ securitygoose >}}

##### API Server Cert SANs

The API Server certificate SANscan be customized with `apiServerSANs`:
The API Server certificate SANscan be customized with `apiServerExtraSANs`:
{{< codeFromInline lang="yaml" >}}
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
# WARNING: It is _strongly_ recommended that you keep this the default
# ([]) for security reasons. However it is possible to change this.
apiServerSANs: ["1.1.1.1"]
apiServerExtraSANs: ["1.1.1.1"]
{{< /codeFromInline >}}


Expand Down

0 comments on commit 5ff1b42

Please sign in to comment.