Skip to content

Commit

Permalink
This PR improves the skaffold setup of the extension
Browse files Browse the repository at this point in the history
The change incorporates the changes from gardener/gardener#7757 and gardener/gardener-extension-shoot-rsyslog-relp#5.

It simplifies the skaffold setup and drops the ControllerRegistration chart (`./charts/registration`). The `make extension-up` target is now fixed and invoked by the `make ci-e2e-kind` target now.
  • Loading branch information
ialidzhikov committed Sep 4, 2023
1 parent 815bb0c commit a8055c2
Show file tree
Hide file tree
Showing 17 changed files with 61 additions and 145 deletions.
13 changes: 0 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,3 @@ extension-dev: $(SKAFFOLD) $(HELM)

extension-down: $(SKAFFOLD) $(HELM)
$(SKAFFOLD) delete

# use static label for skaffold to prevent rolling all gardener components on every `skaffold` invocation
admission-up admission-down: export SKAFFOLD_LABEL = skaffold.dev/run-id=admission-local
admission-%: export SKAFFOLD_FILENAME = skaffold-admission.yaml

admission-up: $(SKAFFOLD) $(KIND) $(HELM)
$(SKAFFOLD) run

admission-dev: $(SKAFFOLD) $(HELM)
$(SKAFFOLD) dev --cleanup=false --trigger=manual

admission-down: $(SKAFFOLD) $(HELM)
$(SKAFFOLD) delete
1 change: 1 addition & 0 deletions charts/admission/charts/runtime/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
# TODO(ialidzhikov): Double check whether we need these NetworkPolicy labels.
networking.gardener.cloud/to-dns: allowed
networking.resources.gardener.cloud/to-virtual-garden-kube-apiserver-tcp-443: allowed
networking.gardener.cloud/to-runtime-apiserver: allowed
{{ include "labels" . | indent 8 }}
spec:
{{- if not .Values.global.virtualGarden.enabled }}
Expand Down
5 changes: 1 addition & 4 deletions charts/gardener-extension-registry-cache/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:generate sh -c "../../vendor/github.com/gardener/gardener/hack/generate-controller-registration.sh extension-registry-cache . $(cat ../../VERSION) ../../example/registration/controller-registration.yaml Extension:registry-cache"
//go:generate cp ../../example/registration/controller-registration.yaml ../../charts/registration/templates/controller-registration.yaml
//go:generate sh -c "sed -i 's/ image:/{{ toYaml .Values.values | indent 4 }}/g' ../../charts/registration/templates/controller-registration.yaml"
//go:generate sh -c "sed -i 's/ tag: .*//g' ../../charts/registration/templates/controller-registration.yaml"
//go:generate sh -c "../../vendor/github.com/gardener/gardener/hack/generate-controller-registration.sh extension-registry-cache . $(cat ../../VERSION) ../../example/controller-registration.yaml Extension:registry-cache"

// Package chart enables go:generate support for generating the correct controller registration.
package chart
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ apiVersion: config.registry.extensions.gardener.cloud/v1alpha1
kind: Configuration
{{- end }}

{{- define "image" -}}
{{- if hasPrefix "sha256:" .Values.image.tag }}
{{- printf "%s@%s" .Values.image.repository .Values.image.tag }}
{{- else }}
{{- printf "%s:%s" .Values.image.repository .Values.image.tag }}
{{- end }}
{{- end }}

{{- define "leaderelectionid" -}}
extension-registry-cache-leader-election
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ spec:
serviceAccountName: gardener-extension-registry-cache
containers:
- name: gardener-extension-registry-cache
image: {{ include "image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: {{ .Values.image }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- --config=/etc/registry-cache/config.yaml
- --max-concurrent-reconciles={{ .Values.controllers.concurrentSyncs }}
Expand Down
6 changes: 2 additions & 4 deletions charts/gardener-extension-registry-cache/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
image:
repository: eu.gcr.io/gardener-project/gardener/extensions/registry-cache
tag: latest
pullPolicy: IfNotPresent
image: eu.gcr.io/gardener-project/gardener/extensions/registry-cache:latest
imagePullPolicy: IfNotPresent

leaderElection:
resourceLock: leases
Expand Down
5 changes: 0 additions & 5 deletions charts/registration/Chart.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions charts/registration/templates/controller-registration.yaml

This file was deleted.

1 change: 0 additions & 1 deletion charts/registration/values.yaml

This file was deleted.

24 changes: 24 additions & 0 deletions example/controller-registration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
apiVersion: core.gardener.cloud/v1beta1
kind: ControllerDeployment
metadata:
name: extension-registry-cache
type: helm
providerConfig:
chart: H4sIAAAAAAAAA+0ca2/bOLKf9St4zgFtF5H8iOP0fChw3iTbBtcmRpzNYrFYFLRE29rIoo6UnHrb3m+/4UMyJdmxnWSdy64GgWNT5HA4w3lwSGqMmUdCwmzyOSYh92loMzL2eczmtovdCam/eDA0AI4OD+V/gOJ/+b150G62Dludjihvdlqdgxfo8OFdr4eEx5gh9IJRGt9Vb93zZwrjtfJ3JiSY+uOQMnLPPoSAO+32SvmD2PPybzXarcYL1HjUka6Av7j891AfxzFhIUcxRUrM6HZCQjRM/MDzwzGKsHuDx4Q71h66mvgc8SSKKIvhC0yNAI0DOkRTHLsTqL2PGAlw7M8ItIsnRjkOPUAQkjE8pSF6FTEy8j8TD936UO9vrx10EQZzREPZUpCEIsJQ4IfEsZyTwadBDLQBimM6nQKC6+MB8nzGLWfsx3X5qci3nOHvrC4/04LJuC4+0p98FtYXiIYwviRCIz8g3PrO4bcRfA7xDXzGU/j+X6h6jZlPE47OTk6hw4jR34gbW47vEVxX9aDIcmbcpR6pW08t1c1hvf4fTzCLnTmeBvftY53+tw4Oi/rfalb6vxPAkX9NmJB7F82aFo6i7Get6TRqlke4y/wolkU99B6cAXLFlEAjylA8IeidnkLoUk8cdCwmDspmlGOFeEq6aO1cs2Zp3w0HOn9GavRsYb3+e9R1xvQhfazR/1bjqBj/HR0cdir93wXU6+AGozl4ykmMXrmvEdjeFhr0+mhwikDBcSh/4BG4Rx/HBLl0GuFw7qAeuH7ZjIPL54TNiOeo+EB4UgT/A9+FKQUePgk9omxFL5KmYUBH8S2GSOODqrKPZg5qgcVwSRQjzFFIY2hHoQm79TlgC2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
image: eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.2.0-dev
---
apiVersion: core.gardener.cloud/v1beta1
kind: ControllerRegistration
metadata:
name: extension-registry-cache
annotations:
security.gardener.cloud/pod-security-enforce: baseline
spec:
deployment:
deploymentRefs:
- name: extension-registry-cache
resources:
- kind: Extension
type: registry-cache
Loading

0 comments on commit a8055c2

Please sign in to comment.