123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- # RBAC authn and authz
- apiVersion: v1
- kind: ServiceAccount
- metadata:
- name: elasticsearch-logging
- namespace: public-service
- labels:
- k8s-app: elasticsearch-logging
- addonmanager.kubernetes.io/mode: Reconcile
- ---
- kind: ClusterRole
- apiVersion: rbac.authorization.k8s.io/v1
- metadata:
- name: elasticsearch-logging
- labels:
- k8s-app: elasticsearch-logging
- addonmanager.kubernetes.io/mode: Reconcile
- rules:
- - apiGroups:
- - ""
- resources:
- - "services"
- - "namespaces"
- - "endpoints"
- verbs:
- - "get"
- ---
- kind: ClusterRoleBinding
- apiVersion: rbac.authorization.k8s.io/v1
- metadata:
- namespace: public-service
- name: elasticsearch-logging
- labels:
- k8s-app: elasticsearch-logging
- addonmanager.kubernetes.io/mode: Reconcile
- subjects:
- - kind: ServiceAccount
- name: elasticsearch-logging
- namespace: public-service
- apiGroup: ""
- roleRef:
- kind: ClusterRole
- name: elasticsearch-logging
- apiGroup: ""
- ---
- # Elasticsearch deployment itself
- apiVersion: apps/v1
- kind: StatefulSet
- metadata:
- name: elasticsearch-logging
- namespace: public-service
- labels:
- k8s-app: elasticsearch-logging
- version: v7.4.2
- addonmanager.kubernetes.io/mode: Reconcile
- spec:
- serviceName: elasticsearch-logging
- replicas: 1
- selector:
- matchLabels:
- k8s-app: elasticsearch-logging
- version: v7.4.2
- template:
- metadata:
- labels:
- k8s-app: elasticsearch-logging
- version: v7.4.2
- 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: 1Gi
- 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
- volumes:
- - 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
|