From 60272a773094c04d0ab6fed263858e4686005bf0 Mon Sep 17 00:00:00 2001 From: Pat Christopher Date: Sat, 3 Oct 2020 22:54:17 -0500 Subject: [PATCH] v1.18 support changes --- .../fluentd-elasticsearch/es-service.yaml | 15 ++- .../fluentd-elasticsearch/es-statefulset.yaml | 112 +++++++++--------- 2 files changed, 69 insertions(+), 58 deletions(-) diff --git a/cluster/addons/fluentd-elasticsearch/es-service.yaml b/cluster/addons/fluentd-elasticsearch/es-service.yaml index ede9306bb89..7f947d7fda5 100644 --- a/cluster/addons/fluentd-elasticsearch/es-service.yaml +++ b/cluster/addons/fluentd-elasticsearch/es-service.yaml @@ -9,9 +9,18 @@ metadata: addonmanager.kubernetes.io/mode: Reconcile kubernetes.io/name: "Elasticsearch" spec: + clusterIP: None ports: - - port: 9200 - protocol: TCP - targetPort: db + - name: db + port: 9200 + protocol: TCP + targetPort: 9200 + - name: transport + port: 9300 + protocol: TCP + targetPort: 9300 + publishNotReadyAddresses: true selector: k8s-app: elasticsearch-logging + sessionAffinity: None + type: ClusterIP diff --git a/cluster/addons/fluentd-elasticsearch/es-statefulset.yaml b/cluster/addons/fluentd-elasticsearch/es-statefulset.yaml index 460386e8c86..9a28350cb87 100644 --- a/cluster/addons/fluentd-elasticsearch/es-statefulset.yaml +++ b/cluster/addons/fluentd-elasticsearch/es-statefulset.yaml @@ -16,14 +16,14 @@ metadata: k8s-app: elasticsearch-logging addonmanager.kubernetes.io/mode: Reconcile rules: -- apiGroups: - - "" - resources: - - "services" - - "namespaces" - - "endpoints" - verbs: - - "get" + - apiGroups: + - "" + - resources: + - "services" + - "namespaces" + - "endpoints" + - verbs: + - "get" --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 @@ -34,10 +34,10 @@ metadata: k8s-app: elasticsearch-logging addonmanager.kubernetes.io/mode: Reconcile subjects: -- kind: ServiceAccount - name: elasticsearch-logging - namespace: kube-system - apiGroup: "" + - kind: ServiceAccount + name: elasticsearch-logging + namespace: kube-system + apiGroup: "" roleRef: kind: ClusterRole name: elasticsearch-logging @@ -68,51 +68,53 @@ spec: spec: serviceAccountName: elasticsearch-logging containers: - - image: quay.io/fluentd_elasticsearch/elasticsearch:v7.4.2 - name: elasticsearch-logging - imagePullPolicy: Always - resources: - # need more cpu upon initialization, therefore burstable class - limits: - cpu: 1000m - memory: 3Gi - requests: - cpu: 100m - memory: 3Gi - ports: - - containerPort: 9200 - name: db - protocol: TCP - - containerPort: 9300 - name: transport - protocol: TCP - livenessProbe: - tcpSocket: - port: transport - initialDelaySeconds: 5 - timeoutSeconds: 10 - readinessProbe: - tcpSocket: - port: transport - initialDelaySeconds: 5 - timeoutSeconds: 10 - volumeMounts: - - name: elasticsearch-logging - mountPath: /data - env: - - name: "NAMESPACE" - valueFrom: - fieldRef: - fieldPath: metadata.namespace + - image: quay.io/fluentd_elasticsearch/elasticsearch:v7.4.2 + name: elasticsearch-logging + imagePullPolicy: Always + resources: + # need more cpu upon initialization, therefore burstable class + limits: + cpu: 1000m + memory: 3Gi + requests: + cpu: 100m + memory: 3Gi + ports: + - containerPort: 9200 + name: db + protocol: TCP + - containerPort: 9300 + name: transport + protocol: TCP + livenessProbe: + tcpSocket: + port: transport + initialDelaySeconds: 5 + timeoutSeconds: 10 + readinessProbe: + tcpSocket: + port: transport + initialDelaySeconds: 5 + timeoutSeconds: 10 + volumeMounts: + - name: elasticsearch-logging + mountPath: /data + env: + - name: "NAMESPACE" + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: "MINIMUM_MASTER_NODES" + value: "1" volumes: - - name: elasticsearch-logging - emptyDir: {} + - name: elasticsearch-logging + emptyDir: {} # Elasticsearch requires vm.max_map_count to be at least 262144. # If your OS already sets up this number to a higher value, feel free # to remove this init container. initContainers: - - image: alpine:3.6 - command: ["/sbin/sysctl", "-w", "vm.max_map_count=262144"] - name: elasticsearch-logging-init - securityContext: - privileged: true + - image: alpine:3.6 + command: ["/sbin/sysctl", "-w", "vm.max_map_count=262144"] + name: elasticsearch-logging-init + securityContext: + privileged: true