Skip to content

Commit d75f9b7

Browse files
authored
fix: init container to waiting other componenets (#82)
Signed-off-by: Nic <[email protected]>
1 parent 3647941 commit d75f9b7

File tree

5 files changed

+39
-26
lines changed

5 files changed

+39
-26
lines changed

charts/api7/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.7.0
18+
version: 0.8.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/api7/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# api7ee3
22

3-
![Version: 0.7.0](https://img.shields.io/badge/Version-0.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0](https://img.shields.io/badge/AppVersion-3.0.0-informational?style=flat-square)
3+
![Version: 0.8.0](https://img.shields.io/badge/Version-0.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0](https://img.shields.io/badge/AppVersion-3.0.0-informational?style=flat-square)
44

55
A Helm chart for Kubernetes
66

@@ -20,19 +20,19 @@ A Helm chart for Kubernetes
2020
| busybox.image.tag | float | `1.28` | |
2121
| dashboard.image.pullPolicy | string | `"IfNotPresent"` | |
2222
| dashboard.image.repository | string | `"api7/api7-ee-3-integrated"` | |
23-
| dashboard.image.tag | string | `"v3.2.6.1"` | |
23+
| dashboard.image.tag | string | `"v3.2.7.1"` | |
2424
| dashboard.replicaCount | int | `1` | |
2525
| dashboard_configuration.authentication_config.session_secret | string | `"changeme"` | |
2626
| dashboard_configuration.console.addr | string | `"http://127.0.0.1:3000"` | |
27-
| dashboard_configuration.database.postgres.addr | string | `"api7ee3-postgresql:5432"` | |
27+
| dashboard_configuration.database.postgres.addr | string | `"api7-postgresql:5432"` | |
2828
| dashboard_configuration.database.postgres.database | string | `"api7ee"` | |
2929
| dashboard_configuration.database.postgres.password | string | `"changeme"` | |
3030
| dashboard_configuration.database.postgres.user | string | `"api7ee"` | |
3131
| dashboard_configuration.database.type | string | `"postgres"` | |
3232
| dashboard_configuration.log.level | string | `"info"` | |
3333
| dashboard_configuration.log.output | string | `"stderr"` | |
3434
| dashboard_configuration.login.source | string | `"DB"` | |
35-
| dashboard_configuration.prometheus.addr | string | `"http://api7ee3-prometheus-server:9090"` | |
35+
| dashboard_configuration.prometheus.addr | string | `"http://api7-prometheus-server:9090"` | |
3636
| dashboard_configuration.prometheus.whitelist[0] | string | `"/api/v1/query_range"` | |
3737
| dashboard_configuration.prometheus.whitelist[1] | string | `"/api/v1/query"` | |
3838
| dashboard_configuration.prometheus.whitelist[2] | string | `"/api/v1/format_query"` | |
@@ -47,22 +47,20 @@ A Helm chart for Kubernetes
4747
| dashboard_configuration.server.listen.port | int | `7080` | |
4848
| dashboard_configuration.session_options_config.same_site | string | `"lax"` | |
4949
| dashboard_configuration.session_options_config.secure | bool | `false` | |
50-
| dashboard_configuration.user_manager.logout_url | string | `"https://login.api7.ai/v2/logout"` | |
51-
| dashboard_configuration.user_manager.oidc_provider | string | `"keycloak"` | |
5250
| dashboard_service.port | int | `7080` | |
5351
| dashboard_service.type | string | `"ClusterIP"` | |
5452
| dp_manager.image.pullPolicy | string | `"IfNotPresent"` | |
5553
| dp_manager.image.repository | string | `"api7/api7-ee-dp-manager"` | |
56-
| dp_manager.image.tag | string | `"v3.2.6.1"` | |
54+
| dp_manager.image.tag | string | `"v3.2.7.1"` | |
5755
| dp_manager.replicaCount | int | `1` | |
58-
| dp_manager_configuration.database.postgres.addr | string | `"api7ee3-postgresql:5432"` | |
56+
| dp_manager_configuration.database.postgres.addr | string | `"api7-postgresql:5432"` | |
5957
| dp_manager_configuration.database.postgres.database | string | `"api7ee"` | |
6058
| dp_manager_configuration.database.postgres.password | string | `"changeme"` | |
6159
| dp_manager_configuration.database.postgres.user | string | `"api7ee"` | |
6260
| dp_manager_configuration.database.type | string | `"postgres"` | |
6361
| dp_manager_configuration.log.level | string | `"info"` | |
6462
| dp_manager_configuration.log.output | string | `"stderr"` | |
65-
| dp_manager_configuration.prometheus.addr | string | `"http://api7ee3-prometheus-server:9090"` | |
63+
| dp_manager_configuration.prometheus.addr | string | `"http://api7-prometheus-server:9090"` | |
6664
| dp_manager_configuration.server.listen.host | string | `"0.0.0.0"` | |
6765
| dp_manager_configuration.server.listen.port | int | `7900` | |
6866
| dp_manager_configuration.server.status_listen.host | string | `"0.0.0.0"` | |
@@ -79,12 +77,14 @@ A Helm chart for Kubernetes
7977
| postgresql.auth.password | string | `"changeme"` | |
8078
| postgresql.auth.username | string | `"api7ee"` | |
8179
| postgresql.builtin | bool | `true` | |
82-
| postgresql.host | string | `"api7ee3-postgresql"` | |
83-
| postgresql.port | int | `5432` | |
80+
| postgresql.fullnameOverride | string | `"api7-postgresql"` | |
8481
| postgresql.primary.persistence.size | string | `"256Gi"` | |
82+
| postgresql.primary.service.ports.postgresql | int | `5432` | |
8583
| postgresql.readReplicas.persistence.size | string | `"256Gi"` | |
84+
| postgresql.readReplicas.service.ports.postgresql | int | `5432` | |
8685
| prometheus.alertmanager.enabled | bool | `false` | |
8786
| prometheus.builtin | bool | `true` | |
87+
| prometheus.fullnameOverride | string | `"api7-prometheus"` | |
8888
| prometheus.server.configuration | string | `""` | |
8989
| prometheus.server.enableAdminAPI | bool | `true` | |
9090
| prometheus.server.enableRemoteWriteReceiver | bool | `true` | |

charts/api7/templates/dashboard-deploy.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,22 @@ spec:
3131
- name: config
3232
configMap:
3333
name: {{ include "api7ee3.fullname" . }}-dashboard-config
34+
{{- if or .Values.postgresql.builtin .Values.prometheus.builtin }}
3435
initContainers:
36+
{{- if .Values.postgresql.builtin }}
3537
- name: wait-for-postgresql
3638
image: "{{ .Values.busybox.image.repository }}:{{ .Values.busybox.image.tag }}"
37-
command: [ 'sh', '-c', "until nc -z -v -w3 {{ .Values.postgresql.host }} {{ .Values.postgresql.port }}; do echo waiting for postgresql `date`; sleep 2; done;" ]
38-
{{- if .Values.prometheus.builtin }}
39+
command: [ 'sh', '-c', "until nc -z -v -w3 api7-postgresql 5432; do echo waiting for postgresql `date`; sleep 2; done;" ]
40+
securityContext:
41+
{{- toYaml .Values.securityContext | nindent 12 }}
42+
{{- end }}
43+
{{- if .Values.prometheus.builtin }}
3944
- name: wait-for-prometheus
4045
image: "{{ .Values.busybox.image.repository }}:{{ .Values.busybox.image.tag }}"
41-
command: [ 'sh', '-c', "until wget --timeout=3 -q --spider {{ .Values.dashboard_configuration.prometheus.addr }};do echo waiting for prometheus `date`; sleep 2; done;" ]
46+
command: [ 'sh', '-c', "until wget --timeout=3 -q --spider http://api7-prometheus-server:9090;do echo waiting for prometheus `date`; sleep 2; done;" ]
47+
securityContext:
48+
{{- toYaml .Values.securityContext | nindent 12 }}
49+
{{- end }}
4250
{{- end }}
4351
containers:
4452
- name: dashboard

charts/api7/templates/dp-manager-deploy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ spec:
3535
- name: wait-for-dashboard
3636
image: "{{ .Values.busybox.image.repository }}:{{ .Values.busybox.image.tag }}"
3737
command: [ 'sh', '-c', "until wget --timeout=3 -q --spider {{ include "api7ee3.fullname" . }}-dashboard:{{ .Values.dashboard_service.port }}/healthz;do echo waiting for dashboard `date`; sleep 2; done;" ]
38+
securityContext:
39+
{{- toYaml .Values.securityContext | nindent 12 }}
3840
containers:
3941
- name: dp-manager
4042
securityContext:

charts/api7/values.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ dashboard:
88
repository: api7/api7-ee-3-integrated
99
pullPolicy: IfNotPresent
1010
# Overrides the image tag whose default is the chart appVersion.
11-
tag: "v3.2.6.1"
11+
tag: "v3.2.7.1"
1212

1313
dp_manager:
1414
replicaCount: 1
1515
image:
1616
repository: api7/api7-ee-dp-manager
1717
pullPolicy: IfNotPresent
1818
# Overrides the image tag whose default is the chart appVersion.
19-
tag: "v3.2.6.1"
19+
tag: "v3.2.7.1"
2020

2121
imagePullSecret: ""
2222
nameOverride: ""
@@ -77,6 +77,7 @@ busybox:
7777

7878
prometheus:
7979
builtin: true
80+
fullnameOverride: "api7-prometheus"
8081
alertmanager:
8182
enabled: false
8283
server:
@@ -96,15 +97,20 @@ prometheus:
9697
configuration: ""
9798

9899
postgresql:
99-
host: api7ee3-postgresql
100-
port: 5432
101100
builtin: true
101+
fullnameOverride: "api7-postgresql"
102102
primary:
103103
persistence:
104104
size: 256Gi
105+
service:
106+
ports:
107+
postgresql: 5432
105108
readReplicas:
106109
persistence:
107110
size: 256Gi
111+
service:
112+
ports:
113+
postgresql: 5432
108114
auth:
109115
username: api7ee
110116
password: changeme
@@ -126,9 +132,6 @@ dashboard_configuration:
126132
secure: false
127133
authentication_config:
128134
session_secret: "changeme"
129-
user_manager:
130-
oidc_provider: "keycloak"
131-
logout_url: "https://login.api7.ai/v2/logout"
132135
login:
133136
source: DB
134137
log:
@@ -137,14 +140,14 @@ dashboard_configuration:
137140
database:
138141
type: postgres
139142
postgres:
140-
addr: api7ee3-postgresql:5432
143+
addr: api7-postgresql:5432
141144
user: api7ee
142145
password: "changeme"
143146
database: api7ee
144147
# max_idle_conns: 10
145148
# max_open_conns: 30
146149
prometheus:
147-
addr: "http://api7ee3-prometheus-server:9090"
150+
addr: "http://api7-prometheus-server:9090"
148151
whitelist:
149152
- "/api/v1/query_range"
150153
- "/api/v1/query"
@@ -168,9 +171,9 @@ dp_manager_configuration:
168171
database:
169172
type: postgres
170173
postgres:
171-
addr: api7ee3-postgresql:5432
174+
addr: api7-postgresql:5432
172175
user: api7ee
173176
password: "changeme"
174177
database: api7ee
175178
prometheus:
176-
addr: "http://api7ee3-prometheus-server:9090"
179+
addr: "http://api7-prometheus-server:9090"

0 commit comments

Comments
 (0)