2017-08-03 08:18:02 +00:00
|
|
|
# RBAC authn and authz
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
name: elasticsearch-logging
|
|
|
|
namespace: kube-system
|
|
|
|
labels:
|
|
|
|
k8s-app: elasticsearch-logging
|
|
|
|
kubernetes.io/cluster-service: "true"
|
|
|
|
addonmanager.kubernetes.io/mode: Reconcile
|
|
|
|
---
|
|
|
|
kind: ClusterRole
|
2017-08-21 09:29:10 +00:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2017-08-03 08:18:02 +00:00
|
|
|
metadata:
|
|
|
|
name: elasticsearch-logging
|
|
|
|
labels:
|
|
|
|
k8s-app: elasticsearch-logging
|
|
|
|
kubernetes.io/cluster-service: "true"
|
|
|
|
addonmanager.kubernetes.io/mode: Reconcile
|
|
|
|
rules:
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- "services"
|
|
|
|
- "namespaces"
|
|
|
|
- "endpoints"
|
|
|
|
verbs:
|
|
|
|
- "get"
|
|
|
|
---
|
|
|
|
kind: ClusterRoleBinding
|
2017-08-21 09:29:10 +00:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2017-08-03 08:18:02 +00:00
|
|
|
metadata:
|
|
|
|
namespace: kube-system
|
|
|
|
name: elasticsearch-logging
|
|
|
|
labels:
|
|
|
|
k8s-app: elasticsearch-logging
|
|
|
|
kubernetes.io/cluster-service: "true"
|
|
|
|
addonmanager.kubernetes.io/mode: Reconcile
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: elasticsearch-logging
|
|
|
|
namespace: kube-system
|
|
|
|
apiGroup: ""
|
|
|
|
roleRef:
|
|
|
|
kind: ClusterRole
|
|
|
|
name: elasticsearch-logging
|
|
|
|
apiGroup: ""
|
|
|
|
---
|
|
|
|
# Elasticsearch deployment itself
|
2017-10-01 10:25:31 +00:00
|
|
|
apiVersion: apps/v1beta2
|
2017-07-10 18:09:29 +00:00
|
|
|
kind: StatefulSet
|
2015-04-23 19:45:16 +00:00
|
|
|
metadata:
|
2017-08-03 08:18:02 +00:00
|
|
|
name: elasticsearch-logging
|
2015-06-25 04:55:40 +00:00
|
|
|
namespace: kube-system
|
2015-04-23 19:45:16 +00:00
|
|
|
labels:
|
2015-05-18 22:53:01 +00:00
|
|
|
k8s-app: elasticsearch-logging
|
2017-11-09 19:38:09 +00:00
|
|
|
version: v5.6.4
|
2015-04-23 19:45:16 +00:00
|
|
|
kubernetes.io/cluster-service: "true"
|
2017-02-25 00:53:12 +00:00
|
|
|
addonmanager.kubernetes.io/mode: Reconcile
|
2015-04-23 19:45:16 +00:00
|
|
|
spec:
|
2017-07-10 18:09:29 +00:00
|
|
|
serviceName: elasticsearch-logging
|
2015-05-08 20:48:51 +00:00
|
|
|
replicas: 2
|
2015-04-23 19:45:16 +00:00
|
|
|
selector:
|
2017-07-10 18:09:29 +00:00
|
|
|
matchLabels:
|
|
|
|
k8s-app: elasticsearch-logging
|
2017-11-09 19:38:09 +00:00
|
|
|
version: v5.6.4
|
2015-04-23 19:45:16 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2015-05-18 22:53:01 +00:00
|
|
|
k8s-app: elasticsearch-logging
|
2017-11-09 19:38:09 +00:00
|
|
|
version: v5.6.4
|
2015-04-23 19:45:16 +00:00
|
|
|
kubernetes.io/cluster-service: "true"
|
|
|
|
spec:
|
2017-05-22 08:47:48 +00:00
|
|
|
serviceAccountName: elasticsearch-logging
|
2015-04-23 19:45:16 +00:00
|
|
|
containers:
|
2017-11-09 19:38:09 +00:00
|
|
|
- image: gcr.io/google-containers/elasticsearch:v5.6.4
|
2016-10-17 19:04:25 +00:00
|
|
|
name: elasticsearch-logging
|
2015-07-01 22:08:35 +00:00
|
|
|
resources:
|
2016-09-21 11:55:43 +00:00
|
|
|
# need more cpu upon initialization, therefore burstable class
|
2015-07-01 22:08:35 +00:00
|
|
|
limits:
|
2016-09-21 11:55:43 +00:00
|
|
|
cpu: 1000m
|
2015-12-04 15:21:12 +00:00
|
|
|
requests:
|
|
|
|
cpu: 100m
|
2015-04-23 19:45:16 +00:00
|
|
|
ports:
|
|
|
|
- containerPort: 9200
|
2015-06-27 21:00:31 +00:00
|
|
|
name: db
|
2015-04-23 19:45:16 +00:00
|
|
|
protocol: TCP
|
|
|
|
- containerPort: 9300
|
2015-06-27 21:00:31 +00:00
|
|
|
name: transport
|
2015-04-23 19:45:16 +00:00
|
|
|
protocol: TCP
|
|
|
|
volumeMounts:
|
2017-07-10 18:09:29 +00:00
|
|
|
- name: elasticsearch-logging
|
2015-05-13 19:36:49 +00:00
|
|
|
mountPath: /data
|
2016-11-18 16:56:55 +00:00
|
|
|
env:
|
|
|
|
- name: "NAMESPACE"
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.namespace
|
2017-08-03 08:18:02 +00:00
|
|
|
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.
|
2017-07-10 18:09:29 +00:00
|
|
|
initContainers:
|
|
|
|
- image: alpine:3.6
|
|
|
|
command: ["/sbin/sysctl", "-w", "vm.max_map_count=262144"]
|
|
|
|
name: elasticsearch-logging-init
|
|
|
|
securityContext:
|
|
|
|
privileged: true
|