Skip to content

Commit

Permalink
Merge pull request #710 from CatherineF-dev/readiness-probe
Browse files Browse the repository at this point in the history
Add readiness and liveness probe
  • Loading branch information
CatherineF-dev committed May 6, 2024
2 parents adccd05 + 34b3c25 commit 2001ba0
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 7 deletions.
2 changes: 1 addition & 1 deletion custom-metrics-stackdriver-adapter/adapter-beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ spec:
ports:
- port: 443
protocol: TCP
targetPort: 443
targetPort: 6443
selector:
run: custom-metrics-stackdriver-adapter
k8s-app: custom-metrics-stackdriver-adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ spec:
command:
- /adapter
- --use-new-resource-model=false
- --secure-port=6443
ports:
- containerPort: 6443
name: https
readinessProbe:
failureThreshold: 5
httpGet:
path: /readyz
port: https
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
livenessProbe:
failureThreshold: 5
httpGet:
path: /livez
port: https
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
resources:
limits:
cpu: 250m
Expand All @@ -100,7 +120,7 @@ spec:
ports:
- port: 443
protocol: TCP
targetPort: 443
targetPort: 6443
selector:
run: custom-metrics-stackdriver-adapter
k8s-app: custom-metrics-stackdriver-adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,26 @@ spec:
- /adapter
- --use-new-resource-model=true
- --fallback-for-container-metrics=true
- --secure-port=6443
ports:
- containerPort: 6443
name: https
readinessProbe:
failureThreshold: 5
httpGet:
path: /readyz
port: https
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
livenessProbe:
failureThreshold: 5
httpGet:
path: /livez
port: https
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
resources:
limits:
cpu: 250m
Expand All @@ -118,7 +138,7 @@ spec:
ports:
- port: 443
protocol: TCP
targetPort: 443
targetPort: 6443
selector:
run: custom-metrics-stackdriver-adapter
k8s-app: custom-metrics-stackdriver-adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,26 @@ spec:
- /adapter
- --use-new-resource-model=true
- --fallback-for-container-metrics=true
- --secure-port=6443
ports:
- containerPort: 6443
name: https
readinessProbe:
failureThreshold: 5
httpGet:
path: /readyz
port: https
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
livenessProbe:
failureThreshold: 5
httpGet:
path: /livez
port: https
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
resources:
limits:
cpu: 250m
Expand All @@ -122,7 +142,7 @@ spec:
ports:
- port: 443
protocol: TCP
targetPort: 443
targetPort: 6443
selector:
run: custom-metrics-stackdriver-adapter
k8s-app: custom-metrics-stackdriver-adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,26 @@ spec:
command:
- /adapter
- --use-new-resource-model=false
- --secure-port=6443
ports:
- containerPort: 6443
name: https
readinessProbe:
failureThreshold: 5
httpGet:
path: /readyz
port: https
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
livenessProbe:
failureThreshold: 5
httpGet:
path: /livez
port: https
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
resources:
limits:
cpu: 250m
Expand All @@ -104,7 +124,7 @@ spec:
ports:
- port: 443
protocol: TCP
targetPort: 443
targetPort: 6443
selector:
run: custom-metrics-stackdriver-adapter
k8s-app: custom-metrics-stackdriver-adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,26 @@ spec:
- /adapter
- --use-new-resource-model=true
- --enable-core-metrics-api
- --secure-port=6443
ports:
- containerPort: 6443
name: https
readinessProbe:
failureThreshold: 5
httpGet:
path: /readyz
port: https
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
livenessProbe:
failureThreshold: 5
httpGet:
path: /livez
port: https
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
resources:
limits:
cpu: 250m
Expand All @@ -122,7 +142,7 @@ spec:
ports:
- port: 443
protocol: TCP
targetPort: 443
targetPort: 6443
selector:
run: custom-metrics-stackdriver-adapter
k8s-app: custom-metrics-stackdriver-adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ func TestCoreprovider_GetPodMetrics_Many(t *testing.T) {
t.Fatalf("Unexpected result. Expected len: \n%v,\n received: \n%v", len(expectedPodMetrics), len(podMetrics))
}

if diff := cmp.Diff(expectedPodMetrics, podMetrics, cmpopts.SortMaps(func(a, b metrics.ContainerMetrics) bool { return a.Name < b.Name }), cmpopts.IgnoreFields(metrics.PodMetrics{}, "ObjectMeta", "CreationTimestamp")); diff != "" {
if diff := cmp.Diff(expectedPodMetrics, podMetrics, cmpopts.SortSlices(func(a, b metrics.ContainerMetrics) bool { return a.Name < b.Name }), cmpopts.IgnoreFields(metrics.PodMetrics{}, "ObjectMeta", "CreationTimestamp")); diff != "" {
t.Errorf("Has a diff, (-want, +got): %s. Want: %v, got: %v.", diff, expectedPodMetrics, podMetrics)
}

Expand Down

0 comments on commit 2001ba0

Please sign in to comment.