Skip to content

Commit

Permalink
Configure Placementgroups in worker spec (#13)
Browse files Browse the repository at this point in the history
* Introduce ignoreResources to charts

Signed-off-by: Jens Schneider <[email protected]>

* Refactor code

* Remove handling of placementgroups in Infrastructure
* Placementgroups are part of the WorkerConfig now
* Reorganize code in machine_images.go

Signed-off-by: Jens Schneider <[email protected]>

* Add debug phonies to Makefile

Signed-off-by: Jens Schneider <[email protected]>

* Add hook-me-hcloud.sh

This is needed as the hcloud does not support UDP-based loadbalancers

Signed-off-by: Jens Schneider <[email protected]>

* Make tests compatible with new hclient in workerDelegate

Signed-off-by: Jens Schneider <[email protected]>
  • Loading branch information
JensAc authored Jul 6, 2022
1 parent 9ddfcf6 commit 7690e4c
Show file tree
Hide file tree
Showing 21 changed files with 766 additions and 186 deletions.
32 changes: 29 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ PROJECT_NAME := 23technologies
VERSION := $(shell cat "${REPO_ROOT}/VERSION")
LD_FLAGS := "-w $(shell $(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/get-build-ld-flags.sh k8s.io/component-base $(REPO_ROOT)/VERSION $(EXTENSION_PREFIX)-$(NAME))"
LEADER_ELECTION := false
IGNORE_OPERATION_ANNOTATION := true
IGNORE_OPERATION_ANNOTATION := false
GARDENER_VERSION := $(grep "gardener/gardener v" go.mod | tr "[:blank:]" "\\n" | tail -1)

WEBHOOK_CONFIG_PORT := 8443
WEBHOOK_CONFIG_PORT := 8444
WEBHOOK_CONFIG_MODE := url
WEBHOOK_CONFIG_URL := localhost:${WEBHOOK_CONFIG_PORT}
EXTENSION_NAMESPACE :=
Expand All @@ -36,6 +36,8 @@ ifeq (${WEBHOOK_CONFIG_MODE}, service)
WEBHOOK_PARAM := --webhook-config-namespace=${EXTENSION_NAMESPACE}
endif

WEBHOOK_CERT_DIR=/tmp/gardener-extensions-cert

#########################################
# Rules for local development scenarios #
#########################################
Expand All @@ -56,18 +58,42 @@ start:
--gardener-version=${GARDENER_VERSION} \
${WEBHOOK_PARAM}

.PHONY: debug
debug:
dlv debug ./cmd/${EXTENSION_PREFIX}-${NAME} -- \
--kubeconfig=${KUBECONFIG} \
--config-file=${MANAGER_CONFIG_FILE} \
--ignore-operation-annotation=${IGNORE_OPERATION_ANNOTATION} \
--leader-election=${LEADER_ELECTION} \
--webhook-config-server-host=0.0.0.0 \
--webhook-config-server-port=${WEBHOOK_CONFIG_PORT} \
--webhook-config-mode=${WEBHOOK_CONFIG_MODE} \
--gardener-version=${GARDENER_VERSION} \
${WEBHOOK_PARAM}

.PHONY: start-admission
start-admission:
@LEADER_ELECTION_NAMESPACE=garden GO111MODULE=on go run \
-mod=vendor \
-ldflags ${LD_FLAGS} \
./cmd/${EXTENSION_PREFIX}-${ADMISSION_NAME} \
--kubeconfig=${KUBECONFIG} \
--kubeconfig=dev/garden-kubeconfig.yaml \
--leader-election=${LEADER_ELECTION} \
--webhook-config-server-host=0.0.0.0 \
--webhook-config-server-port=9443 \
--health-bind-address=:8085 \
--webhook-config-cert-dir=./example/admission-hcloud-certs

.PHONY: debug-admission
debug-admission:
LEADER_ELECTION_NAMESPACE=garden dlv debug \
./cmd/${EXTENSION_PREFIX}-${ADMISSION_NAME} -- \
--leader-election=${LEADER_ELECTION} \
--kubeconfig=dev/garden-kubeconfig.yaml \
--webhook-config-server-host=0.0.0.0 \
--webhook-config-server-port=9443 \
--health-bind-address=:8085 \
--webhook-config-cert-dir=./example/admission-hcloud-certs
#########################################
# Rules for re-vendoring
#########################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Deployment
metadata:
name: {{ include "name" . }}
namespace: {{ .Release.Namespace }}
{{- if .Values.ignoreResources }}
annotations:
resources.gardener.cloud/ignore: "true"
{{- end }}
labels:
{{ include "labels" . | indent 4 }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Service
metadata:
name: {{ include "name" . }}
namespace: {{ .Release.Namespace }}
{{- if .Values.ignoreResources }}
annotations:
resources.gardener.cloud/ignore: "true"
{{- end }}
labels:
{{ include "labels" . | indent 4 }}
spec:
Expand Down
Loading

0 comments on commit 7690e4c

Please sign in to comment.