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