Probe is not enabled by default

This commit is contained in:
Laszlo Fogas
2020-10-22 09:55:51 +02:00
parent ed00f71754
commit e3e9980deb
8 changed files with 342 additions and 20 deletions
+1 -1
View File
@@ -15,4 +15,4 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.6.1
version: 0.7.0
+3 -1
View File
@@ -55,15 +55,17 @@ spec:
- name: http
containerPort: {{ .Values.containerPort }}
protocol: TCP
{{- if .Values.probe.enabled }}
readinessProbe:
failureThreshold: 3
httpGet:
path: {{ .Values.probe }}
path: {{ .Values.probe.path }}
port: {{ .Values.containerPort }}
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
{{- end }}
volumeMounts:
{{- range .Values.volumes }}
- name: {{ .name }}
@@ -0,0 +1,25 @@
suite: test deployment
templates:
- deployment.yaml
- configmap.yaml
tests:
- it: Should set a readiness probe
set:
probe:
enabled: true
asserts:
- equal:
path: spec.template.spec.containers[0].readinessProbe
value:
failureThreshold: 3
httpGet:
path: "/"
port: 8080
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
- it: Should not set a readinessProbe
asserts:
- isNull:
path: spec.template.spec.containers[0].readinessProbe
+283
View File
@@ -0,0 +1,283 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://example.com/example.json",
"type": "object",
"title": "The root schema",
"description": "The root schema comprises the entire JSON document.",
"default": {},
"examples": [
{
"image": {
"repository": "nginx",
"tag": "latest"
},
"replicas": 1,
"nameOverride": "",
"fullnameOverride": "",
"podAnnotations": {},
"podSecurityContext": {
"fsGroup": 999
},
"securityContext": {},
"containerPort": 8080,
"resources": {},
"nodeSelector": {},
"tolerations": [],
"affinity": {},
"secret": {
"enabled": false
},
"shell": "/bin/sh"
}
],
"required": [
"image",
"replicas",
"nameOverride",
"fullnameOverride",
"podAnnotations",
"podSecurityContext",
"securityContext",
"containerPort",
"resources",
"nodeSelector",
"tolerations",
"affinity",
"probe",
"secret",
"shell"
],
"properties": {
"image": {
"$id": "#/properties/image",
"type": "object",
"title": "The image schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"repository": "nginx",
"tag": "latest"
}
],
"required": [
"repository",
"tag"
],
"properties": {
"repository": {
"$id": "#/properties/image/properties/repository",
"type": "string",
"title": "The repository schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"nginx"
]
},
"tag": {
"$id": "#/properties/image/properties/tag",
"type": "string",
"title": "The tag schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"latest"
]
}
},
"additionalProperties": true
},
"replicas": {
"$id": "#/properties/replicas",
"type": "integer",
"title": "The replicas schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
1
]
},
"nameOverride": {
"$id": "#/properties/nameOverride",
"type": "string",
"title": "The nameOverride schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
""
]
},
"fullnameOverride": {
"$id": "#/properties/fullnameOverride",
"type": "string",
"title": "The fullnameOverride schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
""
]
},
"podAnnotations": {
"$id": "#/properties/podAnnotations",
"type": "object",
"title": "The podAnnotations schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{}
],
"required": [],
"additionalProperties": true
},
"podSecurityContext": {
"$id": "#/properties/podSecurityContext",
"type": "object",
"title": "The podSecurityContext schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"fsGroup": 999
}
],
"required": [
"fsGroup"
],
"properties": {
"fsGroup": {
"$id": "#/properties/podSecurityContext/properties/fsGroup",
"type": "integer",
"title": "The fsGroup schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
999
]
}
},
"additionalProperties": true
},
"securityContext": {
"$id": "#/properties/securityContext",
"type": "object",
"title": "The securityContext schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{}
],
"required": [],
"additionalProperties": true
},
"containerPort": {
"$id": "#/properties/containerPort",
"type": "integer",
"title": "The containerPort schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
8080
]
},
"resources": {
"$id": "#/properties/resources",
"type": "object",
"title": "The resources schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{}
],
"required": [],
"additionalProperties": true
},
"nodeSelector": {
"$id": "#/properties/nodeSelector",
"type": "object",
"title": "The nodeSelector schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{}
],
"required": [],
"additionalProperties": true
},
"tolerations": {
"$id": "#/properties/tolerations",
"type": "array",
"title": "The tolerations schema",
"description": "An explanation about the purpose of this instance.",
"default": [],
"examples": [
[]
],
"additionalItems": true,
"items": {
"$id": "#/properties/tolerations/items"
}
},
"affinity": {
"$id": "#/properties/affinity",
"type": "object",
"title": "The affinity schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{}
],
"required": [],
"additionalProperties": true
},
"probe": {
"$id": "#/properties/probe",
"type": "object",
"title": "The probe schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"/"
]
},
"secret": {
"$id": "#/properties/secret",
"type": "object",
"title": "The secret schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"enabled": false
}
],
"required": [
"enabled"
],
"properties": {
"enabled": {
"$id": "#/properties/secret/properties/enabled",
"type": "boolean",
"title": "The enabled schema",
"description": "An explanation about the purpose of this instance.",
"default": false,
"examples": [
false
]
}
},
"additionalProperties": true
},
"shell": {
"$id": "#/properties/shell",
"type": "string",
"title": "The shell schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"/bin/sh"
]
}
},
"additionalProperties": true
}
+3 -1
View File
@@ -24,7 +24,9 @@ tolerations: []
affinity: {}
probe: "/"
probe:
enabled: false
path: "/"
secret:
enabled: false