Browse Source

Creating a priority class for cluster-logging fluentd and configuring fluentd to use it

Eric Wolinetz 6 years ago
parent
commit
4ac04541c9

+ 7 - 0
roles/openshift_logging_fluentd/files/logging_priority_class.yaml

@@ -0,0 +1,7 @@
+apiVersion: scheduling.k8s.io/v1beta1
+kind: PriorityClass
+metadata:
+  name: cluster-logging
+value: 100000
+globalDefault: false
+description: "This priority class for the Cluster-Logging Fluentd Application"

+ 15 - 0
roles/openshift_logging_fluentd/tasks/main.yaml

@@ -149,6 +149,21 @@
       - name: ops-cert
         path: "{{ openshift_logging_fluentd_ops_cert_path | default(generated_certs_dir ~ '/system.logging.fluentd.crt') }}"
 
+- name: Copy cluster-logging priority class definition
+  copy:
+    src: "logging_priority_class.yaml"
+    dest: "{{ tempdir }}/templates/logging_priority_class.yaml"
+
+- name: Set cluster-logging priority class definition
+  oc_obj:
+    state: present
+    name: cluster-logging
+    namespace: "{{ openshift_logging_fluentd_namespace }}"
+    kind: priorityclass
+    files:
+      - "{{ tempdir }}/templates/logging_priority_class.yaml"
+    delete_after: true
+
 # create Fluentd daemonset
 # this should change based on the type of fluentd deployment to be done...
 # TODO: pass in aggregation configurations

+ 1 - 1
roles/openshift_logging_fluentd/templates/fluentd.j2

@@ -29,7 +29,7 @@ spec:
       annotations:
         scheduler.alpha.kubernetes.io/critical-pod: ''
     spec:
-      priorityClassName: system-cluster-critical
+      priorityClassName: cluster-logging
       serviceAccountName: "{{ daemonset_serviceAccount }}"
       nodeSelector:
         {{ fluentd_nodeselector_key }}: "{{ fluentd_nodeselector_value }}"