Skip to content

Commit

Permalink
implement ready/live probe customization
Browse files Browse the repository at this point in the history
add missing fields for probes

fix nil pointer dereference in get methods for live/ready probes

move crd to proper version, add documentation

format
  • Loading branch information
hubeadmin committed Dec 8, 2020
1 parent abacc53 commit 6dc868f
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 53 deletions.
72 changes: 69 additions & 3 deletions deploy/crds/Grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ spec:
singular: grafana
scope: Namespaced
subresources:
status: {}
status: { }
version: v1alpha1
validation:
openAPIV3Schema:
required: ["spec"]
required: [ "spec" ]
properties:
spec:
properties:
Expand Down Expand Up @@ -106,7 +106,7 @@ spec:
labels:
type: object
description: Additional labels for the service
nodeSelector:
nodeSelector:
type: object
description: Additional labels for the running grafana pods in a labeled node.
tolerations:
Expand Down Expand Up @@ -147,3 +147,69 @@ spec:
jsonnet:
type: object
description: Jsonnet library configuration
livenessProbeSpec:
type: object
properties:
initialDelaySeconds:
description: 'Number of seconds after the container has
started before liveness probes are initiated. More info:
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes'
format: int32
type: integer
timeoutSeconds:
description: Number of seconds after which the probe times out. Defaults to 1 second.
Minimum value is 1.
format: int32
type: integer
periodSeconds:
description: How often (in seconds) to perform the probe.
Default to 10 seconds. Minimum value is 1.
format: int32
type: integer
successThreshold:
description: Minimum consecutive successes for the probe
to be considered successful after having failed. Defaults
to 1. Must be 1 for liveness and startup. Minimum value
is 1.
format: int32
type: integer
failureThreshold:
description: When a probe fails, Kubernetes will try failureThreshold times before giving up.
Giving up in case of liveness probe means restarting the container.
In case of readiness probe the Pod will be marked Unready.
Defaults to 3. Minimum value is 1.
format: int32
type: integer
readinessProbeSpec:
type: object
properties:
initialDelaySeconds:
description: 'Number of seconds after the container has
started before liveness probes are initiated. More info:
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes'
format: int32
type: integer
timeoutSeconds:
description: Number of seconds after which the probe times out. Defaults to 1 second.
Minimum value is 1.
format: int32
type: integer
periodSeconds:
description: How often (in seconds) to perform the probe.
Default to 10 seconds. Minimum value is 1.
format: int32
type: integer
successThreshold:
description: Minimum consecutive successes for the probe
to be considered successful after having failed. Defaults
to 1. Must be 1 for liveness and startup. Minimum value
is 1.
format: int32
type: integer
failureThreshold:
description: When a probe fails, Kubernetes will try failureThreshold times before giving up.
Giving up in case of liveness probe means restarting the container.
In case of readiness probe the Pod will be marked Unready.
Defaults to 3. Minimum value is 1.
format: int32
type: integer
2 changes: 1 addition & 1 deletion deploy/examples/Grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ spec:
memory: 8000Mi
requests:
cpu: 100m
memory: 200Mi
memory: 200Mi
4 changes: 2 additions & 2 deletions deploy/olm-catalog/grafana-operator/2.x.x/Grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
version: v1alpha1
validation:
openAPIV3Schema:
required: ["spec"]
required: [ "spec" ]
properties:
spec:
properties:
Expand Down Expand Up @@ -90,4 +90,4 @@ spec:
type: array
items:
type: object
description: Label selector or match expressions
description: Label selector or match expressions
Loading

0 comments on commit 6dc868f

Please sign in to comment.