Skip to content

Commit

Permalink
Merge pull request #63 from timuthy/feature.cp-restart
Browse files Browse the repository at this point in the history
Allow Gardener to restart CCM & MCM
  • Loading branch information
rfranzke authored Mar 31, 2020
2 parents b3bbce5 + 91dd7a6 commit 82b4bab
Show file tree
Hide file tree
Showing 59 changed files with 866 additions and 131 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: cloud-controller-manager
namespace: {{ .Release.Namespace }}
labels:
app: kubernetes
role: cloud-controller-manager
spec:
type: ClusterIP
clusterIP: None
ports:
- name: metrics
port: {{ include "cloud-controller-manager.port" . }}
protocol: TCP
selector:
app: kubernetes
role: cloud-controller-manager
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
apiVersion: v1
kind: Service
metadata:
name: cloud-controller-manager
namespace: {{ .Release.Namespace }}
labels:
app: kubernetes
role: cloud-controller-manager
spec:
type: ClusterIP
clusterIP: None
ports:
- name: metrics
port: {{ include "cloud-controller-manager.port" . }}
protocol: TCP
selector:
app: kubernetes
role: cloud-controller-manager
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -47,6 +28,9 @@ spec:
networking.gardener.cloud/to-public-networks: allowed
networking.gardener.cloud/to-shoot-apiserver: allowed
networking.gardener.cloud/from-prometheus: allowed
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }}
{{- end }}
spec:
tolerations:
- effect: NoExecute
Expand Down
1 change: 1 addition & 0 deletions charts/internal/cloud-controller-manager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ clusterName: shoot-foo-bar
kubernetesVersion: 1.7.5
podNetwork: 192.168.0.0/16
podAnnotations: {}
podLabels: {}
featureGates: {}
# CustomResourceValidation: true
# RotateKubeletServerCertificate: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ spec:
networking.gardener.cloud/to-seed-apiserver: allowed
networking.gardener.cloud/to-shoot-apiserver: allowed
networking.gardener.cloud/from-prometheus: allowed
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }}
{{- end }}
spec:
serviceAccountName: machine-controller-manager
terminationGracePeriodSeconds: 5
Expand Down
2 changes: 2 additions & 0 deletions charts/internal/machine-controller-manager/seed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ replicas: 1

podAnnotations: {}

podLabels: {}

providerName: provider-foo

namespace:
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ require (
github.com/ahmetb/gen-crd-api-reference-docs v0.1.5
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f
github.com/gardener/etcd-druid v0.1.3
github.com/gardener/gardener v1.1.1-0.20200323102039-58593d8be86a
github.com/gardener/gardener v1.1.1-0.20200330051317-a326f96cf32b
github.com/gardener/gardener-extension-networking-calico v1.3.0
github.com/gardener/gardener-extensions v1.5.0
github.com/gardener/gardener-extensions v1.5.1-0.20200330101454-c65957bd80b5
github.com/gardener/machine-controller-manager v0.26.0
github.com/go-logr/logr v0.1.0
github.com/gobuffalo/packr/v2 v2.1.0
Expand Down
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,13 @@ github.com/gardener/etcd-druid v0.1.3/go.mod h1:/A8kSp7DSo7oOhsOhD9Se/xF6BOD9TQJ
github.com/gardener/external-dns-management v0.7.3 h1:SAW9ur2mjZ+x89xbmcplJgqNUmFGYIZLI2E+PaBhhG0=
github.com/gardener/external-dns-management v0.7.3/go.mod h1:Y3om11E865x4aQ7cmcHjknb8RMgCO153huRb/SvP+9o=
github.com/gardener/gardener v0.35.1-0.20200128130120-5b69a02f511a/go.mod h1:cu4WkHhpM9JLvqx76qSViagsPO4UH9Qx5i0h3AEIdiE=
github.com/gardener/gardener v1.1.1-0.20200311075931-7f7e52b986e7 h1:UD25lsw3fYBK7pUlXkGwUXmlpnksG9JbdwC75XZTBOQ=
github.com/gardener/gardener v1.1.1-0.20200311075931-7f7e52b986e7/go.mod h1:lGAx5NkFDWoC4hPIL+lHJamafBxmOt5MrHq9hGtp5VI=
github.com/gardener/gardener v1.1.1-0.20200323102039-58593d8be86a h1:TkMIvx1xRmd3xLuORXEqsQhpni49+wfuT4keC6d3Tsc=
github.com/gardener/gardener v1.1.1-0.20200323102039-58593d8be86a/go.mod h1:lGAx5NkFDWoC4hPIL+lHJamafBxmOt5MrHq9hGtp5VI=
github.com/gardener/gardener v1.1.1-0.20200330051317-a326f96cf32b h1:MkEDp9PdrZPkIAPGj6oNcKl0fBaOcJ1ddKsAA7bVWnI=
github.com/gardener/gardener v1.1.1-0.20200330051317-a326f96cf32b/go.mod h1:lGAx5NkFDWoC4hPIL+lHJamafBxmOt5MrHq9hGtp5VI=
github.com/gardener/gardener-extension-networking-calico v1.3.0 h1:pxztFZRvWR0ZOpifaJYVFPqE06RFMwZNe+tpz+KDSLs=
github.com/gardener/gardener-extension-networking-calico v1.3.0/go.mod h1:7SpCZoWGAV1EDCicfMI7NDwDY7cwmlZ69jTDDLSevKU=
github.com/gardener/gardener-extensions v1.3.0/go.mod h1:FoPT/v8gUT8BdufAAzGSMzJiiQvqr7+DMmippm1Mc9w=
github.com/gardener/gardener-extensions v1.5.0 h1:6JkU0/DV2bJvwkuPoP7/nPlyCrzPGKfw5j4f+wtXBeI=
github.com/gardener/gardener-extensions v1.5.0/go.mod h1:yCdFgMAz++ex3d1fmhN3Yti9MR9HN9iKTUjz5eI0uIQ=
github.com/gardener/gardener-extensions v1.5.1-0.20200330101454-c65957bd80b5 h1:zDXG4369jfXvZlPNQe4YX38VA0h5SDq2xk8dqLg73e4=
github.com/gardener/gardener-extensions v1.5.1-0.20200330101454-c65957bd80b5/go.mod h1:+0MkNqbRaTvPMfEe/MoS31L5FM8W32WYvhpH4Y53Y5s=
github.com/gardener/gardener-resource-manager v0.9.1-0.20200124091350-6ea41bbae81f/go.mod h1:0pKTHOhvU91eQB0EYr/6Ymd7lXc/5Hi8P8tF/gpV0VQ=
github.com/gardener/gardener-resource-manager v0.10.0 h1:6OUKoWI3oha42F0oJN8OEo3UR+D3onOCel4Th+zgotU=
github.com/gardener/gardener-resource-manager v0.10.0/go.mod h1:0pKTHOhvU91eQB0EYr/6Ymd7lXc/5Hi8P8tF/gpV0VQ=
Expand Down
3 changes: 3 additions & 0 deletions pkg/controller/controlplane/valuesprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ func getCCMChartValues(
"checksum/secret-cloudprovider": checksums[v1beta1constants.SecretNameCloudProvider],
"checksum/configmap-cloud-provider-config": checksums[azure.CloudProviderConfigName],
},
"podLabels": map[string]interface{}{
v1beta1constants.LabelPodMaintenanceRestart: "true",
},
}

if cpConfig.CloudControllerManager != nil {
Expand Down
3 changes: 3 additions & 0 deletions pkg/controller/controlplane/valuesprovider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ var _ = Describe("ValuesProvider", func() {
"checksum/secret-cloudprovider": "8bafb35ff1ac60275d62e1cbd495aceb511fb354f74a20f7d06ecb48b3a68432",
"checksum/configmap-cloud-provider-config": "08a7bc7fe8f59b055f173145e211760a83f02cf89635cef26ebb351378635606",
},
"podLabels": map[string]interface{}{
"maintenance.gardener.cloud/restart": "true",
},
"featureGates": map[string]bool{
"CustomResourceValidation": true,
},
Expand Down
4 changes: 4 additions & 0 deletions pkg/controller/worker/machine_controller_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/gardener/gardener-extension-provider-azure/pkg/azure"
extensionscontroller "github.com/gardener/gardener-extensions/pkg/controller"

v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
"github.com/gardener/gardener/pkg/utils/chart"
kutil "github.com/gardener/gardener/pkg/utils/kubernetes"
appsv1 "k8s.io/api/apps/v1"
Expand Down Expand Up @@ -65,6 +66,9 @@ func (w *workerDelegate) GetMachineControllerManagerChartValues(ctx context.Cont
"namespace": map[string]interface{}{
"uid": namespace.UID,
},
"podLabels": map[string]interface{}{
v1beta1constants.LabelPodMaintenanceRestart: "true",
},
}, nil
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/controller/worker/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ func (w *workerDelegate) generateMachineClassSecretData(ctx context.Context) (ma

type zoneInfo struct {
name string
index int
count int
index int32
count int32
}

func (w *workerDelegate) generateMachineConfig(ctx context.Context) error {
Expand Down Expand Up @@ -252,8 +252,8 @@ func (w *workerDelegate) generateMachineConfig(ctx context.Context) error {
for zoneIndex, zone := range pool.Zones {
info := &zoneInfo{
name: zone,
index: zoneIndex,
count: zoneCount,
index: int32(zoneIndex),
count: int32(zoneCount),
}

machineDeployment, machineClassSpec := generateMachineClassAndDeployment(info, nil)
Expand Down
8 changes: 4 additions & 4 deletions pkg/controller/worker/machines_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ var _ = Describe("Machines", func() {
sshKey string

namePool1 string
minPool1 int
maxPool1 int
minPool1 int32
maxPool1 int32
maxSurgePool1 intstr.IntOrString
maxUnavailablePool1 intstr.IntOrString

namePool2 string
minPool2 int
maxPool2 int
minPool2 int32
maxPool2 int32
maxSurgePool2 intstr.IntOrString
maxUnavailablePool2 intstr.IntOrString

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 21 additions & 20 deletions vendor/github.com/gardener/gardener/pkg/api/extensions/accessor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 82b4bab

Please sign in to comment.