-
Notifications
You must be signed in to change notification settings - Fork 13
/
skaffold.yaml
125 lines (125 loc) · 4.3 KB
/
skaffold.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
#
# SPDX-License-Identifier: Apache-2.0
---
apiVersion: skaffold/v4beta3
kind: Config
metadata:
name: extension
build:
tagPolicy:
inputDigest: {}
insecureRegistries:
- garden.local.gardener.cloud
artifacts:
- image: local-skaffold/gardener-extension-shoot-lakom-service
# The extension controller uses the vectorImageOverwrite values to use
# as the image for the resources it deploys.
# This requires that the admission controller is built before this image.
requires:
- image: local-skaffold/lakom
hooks:
after:
- command: ["sh", "hack/skaffold-image.sh"]
ko:
# The dependencies section configures what files Skaffold should watch for changes when in dev mode.
# These dependencies can be updated using a skaffold script found in the hack dir
dependencies:
paths:
- charts
- charts/images.yaml
- cmd/gardener-extension-shoot-lakom-service
- cmd/gardener-extension-shoot-lakom-service/app
- pkg/apis/config
- pkg/apis/config/v1alpha1
- pkg/apis/lakom
- pkg/apis/lakom/v1alpha1
- pkg/cmd
- pkg/constants
- pkg/controller/config
- pkg/controller/healthcheck
- pkg/controller/lifecycle
- pkg/controller/seed
- pkg/imagevector
- pkg/secrets
- VERSION
ldflags:
- '{{.LD_FLAGS}}'
main: ./cmd/gardener-extension-shoot-lakom-service
- image: local-skaffold/lakom
# We need the image for the lakom admisison controller to be injected
# into the imageVectorOverwrite for the controller registration.
# Skaffold currently does not give us an easy way to access the
# image name of the newly built lakom during deployment (eg. passing it
# to kustomize).
#
# Hooks(https://skaffold.dev/docs/lifecycle-hooks/), however, provide us
# environment variables that contain the needed values:
# - SKAFFOLD_IMAGE_REPO
# - SKAFFOLD_IMAGE_TAG
#
# For this reason, using a post-build hook we can inject the image name and
# image tag into a patch file for kustomize, which will be triggered during
# the deployment phase of skaffold.
#
# The script file simply creates the needed resource patch for kustomize.
hooks:
after:
- command: ["sh", "hack/skaffold-imagevector.sh"]
ko:
dependencies:
paths:
- cmd/lakom
- cmd/lakom/app
- pkg/constants
- pkg/lakom/config
- pkg/lakom/metrics
- pkg/lakom/resolvetag
- pkg/lakom/utils
- pkg/lakom/verifysignature
- VERSION
ldflags:
- '{{.LD_FLAGS}}'
main: ./cmd/lakom
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:
- local-setup
deploy:
kubectl: {}
---
apiVersion: skaffold/v4beta3
kind: Config
metadata:
name: admission
build:
artifacts:
- image: local-skaffold/gardener-extension-shoot-lakom-admission
ko:
dependencies:
paths:
- cmd/gardener-extension-shoot-lakom-admission
- cmd/gardener-extension-shoot-lakom-admission/app
- pkg/admission/validator/lakom
- pkg/apis/lakom
- pkg/apis/lakom/v1alpha1
- pkg/constants
- VERSION
ldflags:
- '{{.LD_FLAGS}}'
main: ./cmd/gardener-extension-shoot-lakom-admission
deploy:
helm:
releases:
- name: gardener-extension-shoot-lakom-admission
namespace: garden
wait: true
chartPath: charts/gardener-extension-shoot-lakom-admission
setValueTemplates:
global.image.repository: '{{.IMAGE_REPO_local_skaffold_gardener_extension_shoot_lakom_admission}}'
global.image.tag: '{{.IMAGE_TAG_local_skaffold_gardener_extension_shoot_lakom_admission}}@{{.IMAGE_DIGEST_local_skaffold_gardener_extension_shoot_lakom_admission}}'