Skip to content
This repository was archived by the owner on Oct 28, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# for osx
.DS_Store
.idea/
27 changes: 27 additions & 0 deletions templates/es-svc-external.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.client.serviceType.external.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}{{ .Values.client.serviceType.external.suffix }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
component: {{ template "fullname" . }}
role: client
spec:
type: {{ .Values.client.serviceType.external.value }}
selector:
component: {{ template "fullname" . }}
role: client
ports:
- name: http
port: {{ .Values.service.httpPort }}
targetPort: 9200
protocol: TCP
- name: transport
port: {{ .Values.service.transportPort }}
targetPort: 9300
protocol: TCP
{{- end }}
6 changes: 3 additions & 3 deletions templates/es-svc.yaml → templates/es-svc-internal.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
name: {{ template "fullname" . }}{{ .Values.client.serviceType.internal.suffix }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Expand All @@ -10,7 +10,7 @@ metadata:
component: {{ template "fullname" . }}
role: client
spec:
type: {{ .Values.common.serviceType }}
type: {{ .Values.client.serviceType.internal.value }}
selector:
component: {{ template "fullname" . }}
role: client
Expand All @@ -22,4 +22,4 @@ spec:
- name: transport
port: {{ .Values.service.transportPort }}
targetPort: 9300
protocol: TCP
protocol: TCP
58 changes: 58 additions & 0 deletions templates/fluentd-ds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{- if .Values.fluentd.enabled }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ template "fullname" . }}-fluentd
{{- if .Values.fluentd.namespace }}
namespace: {{ .Values.fluentd.namespace }}
{{- end }}
labels:
app: {{ template "fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: {{ template "fullname" . }}-fluentd
kubernetes.io/cluster-service: "true"
spec:
selector:
matchLabels:
component: {{ template "fullname" . }}-fluentd
template:
metadata:
labels:
component: {{ template "fullname" . }}-fluentd
spec:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: fluentd
image: {{ .Values.image.fluentd.repository }}:{{ .Values.image.fluentd.tag }}
env:
- name: FLUENT_ELASTICSEARCH_HOST
value: '{{ template "fullname" . }}{{ .Values.client.serviceType.internal.suffix }}.{{ .Release.Namespace }}.svc.cluster.local'
- name: FLUENT_ELASTICSEARCH_PORT
value: "{{ .Values.service.httpPort }}"
- name: FLUENT_ELASTICSEARCH_SCHEME
value: "{{ .Values.service.httpScheme }}"
{{- range $key, $value := .Values.fluentd.env }}
- name: {{ $key }}
value: "{{ $value | quote }}"
{{- end }}
resources:
{{ toYaml .Values.fluentd.resources | indent 12 }}
volumeMounts:
- name: varlog
mountPath: /var/log
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
terminationGracePeriodSeconds: 30
volumes:
- name: varlog
hostPath:
path: /var/log
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
{{- end }}
2 changes: 1 addition & 1 deletion templates/kibana-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
heritage: "{{ .Release.Service }}"
component: {{ template "fullname" . }}-kibana
spec:
type: {{ .Values.common.serviceType }}
type: {{ .Values.kibana.serviceType }}
ports:
- port: {{ .Values.kibana.httpPort }}
targetPort: 5601
Expand Down
3 changes: 2 additions & 1 deletion templates/kibana.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- if .Values.kibana.enabled }}
{{- $elasticsearchServiceName := printf "%s-%s" .Release.Name "elasticsearch" | trunc 63 -}}
{{- $suffix := .Values.client.serviceType.internal.suffix }}
{{- $elasticsearchServiceName := printf "%s-%s%s" .Release.Name "elasticsearch" $suffix | trunc 63 -}}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
Expand Down
38 changes: 31 additions & 7 deletions values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
image:
es:
repository: quay.io/pires/docker-elasticsearch-kubernetes
tag: 6.0.0
pullPolicy: Always
tag: 6.1.3
pullPolicy: IfNotPresent
init:
repository: busybox
tag: latest
Expand All @@ -11,12 +11,12 @@ image:
repository: bobrik/curator
tag: latest
pullPolicy: IfNotPresent
fluentd:
repository: fluent/fluentd-kubernetes-daemonset
tag: v0.12-alpine-elasticsearch
pullPolicy: IfNotPresent

common:
# Defines the service type for all outward-facing (non-discovery) services.
# For minikube use NodePort otherwise use LoadBalancer
serviceType: LoadBalancer

env:
CLUSTER_NAME: "myesdb"

Expand All @@ -41,6 +41,14 @@ client:
# It isn't common to need more than 2 client nodes.
replicas: 2
antiAffinity: "soft"
serviceType:
internal:
value: ClusterIP
suffix: "-api"
external:
enabled: false
value: LoadBalancer # or NodePort if using minikube
suffix: ""

# The amount of RAM allocated to the JVM heap. This should be set to the
# same value as client.resources.requests.memory, or you may see
Expand Down Expand Up @@ -142,6 +150,7 @@ curator:
unit_count: 3

service:
httpScheme: "http"
httpPort: 9200
transportPort: 9300

Expand All @@ -163,6 +172,8 @@ kibana:
# XPACK_ML_ENABLED: "false"
# XPACK_REPORTING_ENABLED: "false"
# XPACK_SECURITY_ENABLED: "false"
# Pay attention to serviceType v. ingress.
serviceType: LoadBalancer
ingress:
enabled: false
# Used to create an Ingress record.
Expand All @@ -176,4 +187,17 @@ kibana:
# - secretName: kibana-tls
# hosts:
# - kibana.local


fluentd:
enabled: false
namespace: "kube-system"
resources:
limits:
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
env:
# X-Pack Authentication
# FLUENT_ELASTICSEARCH_USER: "elastic"
# FLUENT_ELASTICSEARCH_PASSWORD: "changeme"