Skip to content

Commit 6b1e495

Browse files
authored
Merge pull request #3 from InformaticsMatters/motd
Add motd variable and content in ConfigMap
2 parents ad10e5f + fdbf9a7 commit 6b1e495

File tree

5 files changed

+20
-40
lines changed

5 files changed

+20
-40
lines changed

.yamllint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ignore: |
99
.github/
1010
roles/mini-apps-ui/templates/configmap.yaml.j2
1111
roles/mini-apps-ui/templates/serviceaccount.yaml.j2
12-
roles/mini-apps-ui/templates/statefulset.yaml.j2
12+
roles/mini-apps-ui/templates/deployment.yaml.j2
1313

1414
rules:
1515
indentation:

roles/mini-apps-ui/defaults/main.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ maui_state: present
1010
# The namespace to create for application deployment.
1111
maui_namespace: data-manager-ui
1212

13+
# Message of the day (YAML) - a list (possibly empty).
14+
# This gets injected into the UI Pod as the 'motd.yaml' file.
15+
maui_motd: |
16+
motd: []
17+
1318
# Realm
1419
maui_keycloak_realm: squonk
1520
maui_keycloak_client_id: data-manager-ui

roles/mini-apps-ui/tasks/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@
4444
wait_timeout: "{{ pod_ready_timeout }}"
4545
loop:
4646
- configmap.yaml.j2
47-
- statefulset.yaml.j2
47+
- deployment.yaml.j2
4848
- service.yaml.j2
4949
- ingress.yaml.j2

roles/mini-apps-ui/templates/configmap.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ data:
2323
{% if maui_disable_ssl_cert_check %}
2424
DANGEROUS__DISABLE_SSL_CERT_CHECK_IN_API_PROXY='1'
2525
{% endif %}
26+
27+
motd.yaml: {{ maui_motd | to_yaml }}

roles/mini-apps-ui/templates/statefulset.yaml.j2 renamed to roles/mini-apps-ui/templates/deployment.yaml.j2

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
---
2-
kind: StatefulSet
2+
kind: Deployment
33
apiVersion: apps/v1
44
metadata:
55
name: mini-apps-ui
66
namespace: {{ maui_namespace }}
77
spec:
8-
revisionHistoryLimit: 10
8+
replicas: 1
9+
strategy:
10+
type: RollingUpdate
11+
rollingUpdate:
12+
maxSurge: 1
13+
maxUnavailable: 0
914
selector:
1015
matchLabels:
1116
name: mini-apps-ui
12-
serviceName: mini-apps-ui
13-
replicas: {{ maui_replicas }}
1417
template:
1518
metadata:
1619
name: mini-apps-ui
@@ -22,24 +25,6 @@ spec:
2225
{% endif %}
2326
serviceAccountName: mini-apps-ui
2427

25-
# Try to avoid 'worker' nodes (lower weight),
26-
# instead preferring 'application' nodes (higher weight)
27-
# falling back on anything else (like 'core') if there's still not room.
28-
affinity:
29-
nodeAffinity:
30-
preferredDuringSchedulingIgnoredDuringExecution:
31-
- weight: 1
32-
nodeSelectorTerms:
33-
- matchExpressions:
34-
- key: informaticsmatters.com/purpose-worker
35-
operator: Exists
36-
preferredDuringSchedulingIgnoredDuringExecution:
37-
- weight: 10
38-
preference:
39-
matchExpressions:
40-
- key: {{ maui_fallback_node_selector_key }}
41-
operator: Exists
42-
4328
containers:
4429
- name: mini-apps-ui
4530
image: {{ maui_image_name }}:{{ maui_image_tag }}
@@ -57,6 +42,10 @@ spec:
5742
name: config-ui
5843
subPath: .env.production
5944
readOnly: true
45+
- mountPath: /app/motd.yaml
46+
name: config-ui
47+
subPath: motd.yaml
48+
readOnly: true
6049
env:
6150
# CICD_TRIGGER_ID is variable whose value is used to force
6251
# a redeployment of the underlying containers. This is used in
@@ -66,22 +55,6 @@ spec:
6655
# a roll-out will not occur if the tag has not changed.
6756
- name: CICD_TRIGGER_ID
6857
value: '{{ ansible_date_time.iso8601_micro }}'
69-
# readinessProbe:
70-
# tcpSocket:
71-
# port: 3000
72-
# initialDelaySeconds: 5
73-
# timeoutSeconds: 3
74-
# periodSeconds: 10
75-
# successThreshold: 1
76-
# failureThreshold: 6
77-
# livenessProbe:
78-
# tcpSocket:
79-
# port: 3000
80-
# initialDelaySeconds: 5
81-
# timeoutSeconds: 3
82-
# periodSeconds: 10
83-
# successThreshold: 1
84-
# failureThreshold: 6
8558
resources:
8659
requests:
8760
cpu: {{ maui_cpu_request }}

0 commit comments

Comments
 (0)