Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[shipa-2326] add heathcheks into deployment #226

Merged
merged 1 commit into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion internal/chart/application_chart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ func TestNewApplicationChart(t *testing.T) {
{Name: "registry-secret"},
{Name: "private-registry-secret"},
},
KetchYaml: &ketchv1.KetchYamlData{
Healthcheck: &ketchv1.KetchYamlHealthcheck{
Path: "/actuator/health/liveness",
Method: "GET",
Scheme: "http",
Match: ".*UP.*",
UseInRouter: true,
ForceRestart: false,
AllowedFailures: 0,
IntervalSeconds: 0,
TimeoutSeconds: 0,
},
},
},
{
Image: "shipasoftware/go-app:v2",
Expand Down Expand Up @@ -331,7 +344,6 @@ func TestNewApplicationChart(t *testing.T) {
}

client := HelmClient{cfg: &action.Configuration{KubeClient: &fake.PrintingKubeClient{}, Releases: storage.Init(driver.NewMemory())}, namespace: tt.framework.Spec.NamespaceName, c: clientfake.NewClientBuilder().Build()}

release, err := client.UpdateChart(*got, chartConfig, func(install *action.Install) {
install.DryRun = true
install.ClientOnly = true
Expand Down
16 changes: 16 additions & 0 deletions internal/chart/testdata/charts/dashboard-istio-cluster-issuer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ spec:
requests:
cpu: 5Gi
memory: 5300m
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down Expand Up @@ -235,6 +243,14 @@ spec:
image: shipasoftware/go-app:v1
ports:
- containerPort: 9090
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down
16 changes: 16 additions & 0 deletions internal/chart/testdata/charts/dashboard-istio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ spec:
requests:
cpu: 5Gi
memory: 5300m
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down Expand Up @@ -235,6 +243,14 @@ spec:
image: shipasoftware/go-app:v1
ports:
- containerPort: 9090
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down
16 changes: 16 additions & 0 deletions internal/chart/testdata/charts/dashboard-nginx-cluster-issuer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ spec:
requests:
cpu: 5Gi
memory: 5300m
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down Expand Up @@ -235,6 +243,14 @@ spec:
image: shipasoftware/go-app:v1
ports:
- containerPort: 9090
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down
16 changes: 16 additions & 0 deletions internal/chart/testdata/charts/dashboard-nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ spec:
requests:
cpu: 5Gi
memory: 5300m
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down Expand Up @@ -237,6 +245,14 @@ spec:
image: shipasoftware/go-app:v1
ports:
- containerPort: 9090
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ spec:
requests:
cpu: 5Gi
memory: 5300m
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down Expand Up @@ -235,6 +243,14 @@ spec:
image: shipasoftware/go-app:v1
ports:
- containerPort: 9090
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ spec:
requests:
cpu: 5Gi
memory: 5300m
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down Expand Up @@ -235,6 +243,14 @@ spec:
image: shipasoftware/go-app:v1
ports:
- containerPort: 9090
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down
16 changes: 16 additions & 0 deletions internal/chart/testdata/charts/dashboard-traefik.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ spec:
requests:
cpu: 5Gi
memory: 5300m
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down Expand Up @@ -235,6 +243,14 @@ spec:
image: shipasoftware/go-app:v1
ports:
- containerPort: 9090
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 9090
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 60
imagePullSecrets:
- name: registry-secret
- name: private-registry-secret
Expand Down
8 changes: 8 additions & 0 deletions internal/templates/common/yamls/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ spec:
securityContext:
{{ $process.securityContext | toYaml | indent 12 }}
{{- end }}
{{- if $process.readinessProbe }}
readinessProbe:
{{ $process.readinessProbe | toYaml | indent 12 }}
{{- end }}
{{- if $process.livenessProbe }}
livenessProbe:
{{ $process.livenessProbe | toYaml | indent 12 }}
{{- end }}
{{- if $deployment.imagePullSecrets }}
imagePullSecrets:
{{ $deployment.imagePullSecrets | toYaml | indent 12}}
Expand Down