Skip to content

Commit 9ca553d

Browse files
author
Alan Christie
committed
feat: Add priority classes
1 parent f5b2b9b commit 9ca553d

7 files changed

Lines changed: 18 additions & 2 deletions

File tree

parameters-local.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
# Here we assume you have setup /etc/hosts so that the following hostnames
55
# resolve to the IP address of the host running the cluster:
66
#
7+
# - keycloak
78
# - rabbitmq
89

910
k8s_kubeconfig: "{{ lookup('env', 'KUBECONFIG') }}"
1011

12+
core_deploy_cluster_issuer: no
13+
infra_priority_class: im-application-critical
14+
1115
ingress_class: "{{ lookup('env', 'IM_DEV_INGRESS_CLASS') | default('nginx', True)}}"
1216

1317
ic_state: absent

roles/core/defaults/main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# One of 'present' or 'absent'.
55
core_state: present
66

7+
core_deploy_priority_classes: yes
78
# If deploying (or un-deploying) priority classes
89
# do we also include the default?
910
core_include_default_priority_class: yes

roles/core/templates/pc-im.yaml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ kind: PriorityClass
8787
apiVersion: scheduling.k8s.io/v1
8888
metadata:
8989
name: im-default
90-
value: 83003000
90+
value: 83001000
9191
globalDefault: true
9292
description: >-
93-
The Priority Class adopted when another is not specified.
93+
The Priority Class adopted for new objects when another is not specified.
9494
{% endif %}

roles/infrastructure/defaults/main.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# If we un-deploy the entire infrastructure deployment is removed -
66
# the namespace, database, PSPs etc.
77
infra_state: present
8+
# The priority class applied to DB, keycloak and RabbitMQ (if set)
9+
infra_priority_class: ''
810

911
# If set, use this kubernetes config, rather than K8S credentials.
1012
# You would set this if executing the playbooks locally, i.e. not from

roles/infrastructure/templates/statefulset-keycloak.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ spec:
1616
labels:
1717
app: keycloak
1818
spec:
19+
{% if infra_priority_class %}
20+
priorityClassName: {{ infra_priority_class }}
21+
{% endif %}
1922
serviceAccountName: {{ infra_namespace_service_account }}
2023

2124
# A 'preferred' (not guaranteed)

roles/infrastructure/templates/statefulset-postgres.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ spec:
1616
labels:
1717
app: database
1818
spec:
19+
{% if infra_priority_class %}
20+
priorityClassName: {{ infra_priority_class }}
21+
{% endif %}
1922
serviceAccountName: {{ infra_namespace_service_account }}
2023

2124
# A 'preferred' (not guaranteed)

roles/infrastructure/templates/statefulset-rabbitmq.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ spec:
1414
labels:
1515
name: rabbitmq
1616
spec:
17+
{% if infra_priority_class %}
18+
priorityClassName: {{ infra_priority_class }}
19+
{% endif %}
1720
serviceAccountName: {{ infra_namespace_service_account }}
1821

1922
# We must have a 'core' node

0 commit comments

Comments
 (0)