Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 1 | # |
| 2 | # This file describes a cluster of 3 fluentd forwarders that |
| 3 | # send logs to a cluster of 2 fluentd aggregators: one active |
| 4 | # and one standby. |
| 5 | # |
| 6 | # The active fluentd aggregator |
| 7 | # |
| 8 | apiVersion: v1 |
| 9 | kind: Service |
| 10 | metadata: |
| 11 | name: fluentdactv |
| 12 | spec: |
| 13 | clusterIP: None |
| 14 | selector: |
| 15 | app: fluentdactv |
| 16 | ports: |
| 17 | - protocol: TCP |
| 18 | port: 24224 |
| 19 | targetPort: 24224 |
| 20 | --- |
| 21 | # |
| 22 | # Ensure that the active aggregator is not deployed to the |
| 23 | # same node as the standby |
| 24 | # |
| 25 | apiVersion: apps/v1beta1 |
| 26 | kind: Deployment |
| 27 | metadata: |
| 28 | name: fluentdactv |
| 29 | spec: |
| 30 | replicas: 1 |
| 31 | template: |
| 32 | metadata: |
| 33 | labels: |
| 34 | app: fluentdactv |
| 35 | spec: |
| 36 | terminationGracePeriodSeconds: 10 |
| 37 | affinity: |
| 38 | podAntiAffinity: |
| 39 | requiredDuringSchedulingIgnoredDuringExecution: |
| 40 | - labelSelector: |
| 41 | matchExpressions: |
| 42 | - key: app |
| 43 | operator: In |
| 44 | values: |
| 45 | - fluentdstby |
| 46 | topologyKey: kubernetes.io/hostname |
| 47 | containers: |
| 48 | - name: fluentdactv |
| 49 | image: cord/fluentd |
| 50 | imagePullPolicy: Never |
| 51 | volumeMounts: |
| 52 | - name: fluentd-log |
| 53 | mountPath: /fluentd/log |
| 54 | ports: |
| 55 | - containerPort: 24224 |
| 56 | env: |
| 57 | - name: FLUENTD_CONF |
| 58 | value: fluent-agg.conf |
| 59 | volumes: |
| 60 | - name: fluentd-log |
| 61 | hostPath: |
| 62 | path: /var/log/voltha/logging_volume |
| 63 | type: Directory |
| 64 | --- |
| 65 | # |
| 66 | # The standby fluentd aggregator |
| 67 | # |
| 68 | apiVersion: v1 |
| 69 | kind: Service |
| 70 | metadata: |
| 71 | name: fluentdstby |
| 72 | spec: |
| 73 | clusterIP: None |
| 74 | selector: |
| 75 | app: fluentdstby |
| 76 | ports: |
| 77 | - protocol: TCP |
| 78 | port: 24224 |
| 79 | targetPort: 24224 |
| 80 | --- |
| 81 | # |
| 82 | # Ensure thet the standby aggregator is not deployed to the |
| 83 | # same node as the active |
| 84 | # |
| 85 | apiVersion: apps/v1beta1 |
| 86 | kind: Deployment |
| 87 | metadata: |
| 88 | name: fluentdstby |
| 89 | spec: |
| 90 | replicas: 1 |
| 91 | template: |
| 92 | metadata: |
| 93 | labels: |
| 94 | app: fluentdstby |
| 95 | spec: |
| 96 | terminationGracePeriodSeconds: 10 |
| 97 | affinity: |
| 98 | podAntiAffinity: |
| 99 | requiredDuringSchedulingIgnoredDuringExecution: |
| 100 | - labelSelector: |
| 101 | matchExpressions: |
| 102 | - key: app |
| 103 | operator: In |
| 104 | values: |
| 105 | - fluentdactv |
| 106 | topologyKey: kubernetes.io/hostname |
| 107 | containers: |
| 108 | - name: fluentdstby |
| 109 | image: cord/fluentd |
| 110 | imagePullPolicy: Never |
| 111 | volumeMounts: |
| 112 | - name: fluentd-log |
| 113 | mountPath: /fluentd/log |
| 114 | ports: |
| 115 | - containerPort: 24224 |
| 116 | env: |
| 117 | - name: FLUENTD_CONF |
| 118 | value: fluent-agg.conf |
| 119 | volumes: |
| 120 | - name: fluentd-log |
| 121 | hostPath: |
| 122 | path: /var/log/voltha/logging_volume |
| 123 | type: Directory |
| 124 | --- |
| 125 | # |
| 126 | # The cluster of fluentd forwarders |
| 127 | # |
| 128 | apiVersion: v1 |
| 129 | kind: Service |
| 130 | metadata: |
| 131 | name: fluentd |
| 132 | spec: |
| 133 | clusterIP: None |
| 134 | selector: |
| 135 | app: fluentd |
| 136 | ports: |
| 137 | - protocol: TCP |
| 138 | port: 24224 |
| 139 | targetPort: 24224 |
| 140 | --- |
| 141 | apiVersion: apps/v1beta1 |
| 142 | kind: Deployment |
| 143 | metadata: |
| 144 | name: fluentd |
| 145 | spec: |
| 146 | replicas: 3 |
| 147 | template: |
| 148 | metadata: |
| 149 | labels: |
| 150 | app: fluentd |
| 151 | spec: |
| 152 | terminationGracePeriodSeconds: 10 |
| 153 | affinity: |
| 154 | podAntiAffinity: |
| 155 | requiredDuringSchedulingIgnoredDuringExecution: |
| 156 | - labelSelector: |
| 157 | matchExpressions: |
| 158 | - key: app |
| 159 | operator: In |
| 160 | values: |
| 161 | - fluentd |
| 162 | topologyKey: kubernetes.io/hostname |
| 163 | containers: |
| 164 | - name: fluentd |
| 165 | image: cord/fluentd |
| 166 | imagePullPolicy: Never |
| 167 | ports: |
| 168 | - containerPort: 24224 |
| 169 | env: |
| 170 | - name: FLUENTD_CONF |
| 171 | value: fluent.conf |