Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 14 | # |
| 15 | # This file describes a cluster of 3 fluentd forwarders that |
| 16 | # send logs to a cluster of 2 fluentd aggregators: one active |
| 17 | # and one standby. |
| 18 | # |
| 19 | # The active fluentd aggregator |
| 20 | # |
| 21 | apiVersion: v1 |
| 22 | kind: Service |
| 23 | metadata: |
| 24 | name: fluentdactv |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 25 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 26 | spec: |
| 27 | clusterIP: None |
| 28 | selector: |
| 29 | app: fluentdactv |
| 30 | ports: |
| 31 | - protocol: TCP |
| 32 | port: 24224 |
| 33 | targetPort: 24224 |
| 34 | --- |
| 35 | # |
| 36 | # Ensure that the active aggregator is not deployed to the |
| 37 | # same node as the standby |
| 38 | # |
| 39 | apiVersion: apps/v1beta1 |
| 40 | kind: Deployment |
| 41 | metadata: |
| 42 | name: fluentdactv |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 43 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 44 | spec: |
| 45 | replicas: 1 |
| 46 | template: |
| 47 | metadata: |
| 48 | labels: |
| 49 | app: fluentdactv |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 50 | annotations: |
Stephane Barbarie | 2d4e07f | 2018-03-26 16:46:45 -0400 | [diff] [blame] | 51 | cni: "calico" |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 52 | spec: |
| 53 | terminationGracePeriodSeconds: 10 |
| 54 | affinity: |
| 55 | podAntiAffinity: |
| 56 | requiredDuringSchedulingIgnoredDuringExecution: |
| 57 | - labelSelector: |
| 58 | matchExpressions: |
| 59 | - key: app |
| 60 | operator: In |
| 61 | values: |
| 62 | - fluentdstby |
| 63 | topologyKey: kubernetes.io/hostname |
| 64 | containers: |
| 65 | - name: fluentdactv |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 66 | image: k8s.gcr.io/fluentd-gcp:1.30 |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 67 | imagePullPolicy: Never |
| 68 | volumeMounts: |
| 69 | - name: fluentd-log |
| 70 | mountPath: /fluentd/log |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 71 | - name: config-volume |
| 72 | mountPath: /etc/fluentd-config |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 73 | ports: |
| 74 | - containerPort: 24224 |
| 75 | env: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 76 | - name: FLUENTD_ARGS |
| 77 | value: -c /etc/fluentd-config/fluentd-agg.conf |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 78 | volumes: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 79 | - name: config-volume |
| 80 | configMap: |
| 81 | name: fluentd-config |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 82 | - name: fluentd-log |
| 83 | hostPath: |
| 84 | path: /var/log/voltha/logging_volume |
| 85 | type: Directory |
| 86 | --- |
| 87 | # |
| 88 | # The standby fluentd aggregator |
| 89 | # |
| 90 | apiVersion: v1 |
| 91 | kind: Service |
| 92 | metadata: |
| 93 | name: fluentdstby |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 94 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 95 | spec: |
| 96 | clusterIP: None |
| 97 | selector: |
| 98 | app: fluentdstby |
| 99 | ports: |
| 100 | - protocol: TCP |
| 101 | port: 24224 |
| 102 | targetPort: 24224 |
| 103 | --- |
| 104 | # |
| 105 | # Ensure thet the standby aggregator is not deployed to the |
| 106 | # same node as the active |
| 107 | # |
| 108 | apiVersion: apps/v1beta1 |
| 109 | kind: Deployment |
| 110 | metadata: |
| 111 | name: fluentdstby |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 112 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 113 | spec: |
| 114 | replicas: 1 |
| 115 | template: |
| 116 | metadata: |
| 117 | labels: |
| 118 | app: fluentdstby |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 119 | annotations: |
Stephane Barbarie | 2d4e07f | 2018-03-26 16:46:45 -0400 | [diff] [blame] | 120 | cni: "calico" |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 121 | spec: |
| 122 | terminationGracePeriodSeconds: 10 |
| 123 | affinity: |
| 124 | podAntiAffinity: |
| 125 | requiredDuringSchedulingIgnoredDuringExecution: |
| 126 | - labelSelector: |
| 127 | matchExpressions: |
| 128 | - key: app |
| 129 | operator: In |
| 130 | values: |
| 131 | - fluentdactv |
| 132 | topologyKey: kubernetes.io/hostname |
| 133 | containers: |
| 134 | - name: fluentdstby |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 135 | image: k8s.gcr.io/fluentd-gcp:1.30 |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 136 | imagePullPolicy: Never |
| 137 | volumeMounts: |
| 138 | - name: fluentd-log |
| 139 | mountPath: /fluentd/log |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 140 | - name: config-volume |
| 141 | mountPath: /etc/fluentd-config |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 142 | ports: |
| 143 | - containerPort: 24224 |
| 144 | env: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 145 | - name: FLUENTD_ARGS |
| 146 | value: -c /etc/fluentd-config/fluentd-agg.conf |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 147 | volumes: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 148 | - name: config-volume |
| 149 | configMap: |
| 150 | name: fluentd-config |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 151 | - name: fluentd-log |
| 152 | hostPath: |
| 153 | path: /var/log/voltha/logging_volume |
| 154 | type: Directory |
| 155 | --- |
| 156 | # |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 157 | # The cluster of fluentd forwarders. The service itself will be removed once all fluentd forwarding logic are removed |
| 158 | # from the specific voltha services. Fluentd is defined as a DaemonSet which implies that only 1 instance will |
| 159 | # 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] | 160 | # |
| 161 | apiVersion: v1 |
| 162 | kind: Service |
| 163 | metadata: |
| 164 | name: fluentd |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 165 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 166 | spec: |
| 167 | clusterIP: None |
| 168 | selector: |
| 169 | app: fluentd |
| 170 | ports: |
| 171 | - protocol: TCP |
| 172 | port: 24224 |
| 173 | targetPort: 24224 |
| 174 | --- |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 175 | apiVersion: extensions/v1beta1 |
| 176 | kind: DaemonSet |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 177 | metadata: |
| 178 | name: fluentd |
Richard Jankowski | d445438 | 2018-02-08 16:21:43 -0500 | [diff] [blame] | 179 | namespace: voltha |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 180 | spec: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 181 | template: |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 182 | metadata: |
| 183 | labels: |
| 184 | app: fluentd |
Stephane Barbarie | 5e8d9e4 | 2018-02-07 16:15:05 -0500 | [diff] [blame] | 185 | annotations: |
Stephane Barbarie | 2d4e07f | 2018-03-26 16:46:45 -0400 | [diff] [blame] | 186 | cni: "calico" |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 187 | spec: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 188 | tolerations: |
| 189 | - key: node-role.kubernetes.io/master |
| 190 | effect: NoSchedule |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 191 | containers: |
| 192 | - name: fluentd |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 193 | image: k8s.gcr.io/fluentd-gcp:1.30 |
Richard Jankowski | c9d8920 | 2018-01-25 10:25:10 -0500 | [diff] [blame] | 194 | env: |
khenaidoo | 1ee03e4 | 2018-02-20 12:45:41 -0500 | [diff] [blame] | 195 | - name: FLUENTD_ARGS |
| 196 | value: -c /etc/fluentd-config/fluentd.conf |
| 197 | volumeMounts: |
| 198 | - name: varlog |
| 199 | mountPath: /var/log/ |
| 200 | - name: varlogcontainers |
| 201 | mountPath: /var/lib/docker/containers/ |
| 202 | - name: config-volume |
| 203 | mountPath: /etc/fluentd-config |
| 204 | volumes: |
| 205 | - name: varlog |
| 206 | hostPath: |
| 207 | path: /var/log/ |
| 208 | - name: varlogcontainers |
| 209 | hostPath: |
| 210 | path: /var/lib/docker/containers/ |
| 211 | - name: config-volume |
| 212 | configMap: |
| 213 | name: fluentd-config |