@leverege/build-tools 2.32.4 → 2.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/lib/server/overwhelm.js +2 -4
  2. package/lib/web/overwhelm.js +2 -4
  3. package/package.json +8 -9
  4. package/src/dockreate +25 -2
  5. package/src/helm-charts/elasticsearch/helmup.plugin +1 -1
  6. package/src/helm-charts/elasticsearch-helm-gke1.25/.helmignore +2 -0
  7. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/Chart.yaml +12 -0
  8. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/Makefile +1 -0
  9. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/README.md +1 -0
  10. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/NOTES.txt +6 -0
  11. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/_helpers.tpl +65 -0
  12. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/configmap.yaml +34 -0
  13. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/ingress.yaml +64 -0
  14. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/networkpolicy.yaml +61 -0
  15. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/poddisruptionbudget.yaml +12 -0
  16. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/podsecuritypolicy.yaml +14 -0
  17. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/role.yaml +25 -0
  18. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/rolebinding.yaml +24 -0
  19. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/service.yaml +76 -0
  20. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/serviceaccount.yaml +20 -0
  21. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/templates/statefulset.yaml +390 -0
  22. package/src/helm-charts/elasticsearch-helm-gke1.25/helm/values.yaml +352 -0
  23. package/src/helm-charts/elasticsearch8/.nohelm +0 -0
  24. package/src/helm-charts/elasticsearch8/elasticsearch-local.yaml +104 -0
  25. package/src/helm-charts/elasticsearch8/helmup.plugin +14 -0
  26. package/src/helmdn +2 -1
  27. package/src/helmup +6 -2
  28. package/src/overwhelm.js +2 -4
  29. package/.vscode/settings.json +0 -15
  30. package/lib/server/npm-scripts/postinstall.js +0 -16
  31. package/lib/web/npm-scripts/postinstall.js +0 -16
  32. package/src/npm-scripts/postinstall.js +0 -18
@@ -235,10 +235,8 @@ const doReplacements = (yamls, replacements) => {
235
235
  return replYaml;
236
236
  };
237
237
 
238
- // Collect all of the yaml from the yams, and always expect the default and
239
- // platform yamls to be in that list.
238
+ // Collect all of the yaml from the yams...
240
239
  const buildYaml = (yamls, replacements) => {
241
- // We always start with default but values-platform is no longer needed.
242
240
  const always = ['values-default.yaml'];
243
241
  const values = [...always, ...yamls];
244
242
  const loaded = [];
@@ -311,7 +309,7 @@ ahoy.forEach(dir => {
311
309
  // Augment the default service section of the YAML with settings that
312
310
  // usually come from the top level overwhelm.yaml file.
313
311
  //
314
- const valuesAll = YAML.load(valuesOut);
312
+ const valuesAll = YAML.load(valuesOut) || {};
315
313
  const valuesSvc = {
316
314
  service: {
317
315
  project_id: 'OVH:<PROJECT_ID>',
@@ -235,10 +235,8 @@ const doReplacements = (yamls, replacements) => {
235
235
  return replYaml;
236
236
  };
237
237
 
238
- // Collect all of the yaml from the yams, and always expect the default and
239
- // platform yamls to be in that list.
238
+ // Collect all of the yaml from the yams...
240
239
  const buildYaml = (yamls, replacements) => {
241
- // We always start with default but values-platform is no longer needed.
242
240
  const always = ['values-default.yaml'];
243
241
  const values = [...always, ...yamls];
244
242
  const loaded = [];
@@ -311,7 +309,7 @@ ahoy.forEach(dir => {
311
309
  // Augment the default service section of the YAML with settings that
312
310
  // usually come from the top level overwhelm.yaml file.
313
311
  //
314
- const valuesAll = YAML.load(valuesOut);
312
+ const valuesAll = YAML.load(valuesOut) || {};
315
313
  const valuesSvc = {
316
314
  service: {
317
315
  project_id: 'OVH:<PROJECT_ID>',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.32.4",
3
+ "version": "2.33.1",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -13,7 +13,6 @@
13
13
  "compile": "npm run clean && npm run compile_server && npm run compile_web",
14
14
  "compile_server": "NODE_ENV=server babel -d lib/server src/",
15
15
  "compile_web": "NODE_ENV=web babel -d lib/web src/",
16
- "xpostinstall": "src/npm-scripts/postinstall.js",
17
16
  "prepublintOnly": "npm run lint && npm run build",
18
17
  "prepublishOnly": "npm run compile",
19
18
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -57,7 +56,7 @@
57
56
  "command-line-args": "^5.2.1",
58
57
  "command-line-usage": "^6.1.3",
59
58
  "deepmerge": "^4.3.1",
60
- "dotenv": "^16.0.3",
59
+ "dotenv": "^16.1.4",
61
60
  "enquirer": "^2.3.6",
62
61
  "execa": "^5.1.1",
63
62
  "glob": "^8.1.0",
@@ -66,15 +65,15 @@
66
65
  "parse-gitignore": "^2.0.0",
67
66
  "read-pkg": "^8.0.0",
68
67
  "readline-sync": "^1.4.10",
69
- "semver": "^7.3.8",
70
- "simple-git": "^3.17.0",
71
- "zx": "^7.2.1"
68
+ "semver": "^7.5.1",
69
+ "simple-git": "^3.19.0",
70
+ "zx": "^7.2.2"
72
71
  },
73
72
  "devDependencies": {
74
- "@babel/cli": "^7.21.0",
75
- "@babel/core": "^7.21.4",
73
+ "@babel/cli": "^7.22.5",
74
+ "@babel/core": "^7.22.5",
76
75
  "@leverege/babel-preset-leverege-node": "^2.0.0",
77
76
  "@leverege/eslint-config-leverege": "^3.0.1",
78
- "npm": "^9.6.4"
77
+ "npm": "^9.7.1"
79
78
  }
80
79
  }
package/src/dockreate CHANGED
@@ -59,6 +59,26 @@ strip_undefined() {
59
59
  printf "$result"
60
60
  }
61
61
 
62
+ create_DockerfilePlugin() {
63
+ [ -f 'Dockerfile.plugin' ] && return
64
+
65
+ cat<<DOCKERPLUGIN > Dockerfile.plugin
66
+ # Dockerfile.plugin - optionally extend the service Docker image
67
+ #
68
+ # This file may be used to run additional docker commands during the image
69
+ # build process without needing to maintain a local custom Dockerfile. For
70
+ # example, uncommenting the following docker RUN command will cause the
71
+ # curl and vim packages to be added to the deployed image thus making them
72
+ # available from the pod's command line on k8s:
73
+ #
74
+ # RUN apk update && apk add --no-cache curl vim
75
+ #
76
+ # Keep in mind that the Alpine Linux base image is used to keep image
77
+ # footprints small, so adding packages "just because" is not considered
78
+ # a best practice.
79
+ DOCKERPLUGIN
80
+ }
81
+
62
82
  # Useful links with information regarding k8s/docker/nodejs and PID 1
63
83
  # No PID 1 for NodeJS => https://bit.ly/2r4gHkZ
64
84
  # What tini is all about => https://bit.ly/2HsSxqP
@@ -72,6 +92,8 @@ create_Dockerfile() {
72
92
  local nodeimg="${2:-hydrogen-alpine}"
73
93
  local apkadds="${3}"
74
94
 
95
+ create_DockerfilePlugin
96
+
75
97
  echo "Creating the Dockerfile for node ${nodeimg}"
76
98
  cat<<DOCKERBLD > Dockerfile
77
99
  # Version ${regvers} @ `date`
@@ -96,7 +118,7 @@ COPY ./.npmrc /usr/src/app/.npmrc
96
118
  RUN apk --no-cache add openssh-client && \
97
119
  apk --update add --no-cache --virtual build-dep g++ gcc libgcc \\
98
120
  libstdc++ linux-headers make ${apkadds} && \
99
- npm install -g npm@8 && \
121
+ npm install -g npm@9 && \
100
122
  npm ci --only=production --ignore-scripts --no-optional ${npmlogging} && \
101
123
  rm -f /usr/src/app/.npmrc /root/.ssh/*
102
124
 
@@ -109,7 +131,7 @@ FROM node:${nodeimg}
109
131
  # Install tini for PID 1 and replace shell with bash so we can source files
110
132
  RUN apk update && \
111
133
  apk add --no-cache bash curl tini vim ${apkadds} && \
112
- npm install -g npm@8 && \
134
+ npm install -g npm@9 && \
113
135
  rm /bin/sh && ln -s /bin/bash /bin/sh && \
114
136
  mkdir -p /usr/src/app /tmp/levlog && \
115
137
  chown node:node /usr/src/app
@@ -275,6 +297,7 @@ version=$1
275
297
  [[ -f '.previous' ]] && previous=`cat .previous` || previous='FIRST BUILD'
276
298
  pckgver="v`node -p \"require('../package.json').version\"`"
277
299
  pckgdts="`date +\"%Y%m%d-%H%M\"`"
300
+ # egrep was deprecated in 2007!
278
301
  tagging=`echo $version | egrep -e "^v\d+\.\d+\.\d+$"`
279
302
 
280
303
  if [ $tagging ];
@@ -8,7 +8,7 @@ LOCAL_ES_VALUES="elasticsearch/elasticsearch-local.yaml"
8
8
  [ ! -f "$LOCAL_ES_VALUES" ] && exitOnError 1 "Missing the local ES config file => `color y $LOCAL_ES_VALUES`"
9
9
 
10
10
  addHelmRepo elastic https://helm.elastic.co
11
- helm upgrade --install elasticsearch elastic/elasticsearch \
11
+ helm upgrade --install elasticsearch leverege/elasticsearch \
12
12
  --version 7.16 \
13
13
  --values $LOCAL_ES_VALUES \
14
14
  --set volumeClaimTemplate.storageClassName="ssd" $HELM_WHAT
@@ -0,0 +1,2 @@
1
+ tests/
2
+ .pytest_cache/
@@ -0,0 +1,12 @@
1
+ apiVersion: v1
2
+ version: 7.16.4
3
+ appVersion: 7.16.3
4
+ description: Leverege Elasticsearch Chart
5
+ #home: https://github.com/elastic/helm-charts
6
+ icon: https://helm.elastic.co/icons/elasticsearch.png
7
+ #maintainers:
8
+ #- email: helm-charts@elastic.co
9
+ # name: Elastic
10
+ name: elasticsearch
11
+ #sources:
12
+ #- https://github.com/elastic/elasticsearch
@@ -0,0 +1 @@
1
+ include ../helpers/common.mk
@@ -0,0 +1 @@
1
+ # Elasticsearch Helm Chart v7.16.3 +plus gke1.25 mods for use at Leverege
@@ -0,0 +1,6 @@
1
+ 1. Watch all cluster members come up.
2
+ $ kubectl get pods --namespace={{ .Release.Namespace }} -l app={{ template "elasticsearch.uname" . }} -w
3
+ {{- if .Values.tests.enabled -}}
4
+ 2. Test cluster health using Helm test.
5
+ $ helm --namespace={{ .Release.Namespace }} test {{ .Release.Name }}
6
+ {{- end -}}
@@ -0,0 +1,65 @@
1
+ {{/* vim: set filetype=mustache: */}}
2
+ {{/*
3
+ Expand the name of the chart.
4
+ */}}
5
+ {{- define "elasticsearch.name" -}}
6
+ {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7
+ {{- end -}}
8
+
9
+ {{/*
10
+ Create a default fully qualified app name.
11
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12
+ */}}
13
+ {{- define "elasticsearch.fullname" -}}
14
+ {{- $name := default .Chart.Name .Values.nameOverride -}}
15
+ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
16
+ {{- end -}}
17
+
18
+ {{- define "elasticsearch.uname" -}}
19
+ {{- if empty .Values.fullnameOverride -}}
20
+ {{- if empty .Values.nameOverride -}}
21
+ {{ .Values.clusterName }}-{{ .Values.nodeGroup }}
22
+ {{- else -}}
23
+ {{ .Values.nameOverride }}-{{ .Values.nodeGroup }}
24
+ {{- end -}}
25
+ {{- else -}}
26
+ {{ .Values.fullnameOverride }}
27
+ {{- end -}}
28
+ {{- end -}}
29
+
30
+ {{- define "elasticsearch.masterService" -}}
31
+ {{- if empty .Values.masterService -}}
32
+ {{- if empty .Values.fullnameOverride -}}
33
+ {{- if empty .Values.nameOverride -}}
34
+ {{ .Values.clusterName }}-master
35
+ {{- else -}}
36
+ {{ .Values.nameOverride }}-master
37
+ {{- end -}}
38
+ {{- else -}}
39
+ {{ .Values.fullnameOverride }}
40
+ {{- end -}}
41
+ {{- else -}}
42
+ {{ .Values.masterService }}
43
+ {{- end -}}
44
+ {{- end -}}
45
+
46
+ {{- define "elasticsearch.endpoints" -}}
47
+ {{- $replicas := int (toString (.Values.replicas)) }}
48
+ {{- $uname := (include "elasticsearch.uname" .) }}
49
+ {{- range $i, $e := untilStep 0 $replicas 1 -}}
50
+ {{ $uname }}-{{ $i }},
51
+ {{- end -}}
52
+ {{- end -}}
53
+
54
+ {{- define "elasticsearch.esMajorVersion" -}}
55
+ {{- if .Values.esMajorVersion -}}
56
+ {{ .Values.esMajorVersion }}
57
+ {{- else -}}
58
+ {{- $version := int (index (.Values.imageTag | splitList ".") 0) -}}
59
+ {{- if and (contains "docker.elastic.co/elasticsearch/elasticsearch" .Values.image) (not (eq $version 0)) -}}
60
+ {{ $version }}
61
+ {{- else -}}
62
+ 7
63
+ {{- end -}}
64
+ {{- end -}}
65
+ {{- end -}}
@@ -0,0 +1,34 @@
1
+ {{- if .Values.esConfig }}
2
+ ---
3
+ apiVersion: v1
4
+ kind: ConfigMap
5
+ metadata:
6
+ name: {{ template "elasticsearch.uname" . }}-config
7
+ labels:
8
+ heritage: {{ .Release.Service | quote }}
9
+ release: {{ .Release.Name | quote }}
10
+ chart: "{{ .Chart.Name }}"
11
+ app: "{{ template "elasticsearch.uname" . }}"
12
+ data:
13
+ {{- range $path, $config := .Values.esConfig }}
14
+ {{ $path }}: |
15
+ {{ $config | indent 4 -}}
16
+ {{- end -}}
17
+ {{- end -}}
18
+ {{- if .Values.esJvmOptions }}
19
+ ---
20
+ apiVersion: v1
21
+ kind: ConfigMap
22
+ metadata:
23
+ name: {{ template "elasticsearch.uname" . }}-jvm-options
24
+ labels:
25
+ heritage: {{ .Release.Service | quote }}
26
+ release: {{ .Release.Name | quote }}
27
+ chart: "{{ .Chart.Name }}"
28
+ app: "{{ template "elasticsearch.uname" . }}"
29
+ data:
30
+ {{- range $path, $config := .Values.esJvmOptions }}
31
+ {{ $path }}: |
32
+ {{ $config | indent 4 -}}
33
+ {{- end -}}
34
+ {{- end -}}
@@ -0,0 +1,64 @@
1
+ {{- if .Values.ingress.enabled -}}
2
+ {{- $fullName := include "elasticsearch.uname" . -}}
3
+ {{- $httpPort := .Values.httpPort -}}
4
+ {{- $pathtype := .Values.ingress.pathtype -}}
5
+ {{- $ingressPath := .Values.ingress.path -}}
6
+ apiVersion: networking.k8s.io/v1
7
+ kind: Ingress
8
+ metadata:
9
+ name: {{ $fullName }}
10
+ labels:
11
+ app: {{ .Chart.Name }}
12
+ release: {{ .Release.Name }}
13
+ heritage: {{ .Release.Service }}
14
+ {{- with .Values.ingress.annotations }}
15
+ annotations:
16
+ {{ toYaml . | indent 4 }}
17
+ {{- end }}
18
+ spec:
19
+ {{- if .Values.ingress.className }}
20
+ ingressClassName: {{ .Values.ingress.className | quote }}
21
+ {{- end }}
22
+ {{- if .Values.ingress.tls }}
23
+ tls:
24
+ {{- if .ingressPath }}
25
+ {{- range .Values.ingress.tls }}
26
+ - hosts:
27
+ {{- range .hosts }}
28
+ - {{ . }}
29
+ {{- end }}
30
+ secretName: {{ .secretName }}
31
+ {{- end }}
32
+ {{- else }}
33
+ {{ toYaml .Values.ingress.tls | indent 4 }}
34
+ {{- end }}
35
+ {{- end}}
36
+ rules:
37
+ {{- range .Values.ingress.hosts }}
38
+ {{- if $ingressPath }}
39
+ - host: {{ . }}
40
+ http:
41
+ paths:
42
+ - path: {{ $ingressPath }}
43
+ pathType: {{ $pathtype }}
44
+ backend:
45
+ service:
46
+ name: {{ $fullName }}
47
+ port:
48
+ number: {{ $httpPort }}
49
+ {{- else }}
50
+ - host: {{ .host }}
51
+ http:
52
+ paths:
53
+ {{- range .paths }}
54
+ - path: {{ .path }}
55
+ pathType: {{ $pathtype }}
56
+ backend:
57
+ service:
58
+ name: {{ $fullName }}
59
+ port:
60
+ number: {{ .servicePort | default $httpPort }}
61
+ {{- end }}
62
+ {{- end }}
63
+ {{- end }}
64
+ {{- end }}
@@ -0,0 +1,61 @@
1
+ {{- if (or .Values.networkPolicy.http.enabled .Values.networkPolicy.transport.enabled) }}
2
+ kind: NetworkPolicy
3
+ apiVersion: networking.k8s.io/v1
4
+ metadata:
5
+ name: {{ template "elasticsearch.uname" . }}
6
+ labels:
7
+ heritage: {{ .Release.Service | quote }}
8
+ release: {{ .Release.Name | quote }}
9
+ chart: "{{ .Chart.Name }}"
10
+ app: "{{ template "elasticsearch.uname" . }}"
11
+ spec:
12
+ podSelector:
13
+ matchLabels:
14
+ app: "{{ template "elasticsearch.uname" . }}"
15
+ ingress: # Allow inbound connections
16
+
17
+ {{- if .Values.networkPolicy.http.enabled }}
18
+ # For HTTP access
19
+ - ports:
20
+ - port: {{ .Values.httpPort }}
21
+ from:
22
+ # From authorized Pods (having the correct label)
23
+ - podSelector:
24
+ matchLabels:
25
+ {{ template "elasticsearch.uname" . }}-http-client: "true"
26
+ {{- with .Values.networkPolicy.http.explicitNamespacesSelector }}
27
+ # From authorized namespaces
28
+ namespaceSelector:
29
+ {{ toYaml . | indent 12 }}
30
+ {{- end }}
31
+ {{- with .Values.networkPolicy.http.additionalRules }}
32
+ # Or from custom additional rules
33
+ {{ toYaml . | indent 8 }}
34
+ {{- end }}
35
+ {{- end }}
36
+
37
+ {{- if .Values.networkPolicy.transport.enabled }}
38
+ # For transport access
39
+ - ports:
40
+ - port: {{ .Values.transportPort }}
41
+ from:
42
+ # From authorized Pods (having the correct label)
43
+ - podSelector:
44
+ matchLabels:
45
+ {{ template "elasticsearch.uname" . }}-transport-client: "true"
46
+ {{- with .Values.networkPolicy.transport.explicitNamespacesSelector }}
47
+ # From authorized namespaces
48
+ namespaceSelector:
49
+ {{ toYaml . | indent 12 }}
50
+ {{- end }}
51
+ {{- with .Values.networkPolicy.transport.additionalRules }}
52
+ # Or from custom additional rules
53
+ {{ toYaml . | indent 8 }}
54
+ {{- end }}
55
+ # Or from other ElasticSearch Pods
56
+ - podSelector:
57
+ matchLabels:
58
+ app: "{{ template "elasticsearch.uname" . }}"
59
+ {{- end }}
60
+
61
+ {{- end }}
@@ -0,0 +1,12 @@
1
+ ---
2
+ {{- if .Values.maxUnavailable }}
3
+ apiVersion: policy/v1
4
+ kind: PodDisruptionBudget
5
+ metadata:
6
+ name: "{{ template "elasticsearch.uname" . }}-pdb"
7
+ spec:
8
+ maxUnavailable: {{ .Values.maxUnavailable }}
9
+ selector:
10
+ matchLabels:
11
+ app: "{{ template "elasticsearch.uname" . }}"
12
+ {{- end }}
@@ -0,0 +1,14 @@
1
+ {{- if .Values.podSecurityPolicy.create -}}
2
+ {{- $fullName := include "elasticsearch.uname" . -}}
3
+ apiVersion: policy/v1beta1
4
+ kind: PodSecurityPolicy
5
+ metadata:
6
+ name: {{ default $fullName .Values.podSecurityPolicy.name | quote }}
7
+ labels:
8
+ heritage: {{ .Release.Service | quote }}
9
+ release: {{ .Release.Name | quote }}
10
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
11
+ app: {{ $fullName | quote }}
12
+ spec:
13
+ {{ toYaml .Values.podSecurityPolicy.spec | indent 2 }}
14
+ {{- end -}}
@@ -0,0 +1,25 @@
1
+ {{- if .Values.rbac.create -}}
2
+ {{- $fullName := include "elasticsearch.uname" . -}}
3
+ apiVersion: rbac.authorization.k8s.io/v1
4
+ kind: Role
5
+ metadata:
6
+ name: {{ $fullName | quote }}
7
+ labels:
8
+ heritage: {{ .Release.Service | quote }}
9
+ release: {{ .Release.Name | quote }}
10
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
11
+ app: {{ $fullName | quote }}
12
+ rules:
13
+ - apiGroups:
14
+ - extensions
15
+ resources:
16
+ - podsecuritypolicies
17
+ resourceNames:
18
+ {{- if eq .Values.podSecurityPolicy.name "" }}
19
+ - {{ $fullName | quote }}
20
+ {{- else }}
21
+ - {{ .Values.podSecurityPolicy.name | quote }}
22
+ {{- end }}
23
+ verbs:
24
+ - use
25
+ {{- end -}}
@@ -0,0 +1,24 @@
1
+ {{- if .Values.rbac.create -}}
2
+ {{- $fullName := include "elasticsearch.uname" . -}}
3
+ apiVersion: rbac.authorization.k8s.io/v1
4
+ kind: RoleBinding
5
+ metadata:
6
+ name: {{ $fullName | quote }}
7
+ labels:
8
+ heritage: {{ .Release.Service | quote }}
9
+ release: {{ .Release.Name | quote }}
10
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
11
+ app: {{ $fullName | quote }}
12
+ subjects:
13
+ - kind: ServiceAccount
14
+ {{- if eq .Values.rbac.serviceAccountName "" }}
15
+ name: {{ $fullName | quote }}
16
+ {{- else }}
17
+ name: {{ .Values.rbac.serviceAccountName | quote }}
18
+ {{- end }}
19
+ namespace: {{ .Release.Namespace | quote }}
20
+ roleRef:
21
+ kind: Role
22
+ name: {{ $fullName | quote }}
23
+ apiGroup: rbac.authorization.k8s.io
24
+ {{- end -}}
@@ -0,0 +1,76 @@
1
+ {{- if .Values.service.enabled -}}
2
+ kind: Service
3
+ apiVersion: v1
4
+ metadata:
5
+ {{- if eq .Values.nodeGroup "master" }}
6
+ name: {{ template "elasticsearch.masterService" . }}
7
+ {{- else }}
8
+ name: {{ template "elasticsearch.uname" . }}
9
+ {{- end }}
10
+ labels:
11
+ heritage: {{ .Release.Service | quote }}
12
+ release: {{ .Release.Name | quote }}
13
+ chart: "{{ .Chart.Name }}"
14
+ app: "{{ template "elasticsearch.uname" . }}"
15
+ {{- if .Values.service.labels }}
16
+ {{ toYaml .Values.service.labels | indent 4}}
17
+ {{- end }}
18
+ annotations:
19
+ {{ toYaml .Values.service.annotations | indent 4 }}
20
+ spec:
21
+ type: {{ .Values.service.type }}
22
+ selector:
23
+ release: {{ .Release.Name | quote }}
24
+ chart: "{{ .Chart.Name }}"
25
+ app: "{{ template "elasticsearch.uname" . }}"
26
+ ports:
27
+ - name: {{ .Values.service.httpPortName | default "http" }}
28
+ protocol: TCP
29
+ port: {{ .Values.httpPort }}
30
+ {{- if .Values.service.nodePort }}
31
+ nodePort: {{ .Values.service.nodePort }}
32
+ {{- end }}
33
+ - name: {{ .Values.service.transportPortName | default "transport" }}
34
+ protocol: TCP
35
+ port: {{ .Values.transportPort }}
36
+ {{- if .Values.service.loadBalancerIP }}
37
+ loadBalancerIP: {{ .Values.service.loadBalancerIP }}
38
+ {{- end }}
39
+ {{- with .Values.service.loadBalancerSourceRanges }}
40
+ loadBalancerSourceRanges:
41
+ {{ toYaml . | indent 4 }}
42
+ {{- end }}
43
+ {{- if .Values.service.externalTrafficPolicy }}
44
+ externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
45
+ {{- end }}
46
+ {{- end }}
47
+ ---
48
+ kind: Service
49
+ apiVersion: v1
50
+ metadata:
51
+ {{- if eq .Values.nodeGroup "master" }}
52
+ name: {{ template "elasticsearch.masterService" . }}-headless
53
+ {{- else }}
54
+ name: {{ template "elasticsearch.uname" . }}-headless
55
+ {{- end }}
56
+ labels:
57
+ heritage: {{ .Release.Service | quote }}
58
+ release: {{ .Release.Name | quote }}
59
+ chart: "{{ .Chart.Name }}"
60
+ app: "{{ template "elasticsearch.uname" . }}"
61
+ {{- if .Values.service.labelsHeadless }}
62
+ {{ toYaml .Values.service.labelsHeadless | indent 4 }}
63
+ {{- end }}
64
+ annotations:
65
+ service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
66
+ spec:
67
+ clusterIP: None # This is needed for statefulset hostnames like elasticsearch-0 to resolve
68
+ # Create endpoints also if the related pod isn't ready
69
+ publishNotReadyAddresses: true
70
+ selector:
71
+ app: "{{ template "elasticsearch.uname" . }}"
72
+ ports:
73
+ - name: {{ .Values.service.httpPortName | default "http" }}
74
+ port: {{ .Values.httpPort }}
75
+ - name: {{ .Values.service.transportPortName | default "transport" }}
76
+ port: {{ .Values.transportPort }}
@@ -0,0 +1,20 @@
1
+ {{- if .Values.rbac.create -}}
2
+ {{- $fullName := include "elasticsearch.uname" . -}}
3
+ apiVersion: v1
4
+ kind: ServiceAccount
5
+ metadata:
6
+ {{- if eq .Values.rbac.serviceAccountName "" }}
7
+ name: {{ $fullName | quote }}
8
+ {{- else }}
9
+ name: {{ .Values.rbac.serviceAccountName | quote }}
10
+ {{- end }}
11
+ annotations:
12
+ {{- with .Values.rbac.serviceAccountAnnotations }}
13
+ {{- toYaml . | nindent 4 }}
14
+ {{- end }}
15
+ labels:
16
+ heritage: {{ .Release.Service | quote }}
17
+ release: {{ .Release.Name | quote }}
18
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
19
+ app: {{ $fullName | quote }}
20
+ {{- end -}}