Skip to content

Commit c04cc49

Browse files
committed
Merge branch 'feature/install-shell-with-ui-operator' into q/131.0
2 parents f94d064 + 1a789d4 commit c04cc49

File tree

26 files changed

+355
-608
lines changed

26 files changed

+355
-608
lines changed

buildchain/buildchain/image.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ def _local_image(name: str, **kwargs: Any) -> targets.LocalImage:
268268
"SALT_VERSION": versions.SALT_VERSION,
269269
},
270270
),
271+
_local_image(
272+
name="shell-ui",
273+
dockerfile=constants.ROOT / "shell-ui/Dockerfile",
274+
build_context=constants.ROOT / "shell-ui",
275+
),
271276
_local_image(
272277
name="metalk8s-ui",
273278
build_context=targets.ExplicitContext(

buildchain/buildchain/salt_tree.py

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -408,33 +408,10 @@ def _download_ui_operator_crds() -> str:
408408
Path("salt/metalk8s/addons/ui/deployed/dependencies.sls"),
409409
Path("salt/metalk8s/addons/ui/deployed/ingress.sls"),
410410
Path("salt/metalk8s/addons/ui/deployed/init.sls"),
411-
Path("salt/metalk8s/addons/ui/config/metalk8s-shell-ui-config.yaml.j2"),
411+
Path("salt/metalk8s/addons/ui/deployed/ui-operator-cr.sls"),
412412
Path("salt/metalk8s/addons/ui/config/metalk8s-ui-config.yaml.j2"),
413+
Path("salt/metalk8s/addons/ui/config/metalk8s-shell-ui-config.yaml.j2"),
413414
Path("salt/metalk8s/addons/ui/config/workloadplane-shell-ui-config.yaml.j2"),
414-
targets.TemplateFile(
415-
task_name="salt/metalk8s/addons/ui/config/deployed-ui-apps.yaml.j2",
416-
source=constants.ROOT.joinpath(
417-
"salt/metalk8s/addons/ui/config/deployed-ui-apps.yaml.j2.in"
418-
),
419-
destination=constants.ISO_ROOT.joinpath(
420-
"salt/metalk8s/addons/ui/config/deployed-ui-apps.yaml.j2"
421-
),
422-
context={
423-
"VERSION": versions.VERSION,
424-
},
425-
),
426-
Path("salt/metalk8s/addons/ui/deployed/ui-configuration.sls"),
427-
Path("salt/metalk8s/addons/ui/deployed/files/metalk8s-ui-deployment.yaml.j2"),
428-
targets.TemplateFile(
429-
task_name="salt/metalk8s/addons/ui/deployed/ui.sls",
430-
source=constants.ROOT.joinpath("salt/metalk8s/addons/ui/deployed/ui.sls.in"),
431-
destination=constants.ISO_ROOT.joinpath(
432-
"salt/metalk8s/addons/ui/deployed/ui.sls"
433-
),
434-
context={
435-
"ShellUIVersion": versions.SHELL_UI_VERSION,
436-
},
437-
),
438415
Path("salt/metalk8s/addons/ui/post-upgrade.sls"),
439416
Path("salt/metalk8s/addons/ui-operator/deployed/init.sls"),
440417
Path("salt/metalk8s/addons/ui-operator/deployed/manifests.sls"),
@@ -451,6 +428,8 @@ def _download_ui_operator_crds() -> str:
451428
),
452429
Path("salt/metalk8s/addons/ui-operator/deployed/rbac.sls"),
453430
Path("salt/metalk8s/addons/ui-operator/post-upgrade.sls"),
431+
Path("salt/metalk8s/addons/shell-ui/deployed/init.sls"),
432+
Path("salt/metalk8s/addons/shell-ui/deployed/ui-operator-cr.sls"),
454433
Path("salt/metalk8s/addons/solutions/deployed/configmap.sls"),
455434
Path("salt/metalk8s/addons/solutions/deployed/init.sls"),
456435
Path("salt/metalk8s/addons/solutions/deployed/namespace.sls"),

buildchain/buildchain/versions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def load_version_information() -> None:
8686
NODEJS_IMAGE_VERSION: str = "20.11.1"
8787
KEEPALIVED_VERSION: str = "2.3.3"
8888
CERT_MANAGER_VERSION: str = "1.17.1"
89-
UI_OPERATOR_VERSION: str = "0.1.1"
89+
UI_OPERATOR_VERSION: str = "1.0.5"
9090

9191
# Current build IDs, to be augmented whenever we rebuild the corresponding
9292
# image, e.g. because the `Dockerfile` is changed, or one of the dependencies
@@ -270,7 +270,7 @@ def _version_prefix(version: str, prefix: str = "v") -> str:
270270
Image(
271271
name="ui-operator",
272272
version=UI_OPERATOR_VERSION,
273-
digest="sha256:5a039b2f16fab190e26e21f27f2662752c0a0f2799afeb102df85b3cf605b754",
273+
digest="sha256:c007400f44f392a923d0567eaaab570cc67cba70e036b908a5e6a14736c43ea2",
274274
),
275275
Image(
276276
name="loki",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include:
2+
- .ui-operator-cr
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{%- from "metalk8s/repo/macro.sls" import build_image_name with context %}
2+
3+
{%- set shell_ui_image = build_image_name('shell-ui') %}
4+
5+
{%- set shell_ui_cp = salt.metalk8s_kubernetes.get_object(
6+
kind='ScalityUI',
7+
apiVersion='ui.scality.com/v1alpha1',
8+
namespace='metalk8s-ui',
9+
name='shell-ui-cp',
10+
)
11+
%}
12+
13+
{%- if shell_ui_cp is none %}
14+
15+
Create ScalityUI for control plane:
16+
metalk8s_kubernetes.object_present:
17+
- manifest:
18+
apiVersion: ui.scality.com/v1alpha1
19+
kind: ScalityUI
20+
metadata:
21+
name: shell-ui-cp
22+
namespace: metalk8s-ui
23+
labels:
24+
app.kubernetes.io/name: shell-ui-cp
25+
app.kubernetes.io/managed-by: salt
26+
app.kubernetes.io/part-of: metalk8s
27+
heritage: metalk8s
28+
spec:
29+
networks:
30+
ingressClassName: nginx-control-plane
31+
productName: MetalK8s
32+
image: {{ shell_ui_image }}
33+
auth:
34+
clientId: control-plane-ui
35+
kind: OIDC
36+
providerLogout: true
37+
providerUrl: "/oidc"
38+
redirectUrl: "{{ salt.metalk8s_network.get_control_plane_ingress_endpoint() }}/"
39+
responseType: code
40+
scopes: openid email profile
41+
navbar:
42+
main:
43+
- internal:
44+
kind: metalk8s-ui
45+
view: platform
46+
groups: [metalk8s:admin]
47+
- internal:
48+
kind: metalk8s-ui
49+
view: alerts
50+
groups: [metalk8s:admin]
51+
{%- else %}
52+
53+
Update ScalityUI for control plane:
54+
metalk8s_kubernetes.object_updated:
55+
- name: shell-ui-cp
56+
- kind: ScalityUI
57+
- apiVersion: ui.scality.com/v1alpha1
58+
- namespace: metalk8s-ui
59+
- patch:
60+
spec:
61+
image: {{ shell_ui_image }}
62+
auth:
63+
redirectUrl: "{{ salt.metalk8s_network.get_control_plane_ingress_endpoint() }}/"
64+
- content_type: application/merge-patch+json
65+
{%- endif %}
66+
67+
68+
{%- set shell_ui_wp = salt.metalk8s_kubernetes.get_object(
69+
kind='ScalityUI',
70+
apiVersion='ui.scality.com/v1alpha1',
71+
namespace='metalk8s-ui',
72+
name='shell-ui-wp',
73+
)
74+
%}
75+
76+
{%- if shell_ui_wp is none %}
77+
Create ScalityUI for workload plane:
78+
metalk8s_kubernetes.object_present:
79+
- manifest:
80+
apiVersion: ui.scality.com/v1alpha1
81+
kind: ScalityUI
82+
metadata:
83+
name: shell-ui-wp
84+
namespace: metalk8s-ui
85+
labels:
86+
app.kubernetes.io/name: shell-ui-wp
87+
app.kubernetes.io/managed-by: salt
88+
app.kubernetes.io/part-of: metalk8s
89+
heritage: metalk8s
90+
spec:
91+
networks:
92+
ingressClassName: nginx
93+
productName: MetalK8s
94+
image: {{ shell_ui_image }}
95+
auth:
96+
clientId: control-plane-ui
97+
kind: OIDC
98+
providerLogout: true
99+
providerUrl: "/oidc"
100+
redirectUrl: "{{ salt.metalk8s_network.get_control_plane_ingress_endpoint() }}/"
101+
responseType: code
102+
scopes: openid profile email groups offline_access audience:server:client_id:oidc-auth-client
103+
navbar:
104+
main:
105+
- internal:
106+
kind: metalk8s-ui
107+
view: platform
108+
groups: [metalk8s:admin]
109+
- internal:
110+
kind: metalk8s-ui
111+
view: alerts
112+
groups: [metalk8s:admin]
113+
{%- else %}
114+
115+
Update ScalityUI for workload plane:
116+
metalk8s_kubernetes.object_updated:
117+
- name: shell-ui-wp
118+
- kind: ScalityUI
119+
- apiVersion: ui.scality.com/v1alpha1
120+
- namespace: metalk8s-ui
121+
- patch:
122+
spec:
123+
image: {{ shell_ui_image }}
124+
auth:
125+
redirectUrl: "{{ salt.metalk8s_network.get_control_plane_ingress_endpoint() }}/"
126+
- content_type: application/merge-patch+json
127+
{%- endif %}

salt/metalk8s/addons/ui-operator/deployed/manifests.sls

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{%- from "metalk8s/repo/macro.sls" import build_image_name with context %}
22
3-
include:
4-
- .namespace
5-
63
{%- set ui_operator_image = build_image_name('ui-operator') %}
74
85
Deploy UI Operator:
@@ -75,6 +72,4 @@ Deploy UI Operator:
7572
- ALL
7673
securityContext:
7774
runAsNonRoot: true
78-
terminationGracePeriodSeconds: 10
79-
- require:
80-
- sls: metalk8s.addons.ui-operator.deployed.namespace
75+
terminationGracePeriodSeconds: 10

salt/metalk8s/addons/ui/config/deployed-ui-apps.yaml.j2.in

Lines changed: 0 additions & 23 deletions
This file was deleted.

salt/metalk8s/addons/ui/deployed/ingress.sls

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -94,45 +94,6 @@ spec:
9494
---
9595
apiVersion: networking.k8s.io/v1
9696
kind: Ingress
97-
metadata:
98-
name: metalk8s-ui
99-
namespace: metalk8s-ui
100-
labels:
101-
app: metalk8s-ui
102-
app.kubernetes.io/managed-by: salt
103-
app.kubernetes.io/name: metalk8s-ui
104-
app.kubernetes.io/part-of: metalk8s
105-
heritage: metalk8s
106-
annotations:
107-
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
108-
nginx.ingress.kubernetes.io/rewrite-target: /$1
109-
spec:
110-
ingressClassName: "nginx-control-plane"
111-
rules:
112-
- http:
113-
paths:
114-
{% for path in [
115-
"/(brand.*)",
116-
"/(config.json)",
117-
"/(manifest.json)",
118-
"/(shell.*)",
119-
"/(static.*)",
120-
"/" + stripped_base_path + "/(.well-known.*)" if stripped_base_path else "/(.well-known.*)",
121-
"/" + stripped_base_path + "/(static.*)" if stripped_base_path else "/(static.*)",
122-
"/" + stripped_base_path + "/(mf-manifest.*)" if stripped_base_path else "/(mf-manifest.*)",
123-
"/(" + stripped_base_path + ".*)",
124-
] %}
125-
- path: {{ path }}
126-
pathType: Prefix
127-
backend:
128-
service:
129-
name: metalk8s-ui
130-
port:
131-
number: 80
132-
{% endfor %}
133-
---
134-
apiVersion: networking.k8s.io/v1
135-
kind: Ingress
13697
metadata:
13798
annotations:
13899
nginx.ingress.kubernetes.io/backend-protocol: HTTP
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
include:
22
- .dependencies
3-
- .ui-configuration
4-
- .ui
3+
- .ui-operator-cr
54
- .ingress

0 commit comments

Comments
 (0)