Skip to content

Commit 407d574

Browse files
committed
Refactor quickpizza k8s resources using patches
1 parent 36324b1 commit 407d574

File tree

7 files changed

+34
-13
lines changed

7 files changed

+34
-13
lines changed

kubernetes/base/quickpizza/catalog.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ spec:
2121
metadata:
2222
labels: *catalogLabels
2323
spec:
24-
restartPolicy: Always
2524
containers:
2625
- name: quickpizza
2726
image: ghcr.io/grafana/quickpizza-local:latest
28-
imagePullPolicy: IfNotPresent
2927
ports:
3028
- name: http
3129
containerPort: 3333

kubernetes/base/quickpizza/config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ spec:
2121
metadata:
2222
labels: *configLabels
2323
spec:
24-
restartPolicy: Always
2524
containers:
2625
- name: quickpizza
2726
image: ghcr.io/grafana/quickpizza-local:latest
28-
imagePullPolicy: IfNotPresent
2927
ports:
3028
- name: http
3129
containerPort: 3333

kubernetes/base/quickpizza/copy.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ spec:
2121
metadata:
2222
labels: *copyLabels
2323
spec:
24-
restartPolicy: Always
2524
containers:
2625
- name: quickpizza
2726
image: ghcr.io/grafana/quickpizza-local:latest
28-
imagePullPolicy: IfNotPresent
2927
ports:
3028
- name: http
3129
containerPort: 3333

kubernetes/base/quickpizza/kustomization.yaml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Uncomment the following line to deploy the application on a non-default namespace
22
# namespace: quickpizza
33

4+
apiVersion: kustomize.config.k8s.io/v1beta1
5+
kind: Kustomization
6+
47
resources:
58
- catalog.yaml
69
- config.yaml
@@ -9,7 +12,6 @@ resources:
912
- recommendations.yaml
1013
- ws.yaml
1114

12-
1315
configMapGenerator:
1416
- name: quickpizza-env-common
1517
literals:
@@ -22,3 +24,34 @@ configMapGenerator:
2224
- QUICKPIZZA_WS_ENDPOINT=http://quickpizza-ws:3333
2325
- QUICKPIZZA_RECOMMENDATIONS_ENDPOINT=http://quickpizza-recommendations:3333
2426
- QUICKPIZZA_CONFIG_ENDPOINT=http://quickpizza-config:3333
27+
28+
# defines shared properties for all deployments
29+
patches:
30+
- patch: |-
31+
- op: add
32+
path: /spec/template/spec/containers/0/imagePullPolicy
33+
value: IfNotPresent
34+
- op: add
35+
path: /spec/template/spec/containers/0/readinessProbe
36+
value:
37+
httpGet:
38+
path: /ready
39+
port: 3333
40+
initialDelaySeconds: 5
41+
periodSeconds: 10
42+
timeoutSeconds: 3
43+
successThreshold: 1
44+
failureThreshold: 3
45+
- op: add
46+
path: /spec/template/spec/containers/0/livenessProbe
47+
value:
48+
httpGet:
49+
path: /healthz
50+
port: 3333
51+
initialDelaySeconds: 30
52+
periodSeconds: 30
53+
timeoutSeconds: 5
54+
successThreshold: 1
55+
failureThreshold: 3
56+
target:
57+
kind: Deployment

kubernetes/base/quickpizza/public-api.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ spec:
2121
metadata:
2222
labels: *publicAPILabels
2323
spec:
24-
restartPolicy: Always
2524
containers:
2625
- name: quickpizza
2726
image: ghcr.io/grafana/quickpizza-local:latest
28-
imagePullPolicy: IfNotPresent
2927
ports:
3028
- name: http
3129
containerPort: 3333

kubernetes/base/quickpizza/recommendations.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ spec:
2121
metadata:
2222
labels: *recommendationsLabels
2323
spec:
24-
restartPolicy: Always
2524
containers:
2625
- name: quickpizza
2726
image: ghcr.io/grafana/quickpizza-local:latest
28-
imagePullPolicy: IfNotPresent
2927
ports:
3028
- name: http
3129
containerPort: 3333

kubernetes/base/quickpizza/ws.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ spec:
2020
metadata:
2121
labels: *wsLabels
2222
spec:
23-
restartPolicy: Always
2423
containers:
2524
- name: quickpizza
2625
image: ghcr.io/grafana/quickpizza-local:latest
27-
imagePullPolicy: IfNotPresent
2826
ports:
2927
- name: http
3028
containerPort: 3333

0 commit comments

Comments
 (0)