Skip to content

Commit

Permalink
Probe Updates (#7)
Browse files Browse the repository at this point in the history
* Set probe values in debug

Signed-off-by: Luke Mallon (Nalum) <luke@mallon.ie>

* Set correct probe in webhook

Signed-off-by: Luke Mallon (Nalum) <luke@mallon.ie>

* Remove toleration

Signed-off-by: Luke Mallon (Nalum) <luke@mallon.ie>

* Fix spelling of readinessProbe

Signed-off-by: Luke Mallon (Nalum) <luke@mallon.ie>

* Update README config examples

Signed-off-by: Luke Mallon (Nalum) <luke@mallon.ie>

---------

Signed-off-by: Luke Mallon (Nalum) <luke@mallon.ie>
  • Loading branch information
Nalum committed Jan 13, 2024
1 parent 2575e50 commit dbc7fd0
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 14 deletions.
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,25 @@ For example, create a file `my-values.cue` with the following content:
```cue
values: {
controller: {
prometheus: enabled: true
config: logging: format: "json"
podDisruptionBudget: minAvailable: 2
monitoring: {
enabled: true
serviceMonitor: enabled: true
}
image: {
tag: "v1.12.7"
digest: "sha256:6425a6a27c8f9afc589202238504384300e26fa1e03f9bd55c4ca86b645316f4"
}
}
test: enabled: true
webhook: {
podDisruptionBudget: minAvailable: 2
}
test: enabled: false
}
```

Expand Down Expand Up @@ -123,26 +138,32 @@ for deploying in a non production manner the below configuration should suffice:
values: {
logLevel: 4
// There are two ways to setup high availability one is to set the replicas in each controller section, another is
// this shortcut, which defaults to the recommended settings defined here: https://cert-manager.io/docs/installation/best-practice/#high-availability
highAvailability: enabled: true
// Setting the above true will ignore controller: replicas: etc and use the below
// highAvailanility: controllerReplicas: 2
// highAvailanility: webhookReplicas: 3
// highAvailanility: caInjectorReplicas: 2
// By default ServiceAccount tokens are not mounted, instead a Volume and VolumeMount are setup to add the
// ServiceAccount token to the Pod, so here we're reversing that
controller: automountServiceAccountToken: true
controller: replicas: 1
controller: serviceAccount: automountServiceAccountToken: true
controller: volumes: []
controller: volumeMounts: []
caInjector: automountServiceAccountToken: true
caInjector: replicas: 1
caInjector: serviceAccount: automountServiceAccountToken: true
caInjector: volumes: []
caInjector: volumeMounts: []
webhook: automountServiceAccountToken: true
webhook: replicas: 1
webhook: serviceAccount: automountServiceAccountToken: true
webhook: volumes: []
webhook: volumeMounts: []
startupAPICheck: automountServiceAccountToken: true
startupAPICheck: replicas: 1
startupAPICheck: serviceAccount: automountServiceAccountToken: true
startupAPICheck: volumes: []
startupAPICheck: volumeMounts: []
Expand Down
21 changes: 21 additions & 0 deletions debug_values.cue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ values: {
monitoring: enabled: true
podDisruptionBudget: minAvailable: 2

livenessProbe: {
initialDelaySeconds: 30
periodSeconds: 15
failureThreshold: 4
timeoutSeconds: 2
}

strategy: {
type: "RollingUpdate"
rollingUpdate: {
Expand All @@ -30,6 +37,20 @@ values: {
webhook: {
podDisruptionBudget: minAvailable: 2

livenessProbe: {
initialDelaySeconds: 30
periodSeconds: 15
failureThreshold: 4
timeoutSeconds: 2
}

readinessProbe: {
initialDelaySeconds: 20
periodSeconds: 10
failureThreshold: 6
timeoutSeconds: 2
}

strategy: {
type: "RollingUpdate"
rollingUpdate: {
Expand Down
8 changes: 1 addition & 7 deletions templates/config/component.cue
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,7 @@ import (
}

strategy?: appsv1.#DeploymentStrategy
tolerations?: [...corev1.#Toleration] | [
{
key: "node-restriction.kubernetes.io/reserved-for"
operator: "Equal"
value: "platform"
},
]
tolerations?: [...corev1.#Toleration]
topologySpreadConstraints?: [...corev1.#TopologySpreadConstraint]

volumeMounts: [...corev1.#VolumeMount] | *[{
Expand Down
2 changes: 1 addition & 1 deletion templates/deploymentSpecWebhook.cue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ import (
}

if #main_config.webhook.readinessProbe != _|_ {
readinessProbe: #main_config.webhook.livenessProbe & {
readinessProbe: #main_config.webhook.readinessProbe & {
httpGet: {
port: "healthcheck"
path: "/healthz"
Expand Down

0 comments on commit dbc7fd0

Please sign in to comment.