Skip to content

Commit

Permalink
Support for Kubernetes v1.25 (#232)
Browse files Browse the repository at this point in the history
* Add Kubernetes 1.25 support to README.md

* Handle PodDisruptionBudget policy/v1

* Don't deploy PSPs if it's disabled in the shoot

* Run `make generate`

* Update cloud-controller-manager image
  • Loading branch information
shafeeqes authored Oct 17, 2022
1 parent c2db6bb commit 1e56abe
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This extension controller supports the following Kubernetes versions:

| Version | Support | Conformance test results |
| --------------- | ----------- | ------------------------ |
| Kubernetes 1.25 | untested | N/A |
| Kubernetes 1.24 | untested | N/A |
| Kubernetes 1.23 | untested | N/A |
| Kubernetes 1.22 | untested | N/A |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{{- if gt (int .Values.replicaCount) 1 }}
{{- if semverCompare ">= 1.21-0" .Capabilities.KubeVersion.GitVersion }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ include "name" . }}
Expand Down
2 changes: 1 addition & 1 deletion charts/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ images:
- name: cloud-controller-manager
sourceRepository: github.com/equinix/cloud-provider-equinix-metal
repository: docker.io/equinix/cloud-provider-equinix-metal
tag: v3.3.0
tag: v3.5.0
- name: machine-controller-manager
sourceRepository: github.com/gardener/machine-controller-manager
repository: eu.gcr.io/gardener-project/gardener/machine-controller-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
labels:
app: metallb
---
{{- if not .Values.pspDisabled }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
Expand Down Expand Up @@ -49,6 +50,8 @@ spec:
- secret
- emptyDir
---
{{- end }}
{{- if not .Values.pspDisabled }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
Expand Down Expand Up @@ -91,6 +94,7 @@ spec:
- secret
- emptyDir
---
{{- end }}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -136,6 +140,7 @@ rules:
verbs:
- create
- patch
{{- if not .Values.pspDisabled }}
- apiGroups:
- policy
resourceNames:
Expand All @@ -144,6 +149,7 @@ rules:
- podsecuritypolicies
verbs:
- use
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -169,6 +175,7 @@ rules:
verbs:
- create
- patch
{{- if not .Values.pspDisabled }}
- apiGroups:
- policy
resourceNames:
Expand All @@ -177,6 +184,7 @@ rules:
- podsecuritypolicies
verbs:
- use
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down Expand Up @@ -405,6 +413,9 @@ spec:
securityContext:
runAsNonRoot: true
runAsUser: 65534
supplementalGroups:
- 1
- 65535
{{- if semverCompare ">= 1.19" .Capabilities.KubeVersion.GitVersion }}
seccompProfile:
type: RuntimeDefault
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
images:
metallb-controller: image-repository:image-tag
metallb-speaker: image-repository:image-tag

pspDisabled: false
2 changes: 1 addition & 1 deletion example/controller-registration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: provider-equinix-metal
type: helm
providerConfig:
chart: H4sIAAAAAAAAA+0cYXPbtq6f/St43nbX7tWyZTvJ5l3fe27idbm1iS9O29utezlaom01sqhRklOv3X9/AEnJkixbdtqmaytce5FJAgRJAARBSFMqbOYx0WBvQuYFDvcavuALx8aiPyPHc9405iykbvPeraEFcHRwIP8C5P/KZ7PTNdsH7cNDLDePjg6798jB7bvcHaIgpIKQe4LzcFu7svrPFKY7r//xjIrQWNK5u28fuMCH3e7G9YdVz65/2zwyD+6R1scYcB6+8vWnvvOCCVz3HlmYNer7q59t48BoNWy2qNkssITjh7K8T35h7pxYKA9kwgUJZ4w80XJEBkpo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efw1tGsVprc+oiOukRuWeg4gWZpL6T8SmPhvjdSNDJRvYapEesRvHqRJbo3NX99neIkIRRyNu/G6CHOAJtt9LEic163EQ71Ww0MglT+g2jNNCrkApJZcABFOeDxxsaqpjwJkrrcuMS56axmrvVI7//0ShkYsmywokqJfENKUsWwFeoviHJJzJ68jlJGwhoHKpsMpksJOvgQCTpnmdEJfPJxGX+RPZx5PFRa0bxTNUaxa7ntCTp1jG3YWLkhzwV7awAJtLH+cRjV8uUU4Vr0Jlz0NVoUsaae2a7qQvS7wVbpmWZbz7vUVkro1I3rlZHVZim2WjkDoS9RprUq06O3e6eLkpyvix8wUJKvm5f/n5a2dtp+nuj2Kj1OuR+ItfLN8VKW8h3uCyddKxfsLL28OfydafCy072avayOvcbYxpGSaP0habO/mO3kX63rNfIzlhTjp/pfhJrlX9N8B+8RddQQw011FBDDTXUUEMNNdRQQw011FBDDTXUUEMNNewE/we94hP5AHgAAA==
values:
image:
tag: v2.5.0-dev
Expand Down
16 changes: 14 additions & 2 deletions pkg/controller/controlplane/valuesprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/gardener/gardener/extensions/pkg/controller/common"
"github.com/gardener/gardener/extensions/pkg/controller/controlplane/genericactuator"
v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants"
gardencorev1beta1helper "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
"github.com/gardener/gardener/pkg/utils/chart"
gutil "github.com/gardener/gardener/pkg/utils/gardener"
Expand Down Expand Up @@ -115,11 +116,11 @@ func (vp *valuesProvider) GetControlPlaneChartValues(
func (vp *valuesProvider) GetControlPlaneShootChartValues(
_ context.Context,
_ *extensionsv1alpha1.ControlPlane,
_ *extensionscontroller.Cluster,
cluster *extensionscontroller.Cluster,
_ secretsmanager.Reader,
_ map[string]string,
) (map[string]interface{}, error) {
return nil, nil
return getControlPlaneShootChartValues(cluster)
}

// getCredentials determines the credentials from the secret referenced in the ControlPlane resource.
Expand Down Expand Up @@ -165,6 +166,17 @@ func getControlPlaneChartValues(
return values, nil
}

// getControlPlaneShootChartValues collects and returns the control plane shoot chart values.
func getControlPlaneShootChartValues(
cluster *extensionscontroller.Cluster,
) (map[string]interface{}, error) {
return map[string]interface{}{
"metallb": map[string]interface{}{
"pspDisabled": gardencorev1beta1helper.IsPSPDisabled(cluster.Shoot),
},
}, nil
}

func (vp *valuesProvider) decodeControlPlaneConfig(cp *extensionsv1alpha1.ControlPlane) (*api.ControlPlaneConfig, error) {
cpConfig := &api.ControlPlaneConfig{}

Expand Down
44 changes: 38 additions & 6 deletions pkg/controller/controlplane/valuesprovider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/utils/pointer"
"sigs.k8s.io/controller-runtime/pkg/runtime/inject"
)

Expand Down Expand Up @@ -160,12 +161,43 @@ var _ = Describe("ValuesProvider", func() {
})

Describe("#GetControlPlaneShootChartValues", func() {
It("should return nil", func() {
vp := NewValuesProvider()

values, err := vp.GetControlPlaneShootChartValues(context.TODO(), cp, cluster, nil, checksums)
Expect(err).NotTo(HaveOccurred())
Expect(values).To(BeNil())
Context("podSecurityPolicy", func() {
It("should return correct shoot control plane chart when PodSecurityPolicy admission plugin is not disabled in the shoot", func() {
cluster.Shoot.Spec.Kubernetes.KubeAPIServer = &gardencorev1beta1.KubeAPIServerConfig{
AdmissionPlugins: []gardencorev1beta1.AdmissionPlugin{
{
Name: "PodSecurityPolicy",
},
},
}
vp := NewValuesProvider()
values, err := vp.GetControlPlaneShootChartValues(context.TODO(), cp, cluster, nil, nil)
Expect(err).NotTo(HaveOccurred())
Expect(values).To(Equal(map[string]interface{}{
"metallb": map[string]interface{}{
"pspDisabled": false,
},
}))
})

It("should return correct shoot control plane chart when PodSecurityPolicy admission plugin is disabled in the shoot", func() {
cluster.Shoot.Spec.Kubernetes.KubeAPIServer = &gardencorev1beta1.KubeAPIServerConfig{
AdmissionPlugins: []gardencorev1beta1.AdmissionPlugin{
{
Name: "PodSecurityPolicy",
Disabled: pointer.Bool(true),
},
},
}
vp := NewValuesProvider()
values, err := vp.GetControlPlaneShootChartValues(context.TODO(), cp, cluster, nil, nil)
Expect(err).NotTo(HaveOccurred())
Expect(values).To(Equal(map[string]interface{}{
"metallb": map[string]interface{}{
"pspDisabled": true,
},
}))
})
})
})
})
Expand Down

0 comments on commit 1e56abe

Please sign in to comment.