diff --git a/deploy/kubernetes/fluentd-sumologic.yaml.tmpl b/deploy/kubernetes/fluentd-sumologic.yaml.tmpl index 3fc2dbf6cd..07f061b07e 100644 --- a/deploy/kubernetes/fluentd-sumologic.yaml.tmpl +++ b/deploy/kubernetes/fluentd-sumologic.yaml.tmpl @@ -1,41 +1,6 @@ # This file is auto-generated. --- -# Source: sumologic/templates/logs-pdb.yaml -apiVersion: policy/v1beta1 -kind: PodDisruptionBudget -metadata: - name: collection-sumologic-fluentd-logs-pdb -spec: - selector: - matchLabels: - app: collection-sumologic-fluentd-logs - minAvailable: 2 - ---- -# Source: sumologic/templates/metrics-pdb.yaml -apiVersion: policy/v1beta1 -kind: PodDisruptionBudget -metadata: - name: collection-sumologic-fluentd-metrics-pdb -spec: - selector: - matchLabels: - app: collection-sumologic-fluentd-metrics - minAvailable: 2 - ---- -# Source: sumologic/templates/chart-configmap.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: sumologic-configmap -data: - fluentdLogs: collection-sumologic-fluentd-logs - fluentdMetrics: collection-sumologic-fluentd-metrics - fluentdNamespace: $NAMESPACE ---- # Source: sumologic/templates/configmap.yaml - apiVersion: v1 kind: ConfigMap metadata: @@ -80,7 +45,6 @@ data: log_level info - logs.conf: |- @type forward @@ -319,80 +283,81 @@ data: - --- -# Source: sumologic/templates/events-configmap.yaml - -apiVersion: v1 -kind: ConfigMap +# Source: sumologic/templates/events-statefulset.yaml +apiVersion: apps/v1 +kind: StatefulSet metadata: name: collection-sumologic-fluentd-events labels: app: collection-sumologic-fluentd-events -data: - fluent.conf: |- - @include events.conf - events.conf: |- - - @type events - deploy_namespace $NAMESPACE - - # Prevent fluentd from handling records containing its own logs. - - @type null - - # expose the Fluentd metrics to Prometheus - - @type prometheus - metrics_path /metrics - port 24231 - - - @type prometheus_output_monitor - - - @type http - port 9880 - bind 0.0.0.0 - - - @type copy - - @type sumologic - @id sumologic.endpoint.events - sumo_client "k8s_1.3.0" - endpoint "#{ENV['SUMO_ENDPOINT_DEFAULT_EVENTS_SOURCE']}" - data_type logs - disable_cookies true - verify_ssl "true" - proxy_uri "" - - @type file - path /fluentd/buffer/events - @include buffer.output.conf - - - - - log_level info - - - buffer.output.conf: |- - compress "gzip" - flush_interval "5s" - flush_thread_count "8" - chunk_limit_size "1m" - total_limit_size "128m" - queued_chunks_limit_size "128" - overflow_action drop_oldest_chunk - retry_max_interval "10m" - retry_forever "true" - - +spec: + selector: + matchLabels: + app: collection-sumologic-fluentd-events + serviceName: collection-sumologic-fluentd-events-headless + podManagementPolicy: "Parallel" + template: + metadata: + annotations: + labels: + app: collection-sumologic-fluentd-events + + spec: + serviceAccountName: collection-sumologic + volumes: + - name: config-volume + configMap: + name: collection-sumologic-fluentd-events + securityContext: + fsGroup: 999 + containers: + - name: fluentd-events + image: sumologic/kubernetes-fluentd:1.3.0 + imagePullPolicy: IfNotPresent + resources: + limits: + cpu: 200m + memory: 512Mi + requests: + cpu: 100m + memory: 256Mi + volumeMounts: + - name: config-volume + mountPath: /fluentd/etc/ + - name: buffer + mountPath: "/fluentd/buffer" + livenessProbe: + httpGet: + path: /fluentd.pod.healthcheck?json=%7B%22log%22%3A+%22health+check%22%7D + port: 9880 + initialDelaySeconds: 300 + periodSeconds: 30 + timeoutSeconds: 3 + readinessProbe: + httpGet: + path: /fluentd.pod.healthcheck?json=%7B%22log%22%3A+%22health+check%22%7D + port: 9880 + initialDelaySeconds: 30 + periodSeconds: 5 + env: + - name: SUMO_ENDPOINT_DEFAULT_EVENTS_SOURCE + valueFrom: + secretKeyRef: + name: sumologic + key: endpoint-events + volumeClaimTemplates: + - metadata: + name: buffer + spec: + accessModes: [ReadWriteOnce] + storageClassName: + resources: + requests: + storage: 10Gi --- # Source: sumologic/templates/metrics-configmap.yaml - apiVersion: v1 kind: ConfigMap metadata: @@ -437,7 +402,6 @@ data: log_level info - metrics.conf: |- @type http @@ -629,45 +593,6 @@ data: metric_data_format prometheus disable_cookies true proxy_uri "" - ---- -# Source: sumologic/templates/serviceaccount.yaml -apiVersion: v1 -kind: ServiceAccount -metadata: - name: collection-sumologic - labels: - app: collection-sumologic - ---- -# Source: sumologic/templates/clusterrole.yaml -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: collection-sumologic - labels: - app: collection-sumologic - -rules: -- apiGroups: ["", "apps", "extensions", "events.k8s.io"] - resources: - - configmaps - - daemonsets - - deployments - - endpoints - - events - - namespaces - - nodes - - pods - - replicasets - - services - - statefulsets - verbs: ["get", "list", "watch"] -- apiGroups: [""] - resources: - - configmaps - verbs: ["create", "patch"] - --- # Source: sumologic/templates/clusterrolebinding.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -686,190 +611,98 @@ roleRef: name: collection-sumologic apiGroup: rbac.authorization.k8s.io --- -# Source: sumologic/templates/events-service-headless.yaml - +# Source: sumologic/templates/metrics-service.yaml apiVersion: v1 kind: Service metadata: - name: collection-sumologic-fluentd-events-headless + name: collection-sumologic-fluentd-metrics labels: - app: collection-sumologic-fluentd-events-headless + app: collection-sumologic-fluentd-metrics + sumologic.com/app: fluentd-metrics + sumologic.com/component: metrics spec: selector: - app: collection-sumologic-fluentd-events - clusterIP: None + app: collection-sumologic-fluentd-metrics ports: + - name: prom-write + port: 9888 + targetPort: 9888 + protocol: TCP - name: metrics port: 24231 targetPort: 24231 protocol: TCP --- -# Source: sumologic/templates/events-service.yaml - +# Source: sumologic/templates/serviceaccount.yaml apiVersion: v1 -kind: Service +kind: ServiceAccount metadata: - name: collection-sumologic-fluentd-events + name: collection-sumologic labels: - app: collection-sumologic-fluentd-events - sumologic.com/app: fluentd-events - sumologic.com/component: events - -spec: - selector: - app: collection-sumologic-fluentd-events - ports: - - name: metrics - port: 24231 - targetPort: 24231 - protocol: TCP + app: collection-sumologic --- -# Source: sumologic/templates/metrics-service-headless.yaml - -apiVersion: v1 -kind: Service +# Source: sumologic/templates/statefulset.yaml +apiVersion: apps/v1 +kind: StatefulSet metadata: - name: collection-sumologic-fluentd-metrics-headless + name: collection-sumologic-fluentd-logs labels: - app: collection-sumologic-fluentd-metrics-headless - -spec: - selector: - app: collection-sumologic-fluentd-metrics - clusterIP: None - ports: - - name: prom-write - port: 9888 - targetPort: 9888 - protocol: TCP - - name: metrics - port: 24231 - targetPort: 24231 - protocol: TCP - ---- -# Source: sumologic/templates/metrics-service.yaml - -apiVersion: v1 -kind: Service -metadata: - name: collection-sumologic-fluentd-metrics - labels: - app: collection-sumologic-fluentd-metrics - sumologic.com/app: fluentd-metrics - sumologic.com/component: metrics - -spec: - selector: - app: collection-sumologic-fluentd-metrics - ports: - - name: prom-write - port: 9888 - targetPort: 9888 - protocol: TCP - - name: metrics - port: 24231 - targetPort: 24231 - protocol: TCP - ---- -# Source: sumologic/templates/service-headless.yaml - -apiVersion: v1 -kind: Service -metadata: - name: collection-sumologic-fluentd-logs-headless - labels: - app: collection-sumologic-fluentd-logs-headless - -spec: - selector: - app: collection-sumologic-fluentd-logs - clusterIP: None - ports: - - name: fluent-bit - port: 24321 - targetPort: 24321 - protocol: TCP - - name: metrics - port: 24231 - targetPort: 24231 - protocol: TCP - ---- -# Source: sumologic/templates/service.yaml - -apiVersion: v1 -kind: Service -metadata: - name: collection-sumologic-fluentd-logs - labels: - app: collection-sumologic-fluentd-logs - sumologic.com/app: fluentd-logs - sumologic.com/component: logs - -spec: - selector: - app: collection-sumologic-fluentd-logs - ports: - - name: fluent-bit - port: 24321 - targetPort: 24321 - protocol: TCP - - name: metrics - port: 24231 - targetPort: 24231 - protocol: TCP - ---- -# Source: sumologic/templates/events-statefulset.yaml - -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: collection-sumologic-fluentd-events - labels: - app: collection-sumologic-fluentd-events + app: collection-sumologic-fluentd-logs spec: selector: matchLabels: - app: collection-sumologic-fluentd-events - serviceName: collection-sumologic-fluentd-events-headless + app: collection-sumologic-fluentd-logs + serviceName: collection-sumologic-fluentd-logs-headless podManagementPolicy: "Parallel" + replicas: 3 template: metadata: annotations: labels: - app: collection-sumologic-fluentd-events + app: collection-sumologic-fluentd-logs spec: serviceAccountName: collection-sumologic + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - collection-sumologic-fluentd-logs + - collection-sumologic-fluentd-metrics + - key: app + operator: In + values: + - prometheus-operator-prometheus + topologyKey: "kubernetes.io/hostname" volumes: - name: config-volume configMap: - name: collection-sumologic-fluentd-events + name: collection-sumologic-fluentd-logs securityContext: fsGroup: 999 - containers: - - name: fluentd-events + - name: fluentd image: sumologic/kubernetes-fluentd:1.3.0 imagePullPolicy: IfNotPresent resources: limits: - cpu: 200m - memory: 512Mi + cpu: 1000m + memory: 1Gi requests: - cpu: 100m - memory: 256Mi - - volumeMounts: - - name: config-volume - mountPath: /fluentd/etc/ - - name: buffer - mountPath: "/fluentd/buffer" + cpu: 500m + memory: 768Mi + ports: + - name: fluent-bit + containerPort: 24321 + protocol: TCP livenessProbe: httpGet: path: /fluentd.pod.healthcheck?json=%7B%22log%22%3A+%22health+check%22%7D @@ -883,12 +716,19 @@ spec: port: 9880 initialDelaySeconds: 30 periodSeconds: 5 + volumeMounts: + - name: config-volume + mountPath: /fluentd/etc/ + - name: buffer + mountPath: "/fluentd/buffer" env: - - name: SUMO_ENDPOINT_DEFAULT_EVENTS_SOURCE + - name: SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE valueFrom: secretKeyRef: name: sumologic - key: endpoint-events + key: endpoint-logs + - name: ADDITIONAL_PLUGINS + value: "" volumeClaimTemplates: - metadata: name: buffer @@ -899,8 +739,175 @@ spec: requests: storage: 10Gi --- +# Source: sumologic/templates/clusterrole.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: collection-sumologic + labels: + app: collection-sumologic + +rules: +- apiGroups: ["", "apps", "extensions", "events.k8s.io"] + resources: + - configmaps + - daemonsets + - deployments + - endpoints + - events + - namespaces + - nodes + - pods + - replicasets + - services + - statefulsets + verbs: ["get", "list", "watch"] +- apiGroups: [""] + resources: + - configmaps + verbs: ["create", "patch"] +--- +# Source: sumologic/templates/chart-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: sumologic-configmap +data: + fluentdLogs: collection-sumologic-fluentd-logs + fluentdMetrics: collection-sumologic-fluentd-metrics + fluentdNamespace: $NAMESPACE +--- +# Source: sumologic/templates/metrics-pdb.yaml +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: collection-sumologic-fluentd-metrics-pdb +spec: + selector: + matchLabels: + app: collection-sumologic-fluentd-metrics + minAvailable: 2 +--- +# Source: sumologic/templates/events-service.yaml +apiVersion: v1 +kind: Service +metadata: + name: collection-sumologic-fluentd-events + labels: + app: collection-sumologic-fluentd-events + sumologic.com/app: fluentd-events + sumologic.com/component: events + +spec: + selector: + app: collection-sumologic-fluentd-events + ports: + - name: metrics + port: 24231 + targetPort: 24231 + protocol: TCP +--- +# Source: sumologic/templates/logs-pdb.yaml +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: collection-sumologic-fluentd-logs-pdb +spec: + selector: + matchLabels: + app: collection-sumologic-fluentd-logs + minAvailable: 2 +--- +# Source: sumologic/templates/events-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: collection-sumologic-fluentd-events + labels: + app: collection-sumologic-fluentd-events + +data: + fluent.conf: |- + @include events.conf + events.conf: |- + + @type events + deploy_namespace $NAMESPACE + + # Prevent fluentd from handling records containing its own logs. + + @type null + + # expose the Fluentd metrics to Prometheus + + @type prometheus + metrics_path /metrics + port 24231 + + + @type prometheus_output_monitor + + + @type http + port 9880 + bind 0.0.0.0 + + + @type copy + + @type sumologic + @id sumologic.endpoint.events + sumo_client "k8s_1.3.0" + endpoint "#{ENV['SUMO_ENDPOINT_DEFAULT_EVENTS_SOURCE']}" + data_type logs + disable_cookies true + verify_ssl "true" + proxy_uri "" + + @type file + path /fluentd/buffer/events + @include buffer.output.conf + + + + + log_level info + + buffer.output.conf: |- + compress "gzip" + flush_interval "5s" + flush_thread_count "8" + chunk_limit_size "1m" + total_limit_size "128m" + queued_chunks_limit_size "128" + overflow_action drop_oldest_chunk + retry_max_interval "10m" + retry_forever "true" +--- +# Source: sumologic/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: collection-sumologic-fluentd-logs + labels: + app: collection-sumologic-fluentd-logs + sumologic.com/app: fluentd-logs + sumologic.com/component: logs + +spec: + selector: + app: collection-sumologic-fluentd-logs + ports: + - name: fluent-bit + port: 24321 + targetPort: 24321 + protocol: TCP + - name: metrics + port: 24231 + targetPort: 24231 + protocol: TCP +--- # Source: sumologic/templates/metrics-statefulset.yaml - apiVersion: apps/v1 kind: StatefulSet metadata: @@ -946,7 +953,6 @@ spec: name: collection-sumologic-fluentd-metrics securityContext: fsGroup: 999 - containers: - name: fluentd image: sumologic/kubernetes-fluentd:1.3.0 @@ -958,7 +964,6 @@ spec: requests: cpu: 500m memory: 768Mi - ports: - name: prom-write containerPort: 9888 @@ -1033,130 +1038,65 @@ spec: resources: requests: storage: 10Gi - --- -# Source: sumologic/templates/statefulset.yaml - -apiVersion: apps/v1 -kind: StatefulSet +# Source: sumologic/templates/service-headless.yaml +apiVersion: v1 +kind: Service metadata: - name: collection-sumologic-fluentd-logs + name: collection-sumologic-fluentd-logs-headless labels: - app: collection-sumologic-fluentd-logs + app: collection-sumologic-fluentd-logs-headless spec: selector: - matchLabels: - app: collection-sumologic-fluentd-logs - serviceName: collection-sumologic-fluentd-logs-headless - podManagementPolicy: "Parallel" - replicas: 3 - template: - metadata: - annotations: - labels: - app: collection-sumologic-fluentd-logs - - spec: - serviceAccountName: collection-sumologic - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - collection-sumologic-fluentd-logs - - collection-sumologic-fluentd-metrics - - key: app - operator: In - values: - - prometheus-operator-prometheus - topologyKey: "kubernetes.io/hostname" - volumes: - - name: config-volume - configMap: - name: collection-sumologic-fluentd-logs - securityContext: - fsGroup: 999 - - containers: - - name: fluentd - image: sumologic/kubernetes-fluentd:1.3.0 - imagePullPolicy: IfNotPresent - resources: - limits: - cpu: 1000m - memory: 1Gi - requests: - cpu: 500m - memory: 768Mi - - ports: - - name: fluent-bit - containerPort: 24321 - protocol: TCP - livenessProbe: - httpGet: - path: /fluentd.pod.healthcheck?json=%7B%22log%22%3A+%22health+check%22%7D - port: 9880 - initialDelaySeconds: 300 - periodSeconds: 30 - timeoutSeconds: 3 - readinessProbe: - httpGet: - path: /fluentd.pod.healthcheck?json=%7B%22log%22%3A+%22health+check%22%7D - port: 9880 - initialDelaySeconds: 30 - periodSeconds: 5 - volumeMounts: - - name: config-volume - mountPath: /fluentd/etc/ - - name: buffer - mountPath: "/fluentd/buffer" - env: - - name: SUMO_ENDPOINT_DEFAULT_LOGS_SOURCE - valueFrom: - secretKeyRef: - name: sumologic - key: endpoint-logs - - name: ADDITIONAL_PLUGINS - value: "" - volumeClaimTemplates: - - metadata: - name: buffer - spec: - accessModes: [ReadWriteOnce] - storageClassName: - resources: - requests: - storage: 10Gi - ---- -# Source: sumologic/templates/hpa.yaml - ---- -# Source: sumologic/templates/metrics-hpa.yaml - ---- -# Source: sumologic/templates/otelcol-configmap.yaml - ---- -# Source: sumologic/templates/otelcol-deployment.yaml - - ---- -# Source: sumologic/templates/otelcol-service.yaml - - + app: collection-sumologic-fluentd-logs + clusterIP: None + ports: + - name: fluent-bit + port: 24321 + targetPort: 24321 + protocol: TCP + - name: metrics + port: 24231 + targetPort: 24231 + protocol: TCP --- -# Source: sumologic/templates/psp.yaml - - +# Source: sumologic/templates/metrics-service-headless.yaml +apiVersion: v1 +kind: Service +metadata: + name: collection-sumologic-fluentd-metrics-headless + labels: + app: collection-sumologic-fluentd-metrics-headless + +spec: + selector: + app: collection-sumologic-fluentd-metrics + clusterIP: None + ports: + - name: prom-write + port: 9888 + targetPort: 9888 + protocol: TCP + - name: metrics + port: 24231 + targetPort: 24231 + protocol: TCP --- -# Source: sumologic/templates/scc.yaml - - +# Source: sumologic/templates/events-service-headless.yaml +apiVersion: v1 +kind: Service +metadata: + name: collection-sumologic-fluentd-events-headless + labels: + app: collection-sumologic-fluentd-events-headless + +spec: + selector: + app: collection-sumologic-fluentd-events + clusterIP: None + ports: + - name: metrics + port: 24231 + targetPort: 24231 + protocol: TCP