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

Fix liveness probe #604

Merged
merged 6 commits into from
Mar 10, 2023
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: 0 additions & 14 deletions .ci/clusters/grpcurl-pv.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions .ci/clusters/grpcurl-pvc.yaml

This file was deleted.

7 changes: 4 additions & 3 deletions .ci/tests/integration/cases/health-check/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ spec:
maxPendingAsyncRequests: 1000
replicas: 1
maxReplicas: 5
liveness:
initialDelaySeconds: 10
periodSeconds: 10
pod:
liveness:
initialDelaySeconds: 30
periodSeconds: 10
logTopic: persistent://public/default/logging-function-logs
input:
topics:
Expand Down
7 changes: 1 addition & 6 deletions .ci/tests/integration/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,14 @@ setup:
bash .ci/upload_function.sh pypip
bash .ci/upload_function.sh go

- name: create grpcurl pv and pvc
command: |
kubectl apply -f .ci/clusters/grpcurl-pv.yaml
kubectl apply -f .ci/clusters/grpcurl-pvc.yaml

- name: install function-mesh operator
command: |
make generate
make helm-crds
image="function-mesh-operator:latest"
IMG=${image} make docker-build-skip-test
kind load docker-image ${image}
helm install ${FUNCTION_MESH_RELEASE_NAME} -n ${FUNCTION_MESH_NAMESPACE} --set operatorImage=${image} --set controllerManager.grpcurlPersistentVolumeClaim=grpcurl-pv-claim --create-namespace charts/function-mesh-operator
helm install ${FUNCTION_MESH_RELEASE_NAME} -n ${FUNCTION_MESH_NAMESPACE} --set operatorImage=${image} --create-namespace charts/function-mesh-operator
wait:
- namespace: function-mesh
resource: pod
Expand Down
11 changes: 9 additions & 2 deletions api/compute/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,14 +639,21 @@ type VPASpec struct {
}

type Liveness struct {
// only enable health check after ensure the runner image has `grpcurl` installed into `/pulsar/bin` dir
// and has the `InstanceCommunication.proto` in the `/pulsar/conf` dir
// +kubebuilder:validation:Optional
PeriodSeconds int32 `json:"periodSeconds,omitempty"`

// some functions may take a long time to start up(like download packages), so we need to set the initial delay
// +kubebuilder:validation:Optional
InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`

// Minimum consecutive successes for the probe to be considered successful after having failed.
// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
// +optional
SuccessThreshold int32 `json:"successThreshold,omitempty"`
// Minimum consecutive failures for the probe to be considered failed after having succeeded.
// Defaults to 3. Minimum value is 1.
// +optional
FailureThreshold int32 `json:"failureThreshold,omitempty"`
}

func (rc *ResourceCondition) SetCondition(condition ResourceConditionType, action ReconcileAction, status metav1.ConditionStatus) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1654,12 +1654,18 @@ spec:
type: object
liveness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
type: object
nodeSelector:
additionalProperties:
Expand Down Expand Up @@ -3503,7 +3509,7 @@ spec:
minReplicas:
default: 1
format: int32
minimum: 1
minimum: 0
type: integer
name:
type: string
Expand Down Expand Up @@ -4873,12 +4879,18 @@ spec:
type: object
liveness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
type: object
nodeSelector:
additionalProperties:
Expand Down Expand Up @@ -6412,7 +6424,7 @@ spec:
replicas:
default: 1
format: int32
minimum: 1
minimum: 0
type: integer
resources:
properties:
Expand Down Expand Up @@ -6629,7 +6641,7 @@ spec:
minReplicas:
default: 1
format: int32
minimum: 1
minimum: 0
type: integer
name:
type: string
Expand Down Expand Up @@ -8055,12 +8067,18 @@ spec:
type: object
liveness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
type: object
nodeSelector:
additionalProperties:
Expand Down Expand Up @@ -9594,7 +9612,7 @@ spec:
replicas:
default: 1
format: int32
minimum: 1
minimum: 0
type: integer
resources:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1673,12 +1673,18 @@ spec:
type: object
liveness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
type: object
nodeSelector:
additionalProperties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ spec:
minReplicas:
default: 1
format: int32
minimum: 1
minimum: 0
type: integer
name:
type: string
Expand Down Expand Up @@ -1607,12 +1607,18 @@ spec:
type: object
liveness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
type: object
nodeSelector:
additionalProperties:
Expand Down Expand Up @@ -3146,7 +3152,7 @@ spec:
replicas:
default: 1
format: int32
minimum: 1
minimum: 0
type: integer
resources:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ spec:
minReplicas:
default: 1
format: int32
minimum: 1
minimum: 0
type: integer
name:
type: string
Expand Down Expand Up @@ -1594,12 +1594,18 @@ spec:
type: object
liveness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
type: object
nodeSelector:
additionalProperties:
Expand Down Expand Up @@ -3133,7 +3139,7 @@ spec:
replicas:
default: 1
format: int32
minimum: 1
minimum: 0
type: integer
resources:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ spec:
- --pprof-addr=:{{ .Values.controllerManager.pprof.port }}
- --config-file={{ .Values.controllerManager.configFile }}
- --enable-init-containers={{ .Values.controllerManager.enableInitContainers }}
- --grpcurl-persistent-volume-claim={{ .Values.controllerManager.grpcurlPersistentVolumeClaim }}
env:
- name: NAMESPACE
valueFrom:
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion charts/function-mesh-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ controllerManager:
enable: false
port: 8090
enableInitContainers: false
grpcurlPersistentVolumeClaim: ""

admissionWebhook:
enabled: true
18 changes: 18 additions & 0 deletions config/crd/bases/compute.functionmesh.io_functionmeshes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1655,12 +1655,18 @@ spec:
type: object
liveness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
type: object
nodeSelector:
additionalProperties:
Expand Down Expand Up @@ -4874,12 +4880,18 @@ spec:
type: object
liveness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
type: object
nodeSelector:
additionalProperties:
Expand Down Expand Up @@ -8056,12 +8068,18 @@ spec:
type: object
liveness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
type: object
nodeSelector:
additionalProperties:
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/compute.functionmesh.io_functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1652,12 +1652,18 @@ spec:
type: object
liveness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
type: object
nodeSelector:
additionalProperties:
Expand Down
Loading