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 |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 12 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 13 | spec: |
| 14 | clusterIP: None |
| 15 | selector: |
| 16 | app: fluentdactv |
| 17 | ports: |
| 18 | - protocol: TCP |
| 19 | port: 24224 |
| 20 | targetPort: 24224 |
| 21 | --- |
| 22 | # |
| 23 | # Ensure that the active aggregator is not deployed to the |
| 24 | # same node as the standby |
| 25 | # |
| 26 | apiVersion: apps/v1beta1 |
| 27 | kind: Deployment |
| 28 | metadata: |
| 29 | name: fluentdactv |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 30 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 31 | spec: |
| 32 | replicas: 1 |
| 33 | template: |
| 34 | metadata: |
| 35 | labels: |
| 36 | app: fluentdactv |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 37 | annotations: |
| 38 | cni: "weave" |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 39 | spec: |
| 40 | terminationGracePeriodSeconds: 10 |
| 41 | affinity: |
| 42 | podAntiAffinity: |
| 43 | requiredDuringSchedulingIgnoredDuringExecution: |
| 44 | - labelSelector: |
| 45 | matchExpressions: |
| 46 | - key: app |
| 47 | operator: In |
| 48 | values: |
| 49 | - fluentdstby |
| 50 | topologyKey: kubernetes.io/hostname |
| 51 | containers: |
| 52 | - name: fluentdactv |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 53 | image: k8s.gcr.io/fluentd-gcp:1.30 |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 54 | imagePullPolicy: Never |
| 55 | volumeMounts: |
| 56 | - name: fluentd-log |
| 57 | mountPath: /fluentd/log |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 58 | - name: config-volume |
| 59 | mountPath: /etc/fluentd-config |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 60 | ports: |
| 61 | - containerPort: 24224 |
| 62 | env: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 63 | - name: FLUENTD_ARGS |
| 64 | value: -c /etc/fluentd-config/fluentd-agg.conf |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 65 | volumes: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 66 | - name: config-volume |
| 67 | configMap: |
| 68 | name: fluentd-config |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 69 | - name: fluentd-log |
| 70 | hostPath: |
| 71 | path: /var/log/voltha/logging_volume |
| 72 | type: Directory |
| 73 | --- |
| 74 | # |
| 75 | # The standby fluentd aggregator |
| 76 | # |
| 77 | apiVersion: v1 |
| 78 | kind: Service |
| 79 | metadata: |
| 80 | name: fluentdstby |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 81 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 82 | spec: |
| 83 | clusterIP: None |
| 84 | selector: |
| 85 | app: fluentdstby |
| 86 | ports: |
| 87 | - protocol: TCP |
| 88 | port: 24224 |
| 89 | targetPort: 24224 |
| 90 | --- |
| 91 | # |
| 92 | # Ensure thet the standby aggregator is not deployed to the |
| 93 | # same node as the active |
| 94 | # |
| 95 | apiVersion: apps/v1beta1 |
| 96 | kind: Deployment |
| 97 | metadata: |
| 98 | name: fluentdstby |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 99 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 100 | spec: |
| 101 | replicas: 1 |
| 102 | template: |
| 103 | metadata: |
| 104 | labels: |
| 105 | app: fluentdstby |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 106 | annotations: |
| 107 | cni: "weave" |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 108 | spec: |
| 109 | terminationGracePeriodSeconds: 10 |
| 110 | affinity: |
| 111 | podAntiAffinity: |
| 112 | requiredDuringSchedulingIgnoredDuringExecution: |
| 113 | - labelSelector: |
| 114 | matchExpressions: |
| 115 | - key: app |
| 116 | operator: In |
| 117 | values: |
| 118 | - fluentdactv |
| 119 | topologyKey: kubernetes.io/hostname |
| 120 | containers: |
| 121 | - name: fluentdstby |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 122 | image: k8s.gcr.io/fluentd-gcp:1.30 |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 123 | imagePullPolicy: Never |
| 124 | volumeMounts: |
| 125 | - name: fluentd-log |
| 126 | mountPath: /fluentd/log |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 127 | - name: config-volume |
| 128 | mountPath: /etc/fluentd-config |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 129 | ports: |
| 130 | - containerPort: 24224 |
| 131 | env: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 132 | - name: FLUENTD_ARGS |
| 133 | value: -c /etc/fluentd-config/fluentd-agg.conf |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 134 | volumes: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 135 | - name: config-volume |
| 136 | configMap: |
| 137 | name: fluentd-config |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 138 | - name: fluentd-log |
| 139 | hostPath: |
| 140 | path: /var/log/voltha/logging_volume |
| 141 | type: Directory |
| 142 | --- |
| 143 | # |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 144 | # The cluster of fluentd forwarders. The service itself will be removed once all fluentd forwarding logic are removed |
| 145 | # from the specific voltha services. Fluentd is defined as a DaemonSet which implies that only 1 instance will |
| 146 | # run on each node. Each instance will also gets its configuration data from a config map (fluentd-config.yml). |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 147 | # |
| 148 | apiVersion: v1 |
| 149 | kind: Service |
| 150 | metadata: |
| 151 | name: fluentd |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 152 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 153 | spec: |
| 154 | clusterIP: None |
| 155 | selector: |
| 156 | app: fluentd |
| 157 | ports: |
| 158 | - protocol: TCP |
| 159 | port: 24224 |
| 160 | targetPort: 24224 |
| 161 | --- |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 162 | apiVersion: extensions/v1beta1 |
| 163 | kind: DaemonSet |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 164 | metadata: |
| 165 | name: fluentd |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 166 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 167 | spec: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 168 | template: |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 169 | metadata: |
| 170 | labels: |
| 171 | app: fluentd |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 172 | annotations: |
| 173 | cni: "weave" |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 174 | spec: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 175 | tolerations: |
| 176 | - key: node-role.kubernetes.io/master |
| 177 | effect: NoSchedule |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 178 | containers: |
| 179 | - name: fluentd |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 180 | image: k8s.gcr.io/fluentd-gcp:1.30 |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 181 | env: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 182 | - name: FLUENTD_ARGS |
| 183 | value: -c /etc/fluentd-config/fluentd.conf |
| 184 | volumeMounts: |
| 185 | - name: varlog |
| 186 | mountPath: /var/log/ |
| 187 | - name: varlogcontainers |
| 188 | mountPath: /var/lib/docker/containers/ |
| 189 | - name: config-volume |
| 190 | mountPath: /etc/fluentd-config |
| 191 | volumes: |
| 192 | - name: varlog |
| 193 | hostPath: |
| 194 | path: /var/log/ |
| 195 | - name: varlogcontainers |
| 196 | hostPath: |
| 197 | path: /var/lib/docker/containers/ |
| 198 | - name: config-volume |
| 199 | configMap: |
| 200 | name: fluentd-config |