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

Better handling for startupProbe and livenessProbe #125

Merged
merged 2 commits into from
Apr 6, 2021
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
10 changes: 10 additions & 0 deletions helm/tailing-sidecar-operator/templates/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,22 @@ spec:
scheme: HTTPS
path: /add-tailing-sidecars-v1-pod
port: 9443
httpHeaders:
- name: Accept
value: application/json
- name: Content-Type
value: application/json
periodSeconds: 3
livenessProbe:
httpGet:
scheme: HTTPS
path: /add-tailing-sidecars-v1-pod
port: 9443
httpHeaders:
- name: Accept
value: application/json
- name: Content-Type
value: application/json
initialDelaySeconds: 1
periodSeconds: 10
resources:
Expand Down
10 changes: 10 additions & 0 deletions operator/config/default/manager_webhook_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,22 @@ spec:
scheme: HTTPS
path: /add-tailing-sidecars-v1-pod
port: 9443
httpHeaders:
- name: Accept
value: application/json
- name: Content-Type
value: application/json
periodSeconds: 3
livenessProbe:
httpGet:
scheme: HTTPS
path: /add-tailing-sidecars-v1-pod
port: 9443
httpHeaders:
- name: Accept
value: application/json
- name: Content-Type
value: application/json
initialDelaySeconds: 1
periodSeconds: 10
volumeMounts:
Expand Down
4 changes: 4 additions & 0 deletions operator/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ type PodExtender struct {

// Handle handles requests to create/update Pod and extends it by adding tailing sidecars
func (e *PodExtender) Handle(ctx context.Context, req admission.Request) admission.Response {
if req.Operation == "" {
return admission.Allowed("Received startupProbe/livenessProbe")
}

if req.Operation == admv1.Delete {
// eliminates hanging kubectl apply -f command
// kube-apiserver server waits for response from operator on DELETE request
Expand Down