-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to enable JMX exporter on workers
- Loading branch information
1 parent
1956935
commit 4b782a0
Showing
11 changed files
with
242 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
charts/trino/templates/configmap-access-control-worker.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{{- if .Values.worker.gracefulShutdown.enabled }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "trino.fullname" . }}-access-control-volume-worker | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "trino.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: worker | ||
data: | ||
graceful-shutdown-rules.json: >- | ||
{ | ||
"system_information": [ | ||
{ | ||
"allow": [ | ||
"write" | ||
], | ||
"user": "admin" | ||
} | ||
] | ||
} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
charts/trino/templates/tests/test-graceful-shutdown.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{{- if .Values.worker.gracefulShutdown.enabled }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: {{ include "trino.fullname" . }}-pod-manager | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "trino.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: test | ||
test: graceful-shutdown | ||
annotations: | ||
"helm.sh/hook": test | ||
"helm.sh/hook-weight": "0" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
rules: | ||
- apiGroups: [ "" ] | ||
resources: [ "pods" ] | ||
verbs: [ "get", "list", "delete" ] | ||
- apiGroups: [ "" ] | ||
resources: [ "pods/log" ] | ||
verbs: [ "get" ] | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "trino.fullname" . }}-pod-manager-sa | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "trino.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: test | ||
test: graceful-shutdown | ||
annotations: | ||
"helm.sh/hook": test | ||
"helm.sh/hook-weight": "0" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ include "trino.fullname" . }}-pod-manager-binding | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "trino.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: test | ||
test: graceful-shutdown | ||
annotations: | ||
"helm.sh/hook": test | ||
"helm.sh/hook-weight": "1" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "trino.fullname" . }}-pod-manager-sa | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
kind: Role | ||
name: {{ include "trino.fullname" . }}-pod-manager | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: {{ include "trino.fullname" . }}-test-graceful-shutdown | ||
labels: | ||
{{- include "trino.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: test | ||
test: graceful-shutdown | ||
annotations: | ||
"helm.sh/hook": test | ||
"helm.sh/hook-weight": "2" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
spec: | ||
serviceAccountName: {{ include "trino.fullname" . }}-pod-manager-sa | ||
initContainers: | ||
- name: get-worker-pod | ||
image: bitnami/kubectl:latest | ||
command: [ "sh", "-c" ] | ||
args: | ||
- >- | ||
kubectl get pods | ||
--selector="app.kubernetes.io/name={{ include "trino.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=worker" | ||
--output=jsonpath="{.items[0].metadata.name}" | ||
--namespace={{ .Release.Namespace }} | ||
> /pods/worker-pod.txt | ||
volumeMounts: | ||
- mountPath: /pods | ||
name: worker-pod | ||
containers: | ||
- name: check-logs | ||
image: bitnami/kubectl:latest | ||
command: [ "sh", "-c" ] | ||
args: | ||
- >- | ||
WORKER_POD=$(cat /pods/worker-pod.txt) && | ||
kubectl logs ${WORKER_POD} | ||
--follow | ||
--container=trino-worker | ||
--namespace={{ .Release.Namespace }} | ||
| grep --max-count=1 "Shutdown requested" | ||
volumeMounts: | ||
- mountPath: /pods | ||
name: worker-pod | ||
- name: trigger-graceful-shutdown | ||
image: bitnami/kubectl:latest | ||
command: [ "sh", "-c" ] | ||
args: | ||
- >- | ||
sleep 5 && | ||
WORKER_POD=$(cat /pods/worker-pod.txt) && | ||
kubectl delete pod | ||
${WORKER_POD} | ||
--namespace={{ .Release.Namespace }} | ||
volumeMounts: | ||
- mountPath: /pods | ||
name: worker-pod | ||
restartPolicy: Never | ||
volumes: | ||
- name: worker-pod | ||
emptyDir: {} | ||
|
||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
worker: | ||
gracefulShutdown: | ||
enabled: true | ||
gracePeriodSeconds: 60 | ||
|
||
terminationGracePeriodSeconds: 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters