From ab965d95bbb0585be5f73ab4cd60311a8389af66 Mon Sep 17 00:00:00 2001 From: Tyler Nguyen Date: Mon, 12 Jul 2021 13:52:39 +0700 Subject: [PATCH] fix: enable livenessProbe for coredns autoscaler deployment Signed-off-by: Tyler Nguyen --- stable/coredns/Chart.yaml | 2 +- stable/coredns/README.md | 152 ++++++++++-------- .../templates/deployment-autoscaler.yaml | 12 ++ stable/coredns/values.yaml | 9 ++ 4 files changed, 107 insertions(+), 68 deletions(-) diff --git a/stable/coredns/Chart.yaml b/stable/coredns/Chart.yaml index c5b8316..6c69fbe 100644 --- a/stable/coredns/Chart.yaml +++ b/stable/coredns/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: coredns -version: 1.16.0 +version: 1.16.1 appVersion: 1.8.4 home: https://coredns.io icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png diff --git a/stable/coredns/README.md b/stable/coredns/README.md index 641f904..c98d705 100644 --- a/stable/coredns/README.md +++ b/stable/coredns/README.md @@ -46,73 +46,91 @@ The command removes all the Kubernetes components associated with the chart and ## Configuration -| Parameter | Description | Default | -|:----------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------| -| `image.repository` | The image repository to pull from | coredns/coredns | -| `image.tag` | The image tag to pull from | `1.8.4` | -| `image.pullPolicy` | Image pull policy | IfNotPresent | -| `replicaCount` | Number of replicas | 1 | -| `resources.limits.cpu` | Container maximum CPU | `100m` | -| `resources.limits.memory` | Container maximum memory | `128Mi` | -| `resources.requests.cpu` | Container requested CPU | `100m` | -| `resources.requests.memory` | Container requested memory | `128Mi` | -| `serviceType` | Kubernetes Service type | `ClusterIP` | -| `prometheus.service.enabled` | Set this to `true` to create Service for Prometheus metrics | `false` | -| `prometheus.service.annotations` | Annotations to add to the metrics Service | `{prometheus.io/scrape: "true", prometheus.io/port: "9153"}`| -| `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | -| `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | {} | -| `prometheus.monitor.namespace` | Selector to select which namespaces the Endpoints objects are discovered from. | `""` | -| `service.clusterIP` | IP address to assign to service | `""` | -| `service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""` | -| `service.externalIPs` | External IP addresses | [] | -| `service.externalTrafficPolicy` | Enable client source IP preservation | [] | -| `service.annotations` | Annotations to add to service | {} | -| `serviceAccount.create` | If true, create & use serviceAccount | false | -| `serviceAccount.name` | If not set & create is true, use template fullname | | -| `rbac.create` | If true, create & use RBAC resources | true | -| `rbac.pspEnable` | Specifies whether a PodSecurityPolicy should be created. | `false` | -| `isClusterService` | Specifies whether chart should be deployed as cluster-service or normal k8s app. | true | -| `priorityClassName` | Name of Priority Class to assign pods | `""` | -| `servers` | Configuration for CoreDNS and plugins | See values.yml | -| `affinity` | Affinity settings for pod assignment | {} | -| `nodeSelector` | Node labels for pod assignment | {} | -| `tolerations` | Tolerations for pod assignment | [] | -| `zoneFiles` | Configure custom Zone files | [] | -| `extraVolumes` | Optional array of volumes to create | [] | -| `extraVolumeMounts` | Optional array of volumes to mount inside the CoreDNS container | [] | -| `extraSecrets` | Optional array of secrets to mount inside the CoreDNS container | [] | -| `customLabels` | Optional labels for Deployment(s), Pod, Service, ServiceMonitor objects | {} | -| `rollingUpdate.maxUnavailable` | Maximum number of unavailable replicas during rolling update | `1` | -| `rollingUpdate.maxSurge` | Maximum number of pods created above desired number of pods | `25%` | -| `podDisruptionBudget` | Optional PodDisruptionBudget | {} | -| `podAnnotations` | Optional Pod only Annotations | {} | -| `terminationGracePeriodSeconds` | Optional duration in seconds the pod needs to terminate gracefully. | 30 | -| `preStopSleep` | Definition of Kubernetes preStop hook executed before Pod termination | {} | -| `hpa.enabled` | Enable Hpa autoscaler instead of proportional one | `false` | -| `hpa.minReplicas` | Hpa minimum number of CoreDNS replicas | `1` | -| `hpa.maxReplicas` | Hpa maximum number of CoreDNS replicas | `2` | -| `hpa.metrics` | Metrics definitions used by Hpa to scale up and down | {} | -| `autoscaler.enabled` | Optionally enabled a cluster-proportional-autoscaler for CoreDNS | `false` | -| `autoscaler.coresPerReplica` | Number of cores in the cluster per CoreDNS replica | `256` | -| `autoscaler.nodesPerReplica` | Number of nodes in the cluster per CoreDNS replica | `16` | -| `autoscaler.min` | Min size of replicaCount | 0 | -| `autoscaler.max` | Max size of replicaCount | 0 (aka no max) | -| `autoscaler.includeUnschedulableNodes` | Should the replicas scale based on the total number or only schedulable nodes | `false` | -| `autoscaler.preventSinglePointFailure` | If true does not allow single points of failure to form | `true` | -| `autoscaler.image.repository` | The image repository to pull autoscaler from | k8s.gcr.io/cluster-proportional-autoscaler-amd64 | -| `autoscaler.image.tag` | The image tag to pull autoscaler from | `1.8.1` | -| `autoscaler.image.pullPolicy` | Image pull policy for the autoscaler | IfNotPresent | -| `autoscaler.priorityClassName` | Optional priority class for the autoscaler pod. `priorityClassName` used if not set. | `""` | -| `autoscaler.affinity` | Affinity settings for pod assignment for autoscaler | {} | -| `autoscaler.nodeSelector` | Node labels for pod assignment for autoscaler | {} | -| `autoscaler.tolerations` | Tolerations for pod assignment for autoscaler | [] | -| `autoscaler.resources.limits.cpu` | Container maximum CPU for cluster-proportional-autoscaler | `20m` | -| `autoscaler.resources.limits.memory` | Container maximum memory for cluster-proportional-autoscaler | `10Mi` | -| `autoscaler.resources.requests.cpu` | Container requested CPU for cluster-proportional-autoscaler | `20m` | -| `autoscaler.resources.requests.memory` | Container requested memory for cluster-proportional-autoscaler | `10Mi` | -| `autoscaler.configmap.annotations` | Annotations to add to autoscaler config map. For example to stop CI renaming them | {} | -| `deployment.enabled` | Optionally disable the main deployment and its respective resources. | `true` | -| `deployment.name` | Name of the deployment if `deployment.enabled` is true. Otherwise the name of an existing deployment for the autoscaler or HPA to target. | `""` | +| Parameter | Description | Default | +|:------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------| +| `image.repository` | The image repository to pull from | coredns/coredns | +| `image.tag` | The image tag to pull from | `1.8.4` | +| `image.pullPolicy` | Image pull policy | IfNotPresent | +| `replicaCount` | Number of replicas | 1 | +| `resources.limits.cpu` | Container maximum CPU | `100m` | +| `resources.limits.memory` | Container maximum memory | `128Mi` | +| `resources.requests.cpu` | Container requested CPU | `100m` | +| `resources.requests.memory` | Container requested memory | `128Mi` | +| `serviceType` | Kubernetes Service type | `ClusterIP` | +| `prometheus.service.enabled` | Set this to `true` to create Service for Prometheus metrics | `false` | +| `prometheus.service.annotations` | Annotations to add to the metrics Service | `{prometheus.io/scrape: "true", prometheus.io/port: "9153"}`| +| `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | +| `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | {} | +| `prometheus.monitor.namespace` | Selector to select which namespaces the Endpoints objects are discovered from. | `""` | +| `service.clusterIP` | IP address to assign to service | `""` | +| `service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""` | +| `service.externalIPs` | External IP addresses | [] | +| `service.externalTrafficPolicy` | Enable client source IP preservation | [] | +| `service.annotations` | Annotations to add to service | {} | +| `serviceAccount.create` | If true, create & use serviceAccount | false | +| `serviceAccount.name` | If not set & create is true, use template fullname | | +| `rbac.create` | If true, create & use RBAC resources | true | +| `rbac.pspEnable` | Specifies whether a PodSecurityPolicy should be created. | `false` | +| `isClusterService` | Specifies whether chart should be deployed as cluster-service or normal k8s app. | true | +| `priorityClassName` | Name of Priority Class to assign pods | `""` | +| `servers` | Configuration for CoreDNS and plugins | See values.yml | +| `livenessProbe.enabled` | Enable/disable the Liveness probe | `true` | +| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `60` | +| `livenessProbe.periodSeconds` | How often to perform the probe | `10` | +| `livenessProbe.timeoutSeconds` | When the probe times out | `5` | +| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` | +| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | +| `readinessProbe.enabled` | Enable/disable the Readiness probe | `true` | +| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `30` | +| `readinessProbe.periodSeconds` | How often to perform the probe | `10` | +| `readinessProbe.timeoutSeconds` | When the probe times out | `5` | +| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` | +| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | +| `affinity` | Affinity settings for pod assignment | {} | +| `nodeSelector` | Node labels for pod assignment | {} | +| `tolerations` | Tolerations for pod assignment | [] | +| `zoneFiles` | Configure custom Zone files | [] | +| `extraVolumes` | Optional array of volumes to create | [] | +| `extraVolumeMounts` | Optional array of volumes to mount inside the CoreDNS container | [] | +| `extraSecrets` | Optional array of secrets to mount inside the CoreDNS container | [] | +| `customLabels` | Optional labels for Deployment(s), Pod, Service, ServiceMonitor objects | {} | +| `rollingUpdate.maxUnavailable` | Maximum number of unavailable replicas during rolling update | `1` | +| `rollingUpdate.maxSurge` | Maximum number of pods created above desired number of pods | `25%` | +| `podDisruptionBudget` | Optional PodDisruptionBudget | {} | +| `podAnnotations` | Optional Pod only Annotations | {} | +| `terminationGracePeriodSeconds` | Optional duration in seconds the pod needs to terminate gracefully. | 30 | +| `preStopSleep` | Definition of Kubernetes preStop hook executed before Pod termination | {} | +| `hpa.enabled` | Enable Hpa autoscaler instead of proportional one | `false` | +| `hpa.minReplicas` | Hpa minimum number of CoreDNS replicas | `1` | +| `hpa.maxReplicas` | Hpa maximum number of CoreDNS replicas | `2` | +| `hpa.metrics` | Metrics definitions used by Hpa to scale up and down | {} | +| `autoscaler.enabled` | Optionally enabled a cluster-proportional-autoscaler for CoreDNS | `false` | +| `autoscaler.coresPerReplica` | Number of cores in the cluster per CoreDNS replica | `256` | +| `autoscaler.nodesPerReplica` | Number of nodes in the cluster per CoreDNS replica | `16` | +| `autoscaler.min` | Min size of replicaCount | 0 | +| `autoscaler.max` | Max size of replicaCount | 0 (aka no max) | +| `autoscaler.includeUnschedulableNodes` | Should the replicas scale based on the total number or only schedulable nodes | `false` | +| `autoscaler.preventSinglePointFailure` | If true does not allow single points of failure to form | `true` | +| `autoscaler.image.repository` | The image repository to pull autoscaler from | k8s.gcr.io/cluster-proportional-autoscaler-amd64 | +| `autoscaler.image.tag` | The image tag to pull autoscaler from | `1.8.1` | +| `autoscaler.image.pullPolicy` | Image pull policy for the autoscaler | IfNotPresent | +| `autoscaler.priorityClassName` | Optional priority class for the autoscaler pod. `priorityClassName` used if not set. | `""` | +| `autoscaler.affinity` | Affinity settings for pod assignment for autoscaler | {} | +| `autoscaler.nodeSelector` | Node labels for pod assignment for autoscaler | {} | +| `autoscaler.tolerations` | Tolerations for pod assignment for autoscaler | [] | +| `autoscaler.resources.limits.cpu` | Container maximum CPU for cluster-proportional-autoscaler | `20m` | +| `autoscaler.resources.limits.memory` | Container maximum memory for cluster-proportional-autoscaler | `10Mi` | +| `autoscaler.resources.requests.cpu` | Container requested CPU for cluster-proportional-autoscaler | `20m` | +| `autoscaler.resources.requests.memory` | Container requested memory for cluster-proportional-autoscaler | `10Mi` | +| `autoscaler.configmap.annotations` | Annotations to add to autoscaler config map. For example to stop CI renaming them | {} | +| `autoscaler.livenessProbe.enabled` | Enable/disable the Liveness probe | `true` | +| `autoscaler.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `10` | +| `autoscaler.livenessProbe.periodSeconds` | How often to perform the probe | `5` | +| `autoscaler.livenessProbe.timeoutSeconds` | When the probe times out | `5` | +| `autoscaler.livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `3` | +| `autoscaler.livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | +| `deployment.enabled` | Optionally disable the main deployment and its respective resources. | `true` | +| `deployment.name` | Name of the deployment if `deployment.enabled` is true. Otherwise the name of an existing deployment for the autoscaler or HPA to target. | `""` | See `values.yaml` for configuration notes. Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/stable/coredns/templates/deployment-autoscaler.yaml b/stable/coredns/templates/deployment-autoscaler.yaml index 35e5fbb..517bb37 100644 --- a/stable/coredns/templates/deployment-autoscaler.yaml +++ b/stable/coredns/templates/deployment-autoscaler.yaml @@ -67,6 +67,18 @@ spec: imagePullPolicy: {{ .Values.autoscaler.image.pullPolicy }} resources: {{ toYaml .Values.autoscaler.resources | indent 10 }} + {{- if .Values.autoscaler.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: /healthz + port: 8080 + scheme: HTTP + initialDelaySeconds: {{ .Values.autoscaler.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.autoscaler.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.autoscaler.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.autoscaler.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.autoscaler.livenessProbe.failureThreshold }} + {{- end }} command: - /cluster-proportional-autoscaler - --namespace={{ .Release.Namespace }} diff --git a/stable/coredns/values.yaml b/stable/coredns/values.yaml index 1d91ec1..d7397c7 100644 --- a/stable/coredns/values.yaml +++ b/stable/coredns/values.yaml @@ -275,6 +275,15 @@ autoscaler: # i.e. strategy.spinnaker.io/versioned: "false" to ensure configmap isn't renamed annotations: {} + # Enables the livenessProbe for cluster-proportional-autoscaler - this requires version 1.8.0+ of the autoscaler + livenessProbe: + enabled: true + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 5 + failureThreshold: 3 + successThreshold: 1 + deployment: enabled: true name: ""