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

Update probe settings #1028

Merged
merged 1 commit into from
Jun 24, 2020
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
5 changes: 3 additions & 2 deletions config/master/aws-k8s-cni-cn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"command":
- "/app/grpc-health-probe"
- "-addr=:50051"
"initialDelaySeconds": 35
"initialDelaySeconds": 60
"name": "aws-node"
"ports":
- "containerPort": 61678
Expand All @@ -128,7 +128,7 @@
"command":
- "/app/grpc-health-probe"
- "-addr=:50051"
"initialDelaySeconds": 35
"initialDelaySeconds": 1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helped a lot! I tested on a cluster with 50 pods on 3 nodes:

kube-system   aws-node-2ph8t              0/1     ContainerCreating   0          1s      
kube-system   aws-node-2ph8t              1/1     Running             0          3s 

"resources":
"requests":
"cpu": "10m"
Expand Down Expand Up @@ -161,6 +161,7 @@
"name": "cni-bin-dir"
"priorityClassName": "system-node-critical"
"serviceAccountName": "aws-node"
"terminationGracePeriodSeconds": 10
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default terminationGracePeriodSeconds is 30 seconds. The CNI does not really need any time to shut down, so reducing this to 10s.

Copy link
Contributor

@anguslees anguslees Jun 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not zero (sigkill the pod immediately)?

Copy link
Contributor Author

@mogren mogren Jun 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I did set it at 10s on purpose to avoid leaking ENIs. There is a shutdown hook and that flag is checked before trying to free or add an ENI. If the shutdown happens just when ipamd has detached an ENI, but before it has deleted it, we would "leak" it. It usually takes around 2 seconds for the detach to complete, but p99 is 10s according to EC2. Same for creating ENIs, we want the create to complete and the ENI to be attached to the node (with the delete on termination flag set) so that it gets cleaned up if the node terminates.

That said, i don't think we have done enough testing on this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(:rocket: This is exactly the sort of analysis I was hoping to capture)

"tolerations":
- "operator": "Exists"
"volumes":
Expand Down
5 changes: 3 additions & 2 deletions config/master/aws-k8s-cni-us-gov-east-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"command":
- "/app/grpc-health-probe"
- "-addr=:50051"
"initialDelaySeconds": 35
"initialDelaySeconds": 60
"name": "aws-node"
"ports":
- "containerPort": 61678
Expand All @@ -128,7 +128,7 @@
"command":
- "/app/grpc-health-probe"
- "-addr=:50051"
"initialDelaySeconds": 35
"initialDelaySeconds": 1
"resources":
"requests":
"cpu": "10m"
Expand Down Expand Up @@ -161,6 +161,7 @@
"name": "cni-bin-dir"
"priorityClassName": "system-node-critical"
"serviceAccountName": "aws-node"
"terminationGracePeriodSeconds": 10
"tolerations":
- "operator": "Exists"
"volumes":
Expand Down
5 changes: 3 additions & 2 deletions config/master/aws-k8s-cni-us-gov-west-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"command":
- "/app/grpc-health-probe"
- "-addr=:50051"
"initialDelaySeconds": 35
"initialDelaySeconds": 60
"name": "aws-node"
"ports":
- "containerPort": 61678
Expand All @@ -128,7 +128,7 @@
"command":
- "/app/grpc-health-probe"
- "-addr=:50051"
"initialDelaySeconds": 35
"initialDelaySeconds": 1
"resources":
"requests":
"cpu": "10m"
Expand Down Expand Up @@ -161,6 +161,7 @@
"name": "cni-bin-dir"
"priorityClassName": "system-node-critical"
"serviceAccountName": "aws-node"
"terminationGracePeriodSeconds": 10
"tolerations":
- "operator": "Exists"
"volumes":
Expand Down
5 changes: 3 additions & 2 deletions config/master/aws-k8s-cni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"command":
- "/app/grpc-health-probe"
- "-addr=:50051"
"initialDelaySeconds": 35
"initialDelaySeconds": 60
"name": "aws-node"
"ports":
- "containerPort": 61678
Expand All @@ -128,7 +128,7 @@
"command":
- "/app/grpc-health-probe"
- "-addr=:50051"
"initialDelaySeconds": 35
"initialDelaySeconds": 1
"resources":
"requests":
"cpu": "10m"
Expand Down Expand Up @@ -161,6 +161,7 @@
"name": "cni-bin-dir"
"priorityClassName": "system-node-critical"
"serviceAccountName": "aws-node"
"terminationGracePeriodSeconds": 10
"tolerations":
- "operator": "Exists"
"volumes":
Expand Down
7 changes: 5 additions & 2 deletions config/master/manifests.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ local awsnode = {
},
spec: {
priorityClassName: "system-node-critical",
terminationGracePeriodSeconds: 10,
affinity: {
nodeAffinity: {
requiredDuringSchedulingIgnoredDuringExecution: {
Expand Down Expand Up @@ -143,9 +144,11 @@ local awsnode = {
exec: {
command: ["/app/grpc-health-probe", "-addr=:50051"],
},
initialDelaySeconds: 35,
initialDelaySeconds: 1,
},
livenessProbe: self.readinessProbe + {
initialDelaySeconds: 60,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says "Increase liveness polling period". I think this PR increases the liveness initial delay period however - which one was intended? (I suspect this should have been periodSeconds=60)

(Separately) jsonnet style tip: You can "merge" values with +. Since liveness/readiness probes are very similar, I would do this as:

livenessProbe: self.readinessProbe + {
    initialDelaySeconds: 60, // If desired, but see above comment
    periodSeconds: 60,
},

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix the comment. I think, like you said in #1028 (comment), that we should just increase the initial timeout, but keep the period at the default in order to catch issues that happen after startup faster. That should give the aws-node about 90 seconds to get started, after a 60 s startup delay and three 10 s liveness probes.

},
livenessProbe: self.readinessProbe,
env_:: {
AWS_VPC_ENI_MTU: "9001",
AWS_VPC_K8S_CNI_CONFIGURE_RPFILTER: "false",
Expand Down