Skip to content

Commit

Permalink
Add skaffold-based dev setup
Browse files Browse the repository at this point in the history
  • Loading branch information
timebertt committed Nov 7, 2023
1 parent e4bd239 commit 8551e91
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,21 @@ verify: check format test

.PHONY: verify-extended
verify-extended: check-generate check format test

#####################################################################
# Rules for local environment #
#####################################################################

# speed-up skaffold deployments by building all images concurrently
extension-%: export SKAFFOLD_BUILD_CONCURRENCY = 0
extension-%: export SKAFFOLD_DEFAULT_REPO = localhost:5001
extension-%: export SKAFFOLD_PUSH = true
# use static label for skaffold to prevent rolling all gardener components on every `skaffold` invocation
extension-%: export SKAFFOLD_LABEL = skaffold.dev/run-id=shoot-flux

extension-up: $(SKAFFOLD)
$(SKAFFOLD) run
extension-dev: $(SKAFFOLD)
$(SKAFFOLD) dev --cleanup=false --trigger=manual
extension-down: $(SKAFFOLD)
$(SKAFFOLD) delete
8 changes: 8 additions & 0 deletions deploy/extension/local/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../base

patchesStrategicMerge:
- patch-controller-deployment.yaml
7 changes: 7 additions & 0 deletions deploy/extension/local/patch-controller-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: core.gardener.cloud/v1beta1
kind: ControllerRegistration
metadata:
name: shoot-flux
spec:
deployment:
policy: Always
21 changes: 21 additions & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
apiVersion: skaffold/v4beta3
kind: Config
metadata:
name: extension
build:
artifacts:
- image: ghcr.io/stackitcloud/gardener-extension-shoot-flux
ko:
main: ./cmd/gardener-extension-shoot-flux
resourceSelector:
allow:
# instruct skaffold to inject the built image reference into the image field in our ControllerDeployment
- groupKind: ControllerDeployment.core.gardener.cloud
image: [".*"]
manifests:
kustomize:
paths:
- ./deploy/extension/local
deploy:
kubectl: {}

0 comments on commit 8551e91

Please sign in to comment.