| # |
| # 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.components.manager }} |
| apiVersion: apps/v1 |
| kind: StatefulSet |
| metadata: |
| name: {{ template "inlong.fullname" . }}-{{ .Values.manager.component }} |
| namespace: {{ .Release.Namespace }} |
| labels: |
| {{- include "inlong.commonLabels" . | nindent 4 }} |
| component: {{ .Values.manager.component }} |
| spec: |
| serviceName: {{ template "inlong.fullname" . }}-{{ .Values.manager.component }} |
| replicas: {{ .Values.manager.replicas }} |
| selector: |
| matchLabels: |
| {{- include "inlong.matchLabels" . | nindent 6 }} |
| component: {{ .Values.manager.component }} |
| updateStrategy: |
| type: {{ .Values.manager.updateStrategy.type | quote }} |
| podManagementPolicy: {{ .Values.manager.podManagementPolicy | quote }} |
| template: |
| metadata: |
| labels: |
| {{- include "inlong.template.labels" . | nindent 8 }} |
| component: {{ .Values.manager.component }} |
| {{- if .Values.manager.annotations }} |
| annotations: |
| {{- toYaml .Values.manager.annotations | nindent 8 }} |
| {{- end }} |
| spec: |
| {{- if .Values.manager.tolerations }} |
| tolerations: |
| {{- toYaml .Values.manager.tolerations | nindent 8 }} |
| {{- end }} |
| {{- if .Values.manager.nodeSelector }} |
| nodeSelector: |
| {{- toYaml .Values.manager.nodeSelector | nindent 8 }} |
| {{- end }} |
| {{- if .Values.manager.affinity }} |
| affinity: |
| {{- toYaml .Values.manager.affinity | nindent 8 }} |
| {{- end }} |
| terminationGracePeriodSeconds: {{ .Values.manager.terminationGracePeriodSeconds }} |
| initContainers: |
| - name: wait-{{ .Values.mysql.component }}-ready |
| image: {{ .Values.images.initContainer.repository }}:{{ .Values.images.initContainer.tag }} |
| imagePullPolicy: {{ .Values.images.pullPolicy }} |
| command: [ "/bin/sh", "-c" ] |
| args: |
| - |- |
| count={{ template "inlong.mysql.count" . }} |
| for i in $(seq 0 $(expr $count - 1)) |
| do |
| {{- if .Values.external.mysql.enabled }} |
| host="{{ template "inlong.mysql.hostname" . }}" |
| {{- else }} |
| replica="{{ template "inlong.fullname" . }}-{{ .Values.mysql.component }}-$i" |
| host="$replica.{{ template "inlong.mysql.hostname" . }}" |
| {{- end }} |
| port={{ template "inlong.mysql.port" . }} |
| until nc -z $host $port 2>/dev/null |
| do |
| echo "waiting for host:$host port:$port to be ready" |
| sleep 3 |
| done |
| done |
| containers: |
| - name: {{ template "inlong.fullname" . }}-{{ .Values.manager.component }} |
| image: {{ .Values.images.manager.repository }}:{{ .Values.images.manager.tag }} |
| imagePullPolicy: {{ .Values.images.pullPolicy }} |
| {{- if .Values.manager.resources }} |
| resources: |
| {{- toYaml .Values.manager.resources | nindent 12 }} |
| {{- end }} |
| env: |
| - name: JDBC_URL |
| value: "{{ template "inlong.mysql.hostname" . }}:{{ .Values.mysql.port }}" |
| - name: USERNAME |
| value: {{ include "inlong.mysql.username" . | quote }} |
| - name: PASSWORD |
| valueFrom: |
| secretKeyRef: |
| name: {{ template "inlong.fullname" . }}-{{ .Values.mysql.component }} |
| key: mysql-password |
| - name: ZK_URL |
| value: "{{ template "inlong.zookeeper.hostname" . }}:{{ .Values.zookeeper.ports.client }}" |
| - name: FLINK_HOST |
| value: {{ .Values.external.flink.hostname | quote }} |
| - name: FLINK_PORT |
| value: {{ .Values.external.flink.port | quote }} |
| - name: AUDIT_PROXY_URL |
| value: "{{ template "inlong.audit.hostname" . }}:{{ .Values.audit.port }}" |
| {{- range $key, $value := .Values.manager.env }} |
| - name: {{ $key }} |
| value: {{ $value | quote }} |
| {{- end }} |
| - name: TZ |
| value: {{ .Values.timezone }} |
| ports: |
| - name: {{ .Values.manager.component }}-port |
| containerPort: 8083 |
| restartPolicy: Always |
| {{- end }} |