Skip to content

Commit ad91116

Browse files
committed
feat: add ui-operator addon structure
fix: remove trailing whitespace and ensure consistent formatting in ui-operator addon files fix: update ui-operator deployment and related configurations review: replace template file with direct manifests.sls for ui-operator deployment refactor: remove unnecessary shebang and restructure namespace definition for ui-operator fix: remove trailing whitespace in manifests.sls for ui-operator addon feat: add POD_NAMESPACE environment variable to ui-operator deployment refactor: update ui-operator deployment manifest structure for clarity refactor: streamline namespace definition in ui-operator manifest
1 parent 8c10bf8 commit ad91116

File tree

5 files changed

+100
-0
lines changed

5 files changed

+100
-0
lines changed

buildchain/buildchain/salt_tree.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ def task(self) -> types.TaskDict:
409409
},
410410
),
411411
Path("salt/metalk8s/addons/ui/post-upgrade.sls"),
412+
Path("salt/metalk8s/addons/ui-operator/deployed/init.sls"),
413+
Path("salt/metalk8s/addons/ui-operator/deployed/manifests.sls"),
414+
Path("salt/metalk8s/addons/ui-operator/deployed/namespace.sls"),
415+
Path("salt/metalk8s/addons/ui-operator/post-upgrade.sls"),
412416
Path("salt/metalk8s/addons/solutions/deployed/configmap.sls"),
413417
Path("salt/metalk8s/addons/solutions/deployed/init.sls"),
414418
Path("salt/metalk8s/addons/solutions/deployed/namespace.sls"),
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
include:
2+
- .manifests
3+
4+
Wait for the UI Operator to be Ready:
5+
test.configurable_test_state:
6+
- changes: False
7+
- result: __slot__:salt:metalk8s_kubernetes.check_object_ready(
8+
apiVersion=apps/v1, kind=Deployment,
9+
name=ui-operator, namespace=metalk8s-ui)
10+
- comment: Wait for the UI Operator to be Ready
11+
- retry:
12+
attempts: 30
13+
- require:
14+
- sls: metalk8s.addons.ui-operator.deployed.manifests
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{%- from "metalk8s/repo/macro.sls" import build_image_name with context %}
2+
3+
include:
4+
- .namespace
5+
6+
{%- set ui_operator_image = build_image_name('ui-operator') %}
7+
8+
Deploy UI Operator:
9+
metalk8s_kubernetes.object_present:
10+
- manifest:
11+
apiVersion: apps/v1
12+
kind: Deployment
13+
metadata:
14+
name: ui-operator
15+
namespace: metalk8s-ui
16+
labels:
17+
app.kubernetes.io/name: ui-operator
18+
app.kubernetes.io/managed-by: salt
19+
app.kubernetes.io/part-of: metalk8s
20+
spec:
21+
replicas: 1
22+
selector:
23+
matchLabels:
24+
app.kubernetes.io/name: ui-operator
25+
template:
26+
metadata:
27+
labels:
28+
app.kubernetes.io/name: ui-operator
29+
spec:
30+
containers:
31+
- name: ui-operator
32+
image: {{ ui_operator_image }}
33+
env:
34+
- name: POD_NAMESPACE
35+
valueFrom:
36+
fieldRef:
37+
fieldPath: metadata.namespace
38+
ports:
39+
- containerPort: 8081
40+
name: health
41+
livenessProbe:
42+
httpGet:
43+
path: /healthz
44+
port: 8081
45+
initialDelaySeconds: 15
46+
periodSeconds: 20
47+
readinessProbe:
48+
httpGet:
49+
path: /readyz
50+
port: 8081
51+
initialDelaySeconds: 5
52+
periodSeconds: 10
53+
resources:
54+
requests:
55+
cpu: "10m"
56+
memory: "64Mi"
57+
limits:
58+
cpu: "500m"
59+
memory: "128Mi"
60+
securityContext:
61+
allowPrivilegeEscalation: false
62+
capabilities:
63+
drop:
64+
- ALL
65+
securityContext:
66+
runAsNonRoot: true
67+
terminationGracePeriodSeconds: 10
68+
- require:
69+
- sls: metalk8s.addons.ui-operator.deployed.namespace
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Create UI Operator Namespace:
2+
metalk8s_kubernetes.object_present:
3+
- manifest:
4+
apiVersion: v1
5+
kind: Namespace
6+
metadata:
7+
name: metalk8s-ui
8+
labels:
9+
app.kubernetes.io/managed-by: salt
10+
app.kubernetes.io/part-of: metalk8s
11+
heritage: metalk8s
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include:
2+
- .deployed

0 commit comments

Comments
 (0)