Merge upstream/master-vnext into feature/add-network-policy
Resolve conflicts by combining NetworkPolicy feature with all features from master-vnext integration branch: - NetworkPolicy support (this branch) - HTTPRoute support - envFrom support - Startup probe - Cache persistence - IPv6 dual-stack - revisionHistoryLimit - initContainers deprecation Updated version to 3.0.0 and merged all changelog entries. Regenerated README.md from template. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
14 files changed
+1351
-19
No files matched your search
@@ -0,0 +1,160 @@
|
||||
suite: test cache persistence
|
||||
templates:
|
||||
- deployment.yaml
|
||||
- persistentVolumeClaim.yaml
|
||||
tests:
|
||||
# Deployment volume mount tests
|
||||
- it: should mount cache as emptyDir by default
|
||||
template: deployment.yaml
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: cache
|
||||
emptyDir: {}
|
||||
|
||||
- it: should mount cache PVC when enabled
|
||||
template: deployment.yaml
|
||||
set:
|
||||
persistence.cache.enabled: true
|
||||
persistence.cache.type: pvc
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: cache
|
||||
persistentVolumeClaim:
|
||||
claimName: RELEASE-NAME-jellyfin-cache
|
||||
|
||||
- it: should mount cache from hostPath when configured
|
||||
template: deployment.yaml
|
||||
set:
|
||||
persistence.cache.enabled: true
|
||||
persistence.cache.type: hostPath
|
||||
persistence.cache.hostPath: /mnt/jellyfin-cache
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: cache
|
||||
hostPath:
|
||||
path: /mnt/jellyfin-cache
|
||||
|
||||
- it: should mount cache at correct path
|
||||
template: deployment.yaml
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
content:
|
||||
name: cache
|
||||
mountPath: /cache
|
||||
|
||||
# PVC tests
|
||||
- it: should not create cache PVC by default
|
||||
template: persistentVolumeClaim.yaml
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2 # config and media only
|
||||
|
||||
- it: should create cache PVC when enabled
|
||||
template: persistentVolumeClaim.yaml
|
||||
set:
|
||||
persistence.cache.enabled: true
|
||||
persistence.cache.type: pvc
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3 # config, media, and cache
|
||||
- contains:
|
||||
path: metadata.name
|
||||
content: RELEASE-NAME-jellyfin-cache
|
||||
|
||||
- it: should not create cache PVC when type is hostPath
|
||||
template: persistentVolumeClaim.yaml
|
||||
set:
|
||||
persistence.cache.enabled: true
|
||||
persistence.cache.type: hostPath
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2 # config and media only
|
||||
|
||||
- it: should not create cache PVC when type is emptyDir
|
||||
template: persistentVolumeClaim.yaml
|
||||
set:
|
||||
persistence.cache.enabled: true
|
||||
persistence.cache.type: emptyDir
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
|
||||
- it: should set cache PVC size correctly
|
||||
template: persistentVolumeClaim.yaml
|
||||
documentIndex: 2
|
||||
set:
|
||||
persistence.cache.enabled: true
|
||||
persistence.cache.type: pvc
|
||||
persistence.cache.size: 20Gi
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.resources.requests.storage
|
||||
value: 20Gi
|
||||
|
||||
- it: should set cache PVC access mode
|
||||
template: persistentVolumeClaim.yaml
|
||||
documentIndex: 2
|
||||
set:
|
||||
persistence.cache.enabled: true
|
||||
persistence.cache.type: pvc
|
||||
persistence.cache.accessMode: ReadWriteMany
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.accessModes
|
||||
content: ReadWriteMany
|
||||
|
||||
- it: should set cache PVC storage class
|
||||
template: persistentVolumeClaim.yaml
|
||||
documentIndex: 2
|
||||
set:
|
||||
persistence.cache.enabled: true
|
||||
persistence.cache.type: pvc
|
||||
persistence.cache.storageClass: fast-ssd
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.storageClassName
|
||||
value: fast-ssd
|
||||
|
||||
- it: should add annotations to cache PVC
|
||||
template: persistentVolumeClaim.yaml
|
||||
documentIndex: 2
|
||||
set:
|
||||
persistence.cache.enabled: true
|
||||
persistence.cache.type: pvc
|
||||
persistence.cache.annotations:
|
||||
my-annotation: my-value
|
||||
asserts:
|
||||
- equal:
|
||||
path: metadata.annotations.my-annotation
|
||||
value: my-value
|
||||
|
||||
- it: should use existing claim when specified
|
||||
template: deployment.yaml
|
||||
set:
|
||||
persistence.cache.enabled: true
|
||||
persistence.cache.type: pvc
|
||||
persistence.cache.existingClaim: my-existing-cache-claim
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: cache
|
||||
persistentVolumeClaim:
|
||||
claimName: my-existing-cache-claim
|
||||
|
||||
- it: should not create PVC when existing claim used
|
||||
template: persistentVolumeClaim.yaml
|
||||
set:
|
||||
persistence.cache.enabled: true
|
||||
persistence.cache.type: pvc
|
||||
persistence.cache.existingClaim: my-existing-cache-claim
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2 # config and media only, not cache
|
||||
@@ -0,0 +1,122 @@
|
||||
suite: test envFrom
|
||||
templates:
|
||||
- deployment.yaml
|
||||
tests:
|
||||
- it: should not have envFrom by default
|
||||
asserts:
|
||||
- isNull:
|
||||
path: spec.template.spec.containers[0].envFrom
|
||||
|
||||
- it: should add envFrom from ConfigMap
|
||||
set:
|
||||
jellyfin.envFrom:
|
||||
- configMapRef:
|
||||
name: jellyfin-config
|
||||
asserts:
|
||||
- isNotNull:
|
||||
path: spec.template.spec.containers[0].envFrom
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.containers[0].envFrom
|
||||
count: 1
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0].configMapRef.name
|
||||
value: jellyfin-config
|
||||
|
||||
- it: should add envFrom from Secret
|
||||
set:
|
||||
jellyfin.envFrom:
|
||||
- secretRef:
|
||||
name: jellyfin-secrets
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0].secretRef.name
|
||||
value: jellyfin-secrets
|
||||
|
||||
- it: should support multiple envFrom sources
|
||||
set:
|
||||
jellyfin.envFrom:
|
||||
- configMapRef:
|
||||
name: jellyfin-config
|
||||
- secretRef:
|
||||
name: jellyfin-secrets
|
||||
- configMapRef:
|
||||
name: jellyfin-extra-config
|
||||
asserts:
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.containers[0].envFrom
|
||||
count: 3
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0].configMapRef.name
|
||||
value: jellyfin-config
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[1].secretRef.name
|
||||
value: jellyfin-secrets
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[2].configMapRef.name
|
||||
value: jellyfin-extra-config
|
||||
|
||||
- it: should support optional ConfigMap
|
||||
set:
|
||||
jellyfin.envFrom:
|
||||
- configMapRef:
|
||||
name: optional-config
|
||||
optional: true
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0].configMapRef.optional
|
||||
value: true
|
||||
|
||||
- it: should support optional Secret
|
||||
set:
|
||||
jellyfin.envFrom:
|
||||
- secretRef:
|
||||
name: optional-secret
|
||||
optional: true
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0].secretRef.optional
|
||||
value: true
|
||||
|
||||
- it: should support prefix for ConfigMap
|
||||
set:
|
||||
jellyfin.envFrom:
|
||||
- configMapRef:
|
||||
name: my-config
|
||||
prefix: CONFIG_
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0].prefix
|
||||
value: CONFIG_
|
||||
|
||||
- it: should support prefix for Secret
|
||||
set:
|
||||
jellyfin.envFrom:
|
||||
- secretRef:
|
||||
name: my-secret
|
||||
prefix: SECRET_
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0].prefix
|
||||
value: SECRET_
|
||||
|
||||
- it: should work alongside regular env variables
|
||||
set:
|
||||
jellyfin.env:
|
||||
- name: CUSTOM_VAR
|
||||
value: custom-value
|
||||
jellyfin.envFrom:
|
||||
- configMapRef:
|
||||
name: jellyfin-config
|
||||
asserts:
|
||||
- isNotNull:
|
||||
path: spec.template.spec.containers[0].env
|
||||
- isNotNull:
|
||||
path: spec.template.spec.containers[0].envFrom
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: CUSTOM_VAR
|
||||
value: custom-value
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0].configMapRef.name
|
||||
value: jellyfin-config
|
||||
@@ -0,0 +1,193 @@
|
||||
suite: test httproute
|
||||
templates:
|
||||
- httproute.yaml
|
||||
tests:
|
||||
- it: should not create HTTPRoute by default
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: should create HTTPRoute when enabled
|
||||
set:
|
||||
httpRoute.enabled: true
|
||||
httpRoute.parentRefs:
|
||||
- name: my-gateway
|
||||
namespace: gateway-system
|
||||
httpRoute.rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- isKind:
|
||||
of: HTTPRoute
|
||||
- isAPIVersion:
|
||||
of: gateway.networking.k8s.io/v1
|
||||
- equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-jellyfin
|
||||
|
||||
- it: should add annotations when specified
|
||||
set:
|
||||
httpRoute.enabled: true
|
||||
httpRoute.annotations:
|
||||
my-annotation: my-value
|
||||
httpRoute.parentRefs:
|
||||
- name: my-gateway
|
||||
httpRoute.rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
asserts:
|
||||
- equal:
|
||||
path: metadata.annotations.my-annotation
|
||||
value: my-value
|
||||
|
||||
- it: should set parentRefs correctly
|
||||
set:
|
||||
httpRoute.enabled: true
|
||||
httpRoute.parentRefs:
|
||||
- name: my-gateway
|
||||
namespace: gateway-system
|
||||
sectionName: https
|
||||
httpRoute.rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.parentRefs[0].name
|
||||
value: my-gateway
|
||||
- equal:
|
||||
path: spec.parentRefs[0].namespace
|
||||
value: gateway-system
|
||||
- equal:
|
||||
path: spec.parentRefs[0].sectionName
|
||||
value: https
|
||||
|
||||
- it: should set hostnames when specified
|
||||
set:
|
||||
httpRoute.enabled: true
|
||||
httpRoute.hostnames:
|
||||
- jellyfin.example.com
|
||||
- media.example.com
|
||||
httpRoute.parentRefs:
|
||||
- name: my-gateway
|
||||
httpRoute.rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.hostnames[0]
|
||||
value: jellyfin.example.com
|
||||
- equal:
|
||||
path: spec.hostnames[1]
|
||||
value: media.example.com
|
||||
|
||||
- it: should create rules with path matches
|
||||
set:
|
||||
httpRoute.enabled: true
|
||||
httpRoute.parentRefs:
|
||||
- name: my-gateway
|
||||
httpRoute.rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /jellyfin
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.rules[0].matches[0].path.type
|
||||
value: PathPrefix
|
||||
- equal:
|
||||
path: spec.rules[0].matches[0].path.value
|
||||
value: /jellyfin
|
||||
|
||||
- it: should set backendRefs to jellyfin service
|
||||
set:
|
||||
httpRoute.enabled: true
|
||||
service.port: 8096
|
||||
httpRoute.parentRefs:
|
||||
- name: my-gateway
|
||||
httpRoute.rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.rules[0].backendRefs[0].name
|
||||
value: RELEASE-NAME-jellyfin
|
||||
- equal:
|
||||
path: spec.rules[0].backendRefs[0].port
|
||||
value: 8096
|
||||
|
||||
- it: should support multiple rules
|
||||
set:
|
||||
httpRoute.enabled: true
|
||||
httpRoute.parentRefs:
|
||||
- name: my-gateway
|
||||
httpRoute.rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
- matches:
|
||||
- path:
|
||||
type: Exact
|
||||
value: /api
|
||||
asserts:
|
||||
- lengthEqual:
|
||||
path: spec.rules
|
||||
count: 2
|
||||
- equal:
|
||||
path: spec.rules[0].matches[0].path.value
|
||||
value: /
|
||||
- equal:
|
||||
path: spec.rules[1].matches[0].path.value
|
||||
value: /api
|
||||
|
||||
- it: should support multiple matches in single rule
|
||||
set:
|
||||
httpRoute.enabled: true
|
||||
httpRoute.parentRefs:
|
||||
- name: my-gateway
|
||||
httpRoute.rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /api
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /web
|
||||
asserts:
|
||||
- lengthEqual:
|
||||
path: spec.rules[0].matches
|
||||
count: 2
|
||||
- equal:
|
||||
path: spec.rules[0].matches[0].path.value
|
||||
value: /api
|
||||
- equal:
|
||||
path: spec.rules[0].matches[1].path.value
|
||||
value: /web
|
||||
|
||||
- it: should use custom service port
|
||||
set:
|
||||
httpRoute.enabled: true
|
||||
service.port: 9000
|
||||
httpRoute.parentRefs:
|
||||
- name: my-gateway
|
||||
httpRoute.rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.rules[0].backendRefs[0].port
|
||||
value: 9000
|
||||
@@ -0,0 +1,119 @@
|
||||
suite: test init containers
|
||||
templates:
|
||||
- deployment.yaml
|
||||
tests:
|
||||
- it: should not have init containers by default
|
||||
asserts:
|
||||
- isNull:
|
||||
path: spec.template.spec.initContainers
|
||||
|
||||
- it: should add extraInitContainers when specified
|
||||
set:
|
||||
extraInitContainers:
|
||||
- name: init-config
|
||||
image: busybox:1.35
|
||||
command: ['sh', '-c', 'echo Initializing']
|
||||
asserts:
|
||||
- isNotNull:
|
||||
path: spec.template.spec.initContainers
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.initContainers
|
||||
count: 1
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].name
|
||||
value: init-config
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].image
|
||||
value: busybox:1.35
|
||||
|
||||
- it: should support multiple extraInitContainers
|
||||
set:
|
||||
extraInitContainers:
|
||||
- name: init-1
|
||||
image: busybox:1.35
|
||||
- name: init-2
|
||||
image: alpine:3.18
|
||||
asserts:
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.initContainers
|
||||
count: 2
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].name
|
||||
value: init-1
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[1].name
|
||||
value: init-2
|
||||
|
||||
- it: should preserve full container spec in extraInitContainers
|
||||
set:
|
||||
extraInitContainers:
|
||||
- name: init-permissions
|
||||
image: busybox:1.35
|
||||
command: ['sh', '-c']
|
||||
args: ['chown -R 1000:1000 /config']
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].command[0]
|
||||
value: sh
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].args[0]
|
||||
value: 'chown -R 1000:1000 /config'
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].volumeMounts[0].name
|
||||
value: config
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].securityContext.runAsUser
|
||||
value: 0
|
||||
|
||||
# Deprecated initContainers (backward compatibility)
|
||||
- it: should still support deprecated initContainers parameter
|
||||
set:
|
||||
initContainers:
|
||||
- name: legacy-init
|
||||
image: busybox:1.35
|
||||
asserts:
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.initContainers
|
||||
count: 1
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].name
|
||||
value: legacy-init
|
||||
|
||||
- it: should merge initContainers and extraInitContainers
|
||||
set:
|
||||
initContainers:
|
||||
- name: legacy-init
|
||||
image: busybox:1.35
|
||||
extraInitContainers:
|
||||
- name: new-init
|
||||
image: alpine:3.18
|
||||
asserts:
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.initContainers
|
||||
count: 2
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].name
|
||||
value: legacy-init
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[1].name
|
||||
value: new-init
|
||||
|
||||
- it: should prioritize extraInitContainers over initContainers
|
||||
set:
|
||||
initContainers:
|
||||
- name: old-way
|
||||
image: busybox:1.35
|
||||
extraInitContainers:
|
||||
- name: new-way
|
||||
image: alpine:3.18
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.initContainers
|
||||
content:
|
||||
name: new-way
|
||||
image: alpine:3.18
|
||||
@@ -0,0 +1,128 @@
|
||||
suite: test service ipv6 and dual-stack
|
||||
templates:
|
||||
- service.yaml
|
||||
tests:
|
||||
- it: should not set ipFamilyPolicy by default
|
||||
asserts:
|
||||
- isNull:
|
||||
path: spec.ipFamilyPolicy
|
||||
|
||||
- it: should not set ipFamilies by default
|
||||
asserts:
|
||||
- isNull:
|
||||
path: spec.ipFamilies
|
||||
|
||||
- it: should set ipFamilyPolicy when specified
|
||||
set:
|
||||
service.ipFamilyPolicy: PreferDualStack
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ipFamilyPolicy
|
||||
value: PreferDualStack
|
||||
|
||||
- it: should support SingleStack policy
|
||||
set:
|
||||
service.ipFamilyPolicy: SingleStack
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ipFamilyPolicy
|
||||
value: SingleStack
|
||||
|
||||
- it: should support RequireDualStack policy
|
||||
set:
|
||||
service.ipFamilyPolicy: RequireDualStack
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ipFamilyPolicy
|
||||
value: RequireDualStack
|
||||
|
||||
- it: should set ipFamilies for IPv4 only
|
||||
set:
|
||||
service.ipFamilies:
|
||||
- IPv4
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ipFamilies[0]
|
||||
value: IPv4
|
||||
|
||||
- it: should set ipFamilies for IPv6 only
|
||||
set:
|
||||
service.ipFamilies:
|
||||
- IPv6
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ipFamilies[0]
|
||||
value: IPv6
|
||||
|
||||
- it: should set ipFamilies for dual-stack IPv4 primary
|
||||
set:
|
||||
service.ipFamilies:
|
||||
- IPv4
|
||||
- IPv6
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ipFamilies[0]
|
||||
value: IPv4
|
||||
- equal:
|
||||
path: spec.ipFamilies[1]
|
||||
value: IPv6
|
||||
|
||||
- it: should set ipFamilies for dual-stack IPv6 primary
|
||||
set:
|
||||
service.ipFamilies:
|
||||
- IPv6
|
||||
- IPv4
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ipFamilies[0]
|
||||
value: IPv6
|
||||
- equal:
|
||||
path: spec.ipFamilies[1]
|
||||
value: IPv4
|
||||
|
||||
- it: should work with PreferDualStack and both families
|
||||
set:
|
||||
service.ipFamilyPolicy: PreferDualStack
|
||||
service.ipFamilies:
|
||||
- IPv4
|
||||
- IPv6
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ipFamilyPolicy
|
||||
value: PreferDualStack
|
||||
- equal:
|
||||
path: spec.ipFamilies[0]
|
||||
value: IPv4
|
||||
- equal:
|
||||
path: spec.ipFamilies[1]
|
||||
value: IPv6
|
||||
|
||||
- it: should work with RequireDualStack and both families
|
||||
set:
|
||||
service.ipFamilyPolicy: RequireDualStack
|
||||
service.ipFamilies:
|
||||
- IPv6
|
||||
- IPv4
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ipFamilyPolicy
|
||||
value: RequireDualStack
|
||||
- equal:
|
||||
path: spec.ipFamilies[0]
|
||||
value: IPv6
|
||||
- equal:
|
||||
path: spec.ipFamilies[1]
|
||||
value: IPv4
|
||||
|
||||
- it: should work with SingleStack IPv6 only
|
||||
set:
|
||||
service.ipFamilyPolicy: SingleStack
|
||||
service.ipFamilies:
|
||||
- IPv6
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.ipFamilyPolicy
|
||||
value: SingleStack
|
||||
- equal:
|
||||
path: spec.ipFamilies[0]
|
||||
value: IPv6
|
||||
@@ -0,0 +1,92 @@
|
||||
suite: test startup probe
|
||||
templates:
|
||||
- deployment.yaml
|
||||
tests:
|
||||
- it: should have startup probe by default
|
||||
asserts:
|
||||
- isNotNull:
|
||||
path: spec.template.spec.containers[0].startupProbe
|
||||
|
||||
- it: should use tcpSocket by default
|
||||
asserts:
|
||||
- isNotNull:
|
||||
path: spec.template.spec.containers[0].startupProbe.tcpSocket
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.tcpSocket.port
|
||||
value: http
|
||||
|
||||
- it: should have default timing values
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.initialDelaySeconds
|
||||
value: 0
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.periodSeconds
|
||||
value: 10
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.failureThreshold
|
||||
value: 30
|
||||
|
||||
- it: should allow custom initialDelaySeconds
|
||||
set:
|
||||
startupProbe.initialDelaySeconds: 5
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.initialDelaySeconds
|
||||
value: 5
|
||||
|
||||
- it: should allow custom periodSeconds
|
||||
set:
|
||||
startupProbe.periodSeconds: 15
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.periodSeconds
|
||||
value: 15
|
||||
|
||||
- it: should allow custom failureThreshold
|
||||
set:
|
||||
startupProbe.failureThreshold: 60
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.failureThreshold
|
||||
value: 60
|
||||
|
||||
- it: should support httpGet probe
|
||||
set:
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: http
|
||||
initialDelaySeconds: 0
|
||||
periodSeconds: 10
|
||||
failureThreshold: 30
|
||||
asserts:
|
||||
- isNotNull:
|
||||
path: spec.template.spec.containers[0].startupProbe.httpGet
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.httpGet.path
|
||||
value: /health
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.httpGet.port
|
||||
value: http
|
||||
|
||||
- it: should support custom port
|
||||
set:
|
||||
startupProbe.tcpSocket.port: 9000
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.tcpSocket.port
|
||||
value: 9000
|
||||
|
||||
- it: should calculate correct timeout window
|
||||
set:
|
||||
startupProbe.periodSeconds: 10
|
||||
startupProbe.failureThreshold: 30
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.periodSeconds
|
||||
value: 10
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.failureThreshold
|
||||
value: 30
|
||||
# Total startup time allowed: 10 * 30 = 300 seconds (5 minutes)
|
||||
Reference in new issue
Block a user