Skip to content

Commit

Permalink
[shipa-2326] add heathcheks into deployment (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
c12o16h1 authored Jan 18, 2022
1 parent 0e675c0 commit 99a7f1c
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 1 deletion.
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

0 comments on commit 99a7f1c

Please sign in to comment.