ansible role update
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
{{/*
|
||||
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/}}
|
||||
|
||||
{{- if .Values.middleManager.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "druid.middleManager.fullname" . }}
|
||||
labels:
|
||||
app: {{ include "druid.name" . }}
|
||||
chart: {{ include "druid.chart" . }}
|
||||
component: "{{ .Values.name }}"
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
name: {{ include "druid.middleManager.fullname" . }}
|
||||
minReplicas: {{ .Values.middleManager.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.middleManager.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{ toYaml .Values.middleManager.autoscaling.metrics | indent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,58 @@
|
||||
{{/*
|
||||
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/}}
|
||||
|
||||
{{- if .Values.middleManager.ingress.enabled -}}
|
||||
{{- $fullName := include "druid.middleManager.fullname" . -}}
|
||||
{{- $ingressPath := .Values.middleManager.ingress.path -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
labels:
|
||||
app: {{ include "druid.name" . }}
|
||||
chart: {{ include "druid.chart" . }}
|
||||
component: {{ .Values.middleManager.name }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- with .Values.middleManager.ingress.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.middleManager.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.middleManager.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.middleManager.ingress.hosts }}
|
||||
- host: {{ . | quote }}
|
||||
http:
|
||||
paths:
|
||||
- path: {{ $ingressPath }}
|
||||
backend:
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: http
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,43 @@
|
||||
{{/*
|
||||
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/}}
|
||||
|
||||
{{- if .Values.middleManager.podDisruptionBudget.enabled }}
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "druid.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: {{ .Values.middleManager.name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "druid.middleManager.fullname" . }}
|
||||
spec:
|
||||
{{- if .Values.middleManager.podDisruptionBudget.minAvailable }}
|
||||
minAvailable: {{ .Values.middleManager.podDisruptionBudget.minAvailable }}
|
||||
{{- end }}
|
||||
{{- if .Values.middleManager.podDisruptionBudget.maxUnavailable }}
|
||||
maxUnavailable: {{ .Values.middleManager.podDisruptionBudget.maxUnavailable }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "druid.name" . }}
|
||||
component: {{ .Values.middleManager.name }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,48 @@
|
||||
{{/*
|
||||
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/}}
|
||||
|
||||
{{- if .Values.middleManager.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "druid.middleManager.fullname" . }}
|
||||
labels:
|
||||
app: {{ include "druid.name" . }}
|
||||
chart: {{ include "druid.chart" . }}
|
||||
component: {{ .Values.middleManager.name }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
type: {{ .Values.middleManager.serviceType }}
|
||||
ports:
|
||||
- port: {{ .Values.middleManager.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
{{ if .Values.configVars.druid_emitter_prometheus_port }}
|
||||
- port: {{ .Values.configVars.druid_emitter_prometheus_port }}
|
||||
targetPort: metric
|
||||
protocol: TCP
|
||||
name: metric
|
||||
{{ end }}
|
||||
selector:
|
||||
app: {{ include "druid.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
component: {{ .Values.middleManager.name }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,164 @@
|
||||
{{/*
|
||||
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/}}
|
||||
|
||||
{{- if .Values.middleManager.enabled -}}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "druid.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
component: {{ .Values.middleManager.name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
name: {{ template "druid.middleManager.fullname" . }}
|
||||
spec:
|
||||
serviceName: {{ template "druid.middleManager.fullname" . }}
|
||||
replicas: {{ .Values.middleManager.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ include "druid.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
component: {{ .Values.middleManager.name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "druid.name" . }}
|
||||
component: {{ .Values.middleManager.name }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.middleManager.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.middleManager.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if or .Values.middleManager.antiAffinity .Values.middleManager.nodeAffinity }}
|
||||
affinity:
|
||||
{{- end }}
|
||||
{{- if eq .Values.middleManager.antiAffinity "hard" }}
|
||||
podAntiAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- topologyKey: "kubernetes.io/hostname"
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app: "{{ template "druid.name" . }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
component: "{{ .Values.middleManager.name }}"
|
||||
{{- else if eq .Values.middleManager.antiAffinity "soft" }}
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 1
|
||||
podAffinityTerm:
|
||||
topologyKey: kubernetes.io/hostname
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app: "{{ template "druid.name" . }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
component: "{{ .Values.middleManager.name }}"
|
||||
{{- end }}
|
||||
{{- with .Values.middleManager.nodeAffinity }}
|
||||
nodeAffinity:
|
||||
{{ toYaml . | indent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.middleManager.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.middleManager.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.middleManager.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.middleManager.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.middleManager.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.middleManager.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{ toYaml .Values.image.pullSecrets | indent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: druid
|
||||
args: [ "middleManager" ]
|
||||
env:
|
||||
{{- range $key, $val := .Values.middleManager.config }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $val | quote }}
|
||||
{{- end}}
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ template "druid.name" . }}
|
||||
resources:
|
||||
{{ toYaml .Values.middleManager.resources | indent 12 }}
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 60
|
||||
httpGet:
|
||||
path: /status/health
|
||||
port: {{ .Values.middleManager.port }}
|
||||
readinessProbe:
|
||||
initialDelaySeconds: 60
|
||||
httpGet:
|
||||
path: /status/health
|
||||
port: {{ .Values.middleManager.port }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.middleManager.port }}
|
||||
name: http
|
||||
{{ if .Values.configVars.druid_emitter_prometheus_port }}
|
||||
- name: metric
|
||||
containerPort: {{ .Values.configVars.druid_emitter_prometheus_port }}
|
||||
protocol: TCP
|
||||
{{ end }}
|
||||
volumeMounts:
|
||||
- mountPath: /opt/druid/var/druid/
|
||||
name: data
|
||||
{{- if .Values.gCloudStorage.enabled }}
|
||||
- name: google-cloud-key
|
||||
mountPath: /var/secrets/google
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if not .Values.middleManager.persistence.enabled }}
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.gCloudStorage.enabled }}
|
||||
- name: google-cloud-key
|
||||
secret:
|
||||
secretName: {{ .Values.gCloudStorage.secretName }}
|
||||
{{- end }}
|
||||
updateStrategy:
|
||||
type: {{ .Values.middleManager.updateStrategy.type }}
|
||||
{{- if .Values.middleManager.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.middleManager.persistence.accessMode | quote }}
|
||||
{{- if .Values.middleManager.persistence.storageClass }}
|
||||
{{- if (eq "-" .Values.middleManager.persistence.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: "{{ .Values.middleManager.persistence.storageClass }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: "{{ .Values.middleManager.persistence.size }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user