Skip to content

Commit

Permalink
Try to fix issue with health check but this libsonnet file is corrupt.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlewi committed Jan 9, 2018
1 parent 8ee50d7 commit 74273c7
Showing 1 changed file with 45 additions and 13 deletions.
58 changes: 45 additions & 13 deletions kubeflow/core/jupyterhub.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,36 @@ http {
return 200;
access_log off;
}
# location / {
# root /dev/null;
# }
# Return an ok suitable for health checking.
# This is a hack to deal with the fact that the path picked up the ingress depends
# on the readiness probe of the pod but if the pod doesn't exist it might default to /
location / {
root /dev/null;
return 200;
access_log off;
}
}

# See https://github.com/kubernetes/contrib/blob/master/ingress/controllers/gce/examples/health_checks/README.md#limitations
# The readiness probe determines the health check. But the health check needs to be on the same port
# as the ingress which is 80
server {
listen 80;

location /healthz {
return 200;
access_log off;
}

# Return an ok suitable for health checking.
# This is a hack to deal with the fact that the path picked up the ingress depends
# on the readiness probe of the pod but if the pod doesn't exist it might default to
location / {
return 200;
access_log off;
}
}
}
Expand Down Expand Up @@ -367,7 +395,11 @@ c.KubeSpawner.pvc_name_template = 'claim-{username}{servername}'
{
// This is the port on which it accepts connections
"containerPort": 9000
}
},
{
// This is the port for health check which must match ingress
"containerPort": 80,
},
],
"volumeMounts": [
{
Expand All @@ -378,7 +410,7 @@ c.KubeSpawner.pvc_name_template = 'claim-{username}{servername}'
"readinessProbe": {
"httpGet": {
"path": "/healthz",
"port": 9000
"port": 80
}
}
}, // iapSideCar
Expand Down Expand Up @@ -419,16 +451,16 @@ c.KubeSpawner.pvc_name_template = 'claim-{username}{servername}'
],
// Don't try listing specific ports.
// DO NOT submit
//"ports": [
// // Port 8000 is used by the hub to accept incoming requests.
// {
// "containerPort": 8000,
// },
// // Port 8081 accepts callbacks from the individual Jupyter pods.
// {
// "containerPort": 8081,
/// },
//],
"ports": [
// Port 8000 is used by the hub to accept incoming requests.
{
"containerPort": 8000,
},
// Port 8081 accepts callbacks from the individual Jupyter pods.
{
"containerPort": 8081,
},
],
}
] + sideCars,
"serviceAccountName": "jupyter-hub",
Expand Down

0 comments on commit 74273c7

Please sign in to comment.