Skip to content

Commit

Permalink
remove etcd.deploy.headlessService.enabled field
Browse files Browse the repository at this point in the history
  • Loading branch information
neogopher committed Nov 27, 2024
1 parent 1bf4fc7 commit a75c712
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 17 deletions.
2 changes: 0 additions & 2 deletions chart/templates/etcd-headless-service.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{- if not .Values.experimental.isolatedControlPlane.headless }}
{{- if or .Values.controlPlane.backingStore.etcd.deploy.enabled (include "vcluster.etcd.embedded.migrate" .) }}
{{- if .Values.controlPlane.backingStore.etcd.deploy.headlessService.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -33,4 +32,3 @@ spec:
release: "{{ .Release.Name }}"
{{- end }}
{{- end }}
{{- end }}
4 changes: 0 additions & 4 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1022,10 +1022,6 @@
},
"EtcdDeployHeadlessService": {
"properties": {
"enabled": {
"type": "boolean",
"description": "Enabled defines if the etcd headless service should be deployed"
},
"annotations": {
"additionalProperties": {
"type": "string"
Expand Down
1 change: 0 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ controlPlane:
annotations: {}
# HeadlessService holds options for the external etcd headless service.
headlessService:
enabled: true
annotations: {}

# Proxy defines options for the virtual cluster control plane proxy that is used to do authentication and intercept requests.
Expand Down
3 changes: 0 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,9 +958,6 @@ type EtcdDeployService struct {
}

type EtcdDeployHeadlessService struct {
// Enabled defines if the etcd headless service should be deployed
Enabled bool `json:"enabled,omitempty"`

// Annotations are extra annotations for the external etcd headless service
Annotations map[string]string `json:"annotations,omitempty"`
}
Expand Down
1 change: 0 additions & 1 deletion config/legacyconfig/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ func convertEtcd(oldConfig EtcdValues, newConfig *config.Config) error {
if oldConfig.Disabled {
newConfig.ControlPlane.BackingStore.Etcd.Deploy.StatefulSet.Enabled = false
newConfig.ControlPlane.BackingStore.Etcd.Deploy.Service.Enabled = false
newConfig.ControlPlane.BackingStore.Etcd.Deploy.HeadlessService.Enabled = false
}
if oldConfig.ImagePullPolicy != "" {
newConfig.ControlPlane.BackingStore.Etcd.Deploy.StatefulSet.ImagePullPolicy = oldConfig.ImagePullPolicy
Expand Down
1 change: 0 additions & 1 deletion config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ controlPlane:
enabled: true
annotations: {}
headlessService:
enabled: true
annotations: {}

proxy:
Expand Down
4 changes: 2 additions & 2 deletions pkg/k0s/k0s.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:
externalCluster:
{{- if .Values.controlPlane.backingStore.etcd.deploy.service.enabled }}
endpoints: ["{{ .Release.Name }}-etcd:2379"]
{{- else if .Values.controlPlane.backingStore.etcd.deploy.headlessService.enabled }}
{{- else }}
endpoints: ["{{ .Release.Name }}-etcd-headless:2379"]
{{- end }}
caFile: /data/k0s/pki/etcd/ca.crt
Expand Down Expand Up @@ -103,7 +103,7 @@ func StartK0S(ctx context.Context, cancel context.CancelFunc, vConfig *config.Vi
var etcdEndpoint string
if vConfig.ControlPlane.BackingStore.Etcd.Deploy.Service.Enabled {
etcdEndpoint = "https://" + vConfig.Name + "-etcd:2379"
} else if vConfig.ControlPlane.BackingStore.Etcd.Deploy.HeadlessService.Enabled {
} else {
etcdEndpoint = "https://" + vConfig.Name + "-etcd-headless:2379"
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/k3s/k3s.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func StartK3S(ctx context.Context, vConfig *config.VirtualClusterConfig, service
var etcdEndpoint string
if vConfig.ControlPlane.BackingStore.Etcd.Deploy.Service.Enabled {
etcdEndpoint = "https://" + vConfig.Name + "-etcd:2379"
} else if vConfig.ControlPlane.BackingStore.Etcd.Deploy.HeadlessService.Enabled {
} else {
etcdEndpoint = "https://" + vConfig.Name + "-etcd-headless:2379"
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/k8s/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func StartK8S(
etcdEndpoints = "https://127.0.0.1:2379"
} else if vConfig.ControlPlane.BackingStore.Etcd.Deploy.Service.Enabled {
etcdEndpoints = "https://" + vConfig.Name + "-etcd:2379"
} else if vConfig.ControlPlane.BackingStore.Etcd.Deploy.HeadlessService.Enabled {
} else {
etcdEndpoints = "https://" + vConfig.Name + "-etcd-headless:2379"
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/setup/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func initialize(ctx context.Context, parentCtx context.Context, options *config.
if options.ControlPlane.BackingStore.Etcd.Embedded.Enabled && options.ControlPlane.BackingStore.Etcd.Embedded.MigrateFromDeployedEtcd {
if options.ControlPlane.BackingStore.Etcd.Deploy.Service.Enabled {
migrateFrom = "https://" + options.Name + "-etcd:2379"
} else if options.ControlPlane.BackingStore.Etcd.Deploy.HeadlessService.Enabled {
} else {
migrateFrom = "https://" + options.Name + "-etcd-headless:2379"
}
}
Expand Down

0 comments on commit a75c712

Please sign in to comment.