diff --git a/charts/radix-operator/templates/radixapplication.yaml b/charts/radix-operator/templates/radixapplication.yaml index 66424cebd..864bcc422 100644 --- a/charts/radix-operator/templates/radixapplication.yaml +++ b/charts/radix-operator/templates/radixapplication.yaml @@ -449,10 +449,12 @@ spec: x-kubernetes-list-type: atomic type: object failureThreshold: - description: |- - Minimum consecutive failures for the probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. + default: 3 + description: Minimum consecutive failures for + the probe to be considered failed after having + succeeded. format: int32 + minimum: 1 type: integer grpc: description: GRPC specifies an action involving @@ -460,8 +462,9 @@ spec: properties: port: description: Port number of the gRPC service. - Number must be in the range 1 to 65535. format: int32 + maximum: 65535 + minimum: 1 type: integer service: default: "" @@ -508,18 +511,19 @@ spec: description: Path to access on the HTTP server. type: string port: - anyOf: - - type: integer - - type: string - description: |- - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the + container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer scheme: description: |- Scheme to use for connecting to the host. Defaults to HTTP. + enum: + - HTTPS + - HTTP type: string required: - port @@ -531,16 +535,19 @@ spec: format: int32 type: integer periodSeconds: - description: |- - How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + default: 10 + description: How often (in seconds) to perform + the probe. format: int32 + minimum: 1 type: integer successThreshold: + default: 1 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. + Must be 1 for liveness and startup. format: int32 + minimum: 1 type: integer tcpSocket: description: TCPSocket specifies an action involving @@ -551,37 +558,22 @@ spec: to, defaults to the pod IP.' type: string port: - anyOf: - - type: integer - - type: string - description: |- - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the + container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - port type: object - terminationGracePeriodSeconds: - description: |- - Optional duration in seconds the pod needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after the processes running in the pod are sent - a termination signal and the time when the processes are forcibly halted with a kill signal. - Set this value longer than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates stop immediately via - the kill signal (no opportunity to shut down). - This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer timeoutSeconds: + default: 1 description: |- Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes format: int32 + minimum: 1 type: integer type: object readinessProbe: @@ -607,10 +599,12 @@ spec: x-kubernetes-list-type: atomic type: object failureThreshold: - description: |- - Minimum consecutive failures for the probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. + default: 3 + description: Minimum consecutive failures for + the probe to be considered failed after having + succeeded. format: int32 + minimum: 1 type: integer grpc: description: GRPC specifies an action involving @@ -618,8 +612,9 @@ spec: properties: port: description: Port number of the gRPC service. - Number must be in the range 1 to 65535. format: int32 + maximum: 65535 + minimum: 1 type: integer service: default: "" @@ -666,18 +661,19 @@ spec: description: Path to access on the HTTP server. type: string port: - anyOf: - - type: integer - - type: string - description: |- - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the + container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer scheme: description: |- Scheme to use for connecting to the host. Defaults to HTTP. + enum: + - HTTPS + - HTTP type: string required: - port @@ -689,16 +685,19 @@ spec: format: int32 type: integer periodSeconds: - description: |- - How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + default: 10 + description: How often (in seconds) to perform + the probe. format: int32 + minimum: 1 type: integer successThreshold: + default: 1 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. + Must be 1 for liveness and startup. format: int32 + minimum: 1 type: integer tcpSocket: description: TCPSocket specifies an action involving @@ -709,37 +708,22 @@ spec: to, defaults to the pod IP.' type: string port: - anyOf: - - type: integer - - type: string - description: |- - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the + container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - port type: object - terminationGracePeriodSeconds: - description: |- - Optional duration in seconds the pod needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after the processes running in the pod are sent - a termination signal and the time when the processes are forcibly halted with a kill signal. - Set this value longer than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates stop immediately via - the kill signal (no opportunity to shut down). - This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer timeoutSeconds: + default: 1 description: |- Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes format: int32 + minimum: 1 type: integer type: object startupProbe: @@ -767,10 +751,12 @@ spec: x-kubernetes-list-type: atomic type: object failureThreshold: - description: |- - Minimum consecutive failures for the probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. + default: 3 + description: Minimum consecutive failures for + the probe to be considered failed after having + succeeded. format: int32 + minimum: 1 type: integer grpc: description: GRPC specifies an action involving @@ -778,8 +764,9 @@ spec: properties: port: description: Port number of the gRPC service. - Number must be in the range 1 to 65535. format: int32 + maximum: 65535 + minimum: 1 type: integer service: default: "" @@ -826,18 +813,19 @@ spec: description: Path to access on the HTTP server. type: string port: - anyOf: - - type: integer - - type: string - description: |- - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the + container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer scheme: description: |- Scheme to use for connecting to the host. Defaults to HTTP. + enum: + - HTTPS + - HTTP type: string required: - port @@ -849,16 +837,19 @@ spec: format: int32 type: integer periodSeconds: - description: |- - How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + default: 10 + description: How often (in seconds) to perform + the probe. format: int32 + minimum: 1 type: integer successThreshold: + default: 1 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. + Must be 1 for liveness and startup. format: int32 + minimum: 1 type: integer tcpSocket: description: TCPSocket specifies an action involving @@ -869,37 +860,22 @@ spec: to, defaults to the pod IP.' type: string port: - anyOf: - - type: integer - - type: string - description: |- - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the + container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - port type: object - terminationGracePeriodSeconds: - description: |- - Optional duration in seconds the pod needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after the processes running in the pod are sent - a termination signal and the time when the processes are forcibly halted with a kill signal. - Set this value longer than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates stop immediately via - the kill signal (no opportunity to shut down). - This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer timeoutSeconds: + default: 1 description: |- Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes format: int32 + minimum: 1 type: integer type: object type: object @@ -1676,19 +1652,21 @@ spec: x-kubernetes-list-type: atomic type: object failureThreshold: - description: |- - Minimum consecutive failures for the probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. + default: 3 + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. format: int32 + minimum: 1 type: integer grpc: description: GRPC specifies an action involving a GRPC port. properties: port: - description: Port number of the gRPC service. Number - must be in the range 1 to 65535. + description: Port number of the gRPC service. format: int32 + maximum: 65535 + minimum: 1 type: integer service: default: "" @@ -1734,18 +1712,18 @@ spec: description: Path to access on the HTTP server. type: string port: - anyOf: - - type: integer - - type: string - description: |- - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer scheme: description: |- Scheme to use for connecting to the host. Defaults to HTTP. + enum: + - HTTPS + - HTTP type: string required: - port @@ -1757,16 +1735,18 @@ spec: format: int32 type: integer periodSeconds: - description: |- - How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + default: 10 + description: How often (in seconds) to perform the probe. format: int32 + minimum: 1 type: integer successThreshold: + default: 1 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. + Must be 1 for liveness and startup. format: int32 + minimum: 1 type: integer tcpSocket: description: TCPSocket specifies an action involving @@ -1777,37 +1757,21 @@ spec: defaults to the pod IP.' type: string port: - anyOf: - - type: integer - - type: string - description: |- - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - port type: object - terminationGracePeriodSeconds: - description: |- - Optional duration in seconds the pod needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after the processes running in the pod are sent - a termination signal and the time when the processes are forcibly halted with a kill signal. - Set this value longer than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates stop immediately via - the kill signal (no opportunity to shut down). - This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer timeoutSeconds: + default: 1 description: |- Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes format: int32 + minimum: 1 type: integer type: object readinessProbe: @@ -1833,19 +1797,21 @@ spec: x-kubernetes-list-type: atomic type: object failureThreshold: - description: |- - Minimum consecutive failures for the probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. + default: 3 + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. format: int32 + minimum: 1 type: integer grpc: description: GRPC specifies an action involving a GRPC port. properties: port: - description: Port number of the gRPC service. Number - must be in the range 1 to 65535. + description: Port number of the gRPC service. format: int32 + maximum: 65535 + minimum: 1 type: integer service: default: "" @@ -1891,18 +1857,18 @@ spec: description: Path to access on the HTTP server. type: string port: - anyOf: - - type: integer - - type: string - description: |- - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer scheme: description: |- Scheme to use for connecting to the host. Defaults to HTTP. + enum: + - HTTPS + - HTTP type: string required: - port @@ -1914,16 +1880,18 @@ spec: format: int32 type: integer periodSeconds: - description: |- - How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + default: 10 + description: How often (in seconds) to perform the probe. format: int32 + minimum: 1 type: integer successThreshold: + default: 1 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. + Must be 1 for liveness and startup. format: int32 + minimum: 1 type: integer tcpSocket: description: TCPSocket specifies an action involving @@ -1934,37 +1902,21 @@ spec: defaults to the pod IP.' type: string port: - anyOf: - - type: integer - - type: string - description: |- - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - port type: object - terminationGracePeriodSeconds: - description: |- - Optional duration in seconds the pod needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after the processes running in the pod are sent - a termination signal and the time when the processes are forcibly halted with a kill signal. - Set this value longer than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates stop immediately via - the kill signal (no opportunity to shut down). - This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer timeoutSeconds: + default: 1 description: |- Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes format: int32 + minimum: 1 type: integer type: object startupProbe: @@ -1992,19 +1944,21 @@ spec: x-kubernetes-list-type: atomic type: object failureThreshold: - description: |- - Minimum consecutive failures for the probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. + default: 3 + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. format: int32 + minimum: 1 type: integer grpc: description: GRPC specifies an action involving a GRPC port. properties: port: - description: Port number of the gRPC service. Number - must be in the range 1 to 65535. + description: Port number of the gRPC service. format: int32 + maximum: 65535 + minimum: 1 type: integer service: default: "" @@ -2050,18 +2004,18 @@ spec: description: Path to access on the HTTP server. type: string port: - anyOf: - - type: integer - - type: string - description: |- - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer scheme: description: |- Scheme to use for connecting to the host. Defaults to HTTP. + enum: + - HTTPS + - HTTP type: string required: - port @@ -2073,16 +2027,18 @@ spec: format: int32 type: integer periodSeconds: - description: |- - How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + default: 10 + description: How often (in seconds) to perform the probe. format: int32 + minimum: 1 type: integer successThreshold: + default: 1 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. + Must be 1 for liveness and startup. format: int32 + minimum: 1 type: integer tcpSocket: description: TCPSocket specifies an action involving @@ -2093,37 +2049,21 @@ spec: defaults to the pod IP.' type: string port: - anyOf: - - type: integer - - type: string - description: |- - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - port type: object - terminationGracePeriodSeconds: - description: |- - Optional duration in seconds the pod needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after the processes running in the pod are sent - a termination signal and the time when the processes are forcibly halted with a kill signal. - Set this value longer than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates stop immediately via - the kill signal (no opportunity to shut down). - This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer timeoutSeconds: + default: 1 description: |- Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes format: int32 + minimum: 1 type: integer type: object type: object diff --git a/charts/radix-operator/templates/radixdeployment.yaml b/charts/radix-operator/templates/radixdeployment.yaml index 8824468c8..d262bffd2 100644 --- a/charts/radix-operator/templates/radixdeployment.yaml +++ b/charts/radix-operator/templates/radixdeployment.yaml @@ -265,19 +265,21 @@ spec: x-kubernetes-list-type: atomic type: object failureThreshold: - description: |- - Minimum consecutive failures for the probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. + default: 3 + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. format: int32 + minimum: 1 type: integer grpc: description: GRPC specifies an action involving a GRPC port. properties: port: - description: Port number of the gRPC service. Number - must be in the range 1 to 65535. + description: Port number of the gRPC service. format: int32 + maximum: 65535 + minimum: 1 type: integer service: default: "" @@ -323,18 +325,18 @@ spec: description: Path to access on the HTTP server. type: string port: - anyOf: - - type: integer - - type: string - description: |- - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer scheme: description: |- Scheme to use for connecting to the host. Defaults to HTTP. + enum: + - HTTPS + - HTTP type: string required: - port @@ -346,16 +348,18 @@ spec: format: int32 type: integer periodSeconds: - description: |- - How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + default: 10 + description: How often (in seconds) to perform the probe. format: int32 + minimum: 1 type: integer successThreshold: + default: 1 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. + Must be 1 for liveness and startup. format: int32 + minimum: 1 type: integer tcpSocket: description: TCPSocket specifies an action involving @@ -366,37 +370,21 @@ spec: defaults to the pod IP.' type: string port: - anyOf: - - type: integer - - type: string - description: |- - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - port type: object - terminationGracePeriodSeconds: - description: |- - Optional duration in seconds the pod needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after the processes running in the pod are sent - a termination signal and the time when the processes are forcibly halted with a kill signal. - Set this value longer than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates stop immediately via - the kill signal (no opportunity to shut down). - This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer timeoutSeconds: + default: 1 description: |- Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes format: int32 + minimum: 1 type: integer type: object readinessProbe: @@ -422,19 +410,21 @@ spec: x-kubernetes-list-type: atomic type: object failureThreshold: - description: |- - Minimum consecutive failures for the probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. + default: 3 + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. format: int32 + minimum: 1 type: integer grpc: description: GRPC specifies an action involving a GRPC port. properties: port: - description: Port number of the gRPC service. Number - must be in the range 1 to 65535. + description: Port number of the gRPC service. format: int32 + maximum: 65535 + minimum: 1 type: integer service: default: "" @@ -480,18 +470,18 @@ spec: description: Path to access on the HTTP server. type: string port: - anyOf: - - type: integer - - type: string - description: |- - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer scheme: description: |- Scheme to use for connecting to the host. Defaults to HTTP. + enum: + - HTTPS + - HTTP type: string required: - port @@ -503,16 +493,18 @@ spec: format: int32 type: integer periodSeconds: - description: |- - How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + default: 10 + description: How often (in seconds) to perform the probe. format: int32 + minimum: 1 type: integer successThreshold: + default: 1 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. + Must be 1 for liveness and startup. format: int32 + minimum: 1 type: integer tcpSocket: description: TCPSocket specifies an action involving @@ -523,37 +515,21 @@ spec: defaults to the pod IP.' type: string port: - anyOf: - - type: integer - - type: string - description: |- - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - port type: object - terminationGracePeriodSeconds: - description: |- - Optional duration in seconds the pod needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after the processes running in the pod are sent - a termination signal and the time when the processes are forcibly halted with a kill signal. - Set this value longer than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates stop immediately via - the kill signal (no opportunity to shut down). - This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer timeoutSeconds: + default: 1 description: |- Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes format: int32 + minimum: 1 type: integer type: object startupProbe: @@ -581,19 +557,21 @@ spec: x-kubernetes-list-type: atomic type: object failureThreshold: - description: |- - Minimum consecutive failures for the probe to be considered failed after having succeeded. - Defaults to 3. Minimum value is 1. + default: 3 + description: Minimum consecutive failures for the probe + to be considered failed after having succeeded. format: int32 + minimum: 1 type: integer grpc: description: GRPC specifies an action involving a GRPC port. properties: port: - description: Port number of the gRPC service. Number - must be in the range 1 to 65535. + description: Port number of the gRPC service. format: int32 + maximum: 65535 + minimum: 1 type: integer service: default: "" @@ -639,18 +617,18 @@ spec: description: Path to access on the HTTP server. type: string port: - anyOf: - - type: integer - - type: string - description: |- - Name or number of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer scheme: description: |- Scheme to use for connecting to the host. Defaults to HTTP. + enum: + - HTTPS + - HTTP type: string required: - port @@ -662,16 +640,18 @@ spec: format: int32 type: integer periodSeconds: - description: |- - How often (in seconds) to perform the probe. - Default to 10 seconds. Minimum value is 1. + default: 10 + description: How often (in seconds) to perform the probe. format: int32 + minimum: 1 type: integer successThreshold: + default: 1 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. + Must be 1 for liveness and startup. format: int32 + minimum: 1 type: integer tcpSocket: description: TCPSocket specifies an action involving @@ -682,37 +662,21 @@ spec: defaults to the pod IP.' type: string port: - anyOf: - - type: integer - - type: string - description: |- - Number or name of the port to access on the container. - Number must be in the range 1 to 65535. - Name must be an IANA_SVC_NAME. - x-kubernetes-int-or-string: true + description: port number to access on the container. + format: int32 + maximum: 65535 + minimum: 1 + type: integer required: - port type: object - terminationGracePeriodSeconds: - description: |- - Optional duration in seconds the pod needs to terminate gracefully upon probe failure. - The grace period is the duration in seconds after the processes running in the pod are sent - a termination signal and the time when the processes are forcibly halted with a kill signal. - Set this value longer than the expected cleanup time for your process. - If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this - value overrides the value provided by the pod spec. - Value must be non-negative integer. The value zero indicates stop immediately via - the kill signal (no opportunity to shut down). - This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. - Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. - format: int64 - type: integer timeoutSeconds: + default: 1 description: |- Number of seconds after which the probe times out. - Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes format: int32 + minimum: 1 type: integer type: object type: object diff --git a/json-schema/radixapplication.json b/json-schema/radixapplication.json index fc8e5cc80..c709df81c 100644 --- a/json-schema/radixapplication.json +++ b/json-schema/radixapplication.json @@ -421,16 +421,20 @@ "type": "object" }, "failureThreshold": { - "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.\nDefaults to 3. Minimum value is 1.", + "default": 3, + "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.", "format": "int32", + "minimum": 1, "type": "integer" }, "grpc": { "description": "GRPC specifies an action involving a GRPC port.", "properties": { "port": { - "description": "Port number of the gRPC service. Number must be in the range 1 to 65535.", + "description": "Port number of the gRPC service.", "format": "int32", + "maximum": 65535, + "minimum": 1, "type": "integer" }, "service": { @@ -479,19 +483,18 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Name or number of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" }, "scheme": { "description": "Scheme to use for connecting to the host.\nDefaults to HTTP.", + "enum": [ + "HTTPS", + "HTTP" + ], "type": "string" } }, @@ -506,13 +509,17 @@ "type": "integer" }, "periodSeconds": { - "description": "How often (in seconds) to perform the probe.\nDefault to 10 seconds. Minimum value is 1.", + "default": 10, + "description": "How often (in seconds) to perform the probe.", "format": "int32", + "minimum": 1, "type": "integer" }, "successThreshold": { - "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nDefaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", + "default": 1, + "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nMust be 1 for liveness and startup.", "format": "int32", + "minimum": 1, "type": "integer" }, "tcpSocket": { @@ -523,16 +530,11 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Number or name of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" } }, "required": [ @@ -540,14 +542,11 @@ ], "type": "object" }, - "terminationGracePeriodSeconds": { - "description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure.\nThe grace period is the duration in seconds after the processes running in the pod are sent\na termination signal and the time when the processes are forcibly halted with a kill signal.\nSet this value longer than the expected cleanup time for your process.\nIf this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this\nvalue overrides the value provided by the pod spec.\nValue must be non-negative integer. The value zero indicates stop immediately via\nthe kill signal (no opportunity to shut down).\nThis is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.\nMinimum value is 1. spec.terminationGracePeriodSeconds is used if unset.", - "format": "int64", - "type": "integer" - }, "timeoutSeconds": { - "description": "Number of seconds after which the probe times out.\nDefaults to 1 second. Minimum value is 1.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + "default": 1, + "description": "Number of seconds after which the probe times out.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", + "minimum": 1, "type": "integer" } }, @@ -571,16 +570,20 @@ "type": "object" }, "failureThreshold": { - "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.\nDefaults to 3. Minimum value is 1.", + "default": 3, + "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.", "format": "int32", + "minimum": 1, "type": "integer" }, "grpc": { "description": "GRPC specifies an action involving a GRPC port.", "properties": { "port": { - "description": "Port number of the gRPC service. Number must be in the range 1 to 65535.", + "description": "Port number of the gRPC service.", "format": "int32", + "maximum": 65535, + "minimum": 1, "type": "integer" }, "service": { @@ -629,19 +632,18 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Name or number of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" }, "scheme": { "description": "Scheme to use for connecting to the host.\nDefaults to HTTP.", + "enum": [ + "HTTPS", + "HTTP" + ], "type": "string" } }, @@ -656,13 +658,17 @@ "type": "integer" }, "periodSeconds": { - "description": "How often (in seconds) to perform the probe.\nDefault to 10 seconds. Minimum value is 1.", + "default": 10, + "description": "How often (in seconds) to perform the probe.", "format": "int32", + "minimum": 1, "type": "integer" }, "successThreshold": { - "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nDefaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", + "default": 1, + "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nMust be 1 for liveness and startup.", "format": "int32", + "minimum": 1, "type": "integer" }, "tcpSocket": { @@ -673,16 +679,11 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Number or name of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" } }, "required": [ @@ -690,14 +691,11 @@ ], "type": "object" }, - "terminationGracePeriodSeconds": { - "description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure.\nThe grace period is the duration in seconds after the processes running in the pod are sent\na termination signal and the time when the processes are forcibly halted with a kill signal.\nSet this value longer than the expected cleanup time for your process.\nIf this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this\nvalue overrides the value provided by the pod spec.\nValue must be non-negative integer. The value zero indicates stop immediately via\nthe kill signal (no opportunity to shut down).\nThis is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.\nMinimum value is 1. spec.terminationGracePeriodSeconds is used if unset.", - "format": "int64", - "type": "integer" - }, "timeoutSeconds": { - "description": "Number of seconds after which the probe times out.\nDefaults to 1 second. Minimum value is 1.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + "default": 1, + "description": "Number of seconds after which the probe times out.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", + "minimum": 1, "type": "integer" } }, @@ -721,16 +719,20 @@ "type": "object" }, "failureThreshold": { - "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.\nDefaults to 3. Minimum value is 1.", + "default": 3, + "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.", "format": "int32", + "minimum": 1, "type": "integer" }, "grpc": { "description": "GRPC specifies an action involving a GRPC port.", "properties": { "port": { - "description": "Port number of the gRPC service. Number must be in the range 1 to 65535.", + "description": "Port number of the gRPC service.", "format": "int32", + "maximum": 65535, + "minimum": 1, "type": "integer" }, "service": { @@ -779,19 +781,18 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Name or number of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" }, "scheme": { "description": "Scheme to use for connecting to the host.\nDefaults to HTTP.", + "enum": [ + "HTTPS", + "HTTP" + ], "type": "string" } }, @@ -806,13 +807,17 @@ "type": "integer" }, "periodSeconds": { - "description": "How often (in seconds) to perform the probe.\nDefault to 10 seconds. Minimum value is 1.", + "default": 10, + "description": "How often (in seconds) to perform the probe.", "format": "int32", + "minimum": 1, "type": "integer" }, "successThreshold": { - "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nDefaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", + "default": 1, + "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nMust be 1 for liveness and startup.", "format": "int32", + "minimum": 1, "type": "integer" }, "tcpSocket": { @@ -823,16 +828,11 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Number or name of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" } }, "required": [ @@ -840,14 +840,11 @@ ], "type": "object" }, - "terminationGracePeriodSeconds": { - "description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure.\nThe grace period is the duration in seconds after the processes running in the pod are sent\na termination signal and the time when the processes are forcibly halted with a kill signal.\nSet this value longer than the expected cleanup time for your process.\nIf this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this\nvalue overrides the value provided by the pod spec.\nValue must be non-negative integer. The value zero indicates stop immediately via\nthe kill signal (no opportunity to shut down).\nThis is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.\nMinimum value is 1. spec.terminationGracePeriodSeconds is used if unset.", - "format": "int64", - "type": "integer" - }, "timeoutSeconds": { - "description": "Number of seconds after which the probe times out.\nDefaults to 1 second. Minimum value is 1.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + "default": 1, + "description": "Number of seconds after which the probe times out.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", + "minimum": 1, "type": "integer" } }, @@ -1618,16 +1615,20 @@ "type": "object" }, "failureThreshold": { - "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.\nDefaults to 3. Minimum value is 1.", + "default": 3, + "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.", "format": "int32", + "minimum": 1, "type": "integer" }, "grpc": { "description": "GRPC specifies an action involving a GRPC port.", "properties": { "port": { - "description": "Port number of the gRPC service. Number must be in the range 1 to 65535.", + "description": "Port number of the gRPC service.", "format": "int32", + "maximum": 65535, + "minimum": 1, "type": "integer" }, "service": { @@ -1676,19 +1677,18 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Name or number of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" }, "scheme": { "description": "Scheme to use for connecting to the host.\nDefaults to HTTP.", + "enum": [ + "HTTPS", + "HTTP" + ], "type": "string" } }, @@ -1703,13 +1703,17 @@ "type": "integer" }, "periodSeconds": { - "description": "How often (in seconds) to perform the probe.\nDefault to 10 seconds. Minimum value is 1.", + "default": 10, + "description": "How often (in seconds) to perform the probe.", "format": "int32", + "minimum": 1, "type": "integer" }, "successThreshold": { - "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nDefaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", + "default": 1, + "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nMust be 1 for liveness and startup.", "format": "int32", + "minimum": 1, "type": "integer" }, "tcpSocket": { @@ -1720,16 +1724,11 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Number or name of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" } }, "required": [ @@ -1737,14 +1736,11 @@ ], "type": "object" }, - "terminationGracePeriodSeconds": { - "description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure.\nThe grace period is the duration in seconds after the processes running in the pod are sent\na termination signal and the time when the processes are forcibly halted with a kill signal.\nSet this value longer than the expected cleanup time for your process.\nIf this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this\nvalue overrides the value provided by the pod spec.\nValue must be non-negative integer. The value zero indicates stop immediately via\nthe kill signal (no opportunity to shut down).\nThis is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.\nMinimum value is 1. spec.terminationGracePeriodSeconds is used if unset.", - "format": "int64", - "type": "integer" - }, "timeoutSeconds": { - "description": "Number of seconds after which the probe times out.\nDefaults to 1 second. Minimum value is 1.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + "default": 1, + "description": "Number of seconds after which the probe times out.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", + "minimum": 1, "type": "integer" } }, @@ -1768,16 +1764,20 @@ "type": "object" }, "failureThreshold": { - "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.\nDefaults to 3. Minimum value is 1.", + "default": 3, + "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.", "format": "int32", + "minimum": 1, "type": "integer" }, "grpc": { "description": "GRPC specifies an action involving a GRPC port.", "properties": { "port": { - "description": "Port number of the gRPC service. Number must be in the range 1 to 65535.", + "description": "Port number of the gRPC service.", "format": "int32", + "maximum": 65535, + "minimum": 1, "type": "integer" }, "service": { @@ -1826,19 +1826,18 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Name or number of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" }, "scheme": { "description": "Scheme to use for connecting to the host.\nDefaults to HTTP.", + "enum": [ + "HTTPS", + "HTTP" + ], "type": "string" } }, @@ -1853,13 +1852,17 @@ "type": "integer" }, "periodSeconds": { - "description": "How often (in seconds) to perform the probe.\nDefault to 10 seconds. Minimum value is 1.", + "default": 10, + "description": "How often (in seconds) to perform the probe.", "format": "int32", + "minimum": 1, "type": "integer" }, "successThreshold": { - "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nDefaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", + "default": 1, + "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nMust be 1 for liveness and startup.", "format": "int32", + "minimum": 1, "type": "integer" }, "tcpSocket": { @@ -1870,16 +1873,11 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Number or name of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" } }, "required": [ @@ -1887,14 +1885,11 @@ ], "type": "object" }, - "terminationGracePeriodSeconds": { - "description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure.\nThe grace period is the duration in seconds after the processes running in the pod are sent\na termination signal and the time when the processes are forcibly halted with a kill signal.\nSet this value longer than the expected cleanup time for your process.\nIf this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this\nvalue overrides the value provided by the pod spec.\nValue must be non-negative integer. The value zero indicates stop immediately via\nthe kill signal (no opportunity to shut down).\nThis is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.\nMinimum value is 1. spec.terminationGracePeriodSeconds is used if unset.", - "format": "int64", - "type": "integer" - }, "timeoutSeconds": { - "description": "Number of seconds after which the probe times out.\nDefaults to 1 second. Minimum value is 1.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + "default": 1, + "description": "Number of seconds after which the probe times out.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", + "minimum": 1, "type": "integer" } }, @@ -1918,16 +1913,20 @@ "type": "object" }, "failureThreshold": { - "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.\nDefaults to 3. Minimum value is 1.", + "default": 3, + "description": "Minimum consecutive failures for the probe to be considered failed after having succeeded.", "format": "int32", + "minimum": 1, "type": "integer" }, "grpc": { "description": "GRPC specifies an action involving a GRPC port.", "properties": { "port": { - "description": "Port number of the gRPC service. Number must be in the range 1 to 65535.", + "description": "Port number of the gRPC service.", "format": "int32", + "maximum": 65535, + "minimum": 1, "type": "integer" }, "service": { @@ -1976,19 +1975,18 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Name or number of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" }, "scheme": { "description": "Scheme to use for connecting to the host.\nDefaults to HTTP.", + "enum": [ + "HTTPS", + "HTTP" + ], "type": "string" } }, @@ -2003,13 +2001,17 @@ "type": "integer" }, "periodSeconds": { - "description": "How often (in seconds) to perform the probe.\nDefault to 10 seconds. Minimum value is 1.", + "default": 10, + "description": "How often (in seconds) to perform the probe.", "format": "int32", + "minimum": 1, "type": "integer" }, "successThreshold": { - "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nDefaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", + "default": 1, + "description": "Minimum consecutive successes for the probe to be considered successful after having failed.\nMust be 1 for liveness and startup.", "format": "int32", + "minimum": 1, "type": "integer" }, "tcpSocket": { @@ -2020,16 +2022,11 @@ "type": "string" }, "port": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ], - "description": "Number or name of the port to access on the container.\nNumber must be in the range 1 to 65535.\nName must be an IANA_SVC_NAME.", - "x-kubernetes-int-or-string": true + "description": "port number to access on the container.", + "format": "int32", + "maximum": 65535, + "minimum": 1, + "type": "integer" } }, "required": [ @@ -2037,14 +2034,11 @@ ], "type": "object" }, - "terminationGracePeriodSeconds": { - "description": "Optional duration in seconds the pod needs to terminate gracefully upon probe failure.\nThe grace period is the duration in seconds after the processes running in the pod are sent\na termination signal and the time when the processes are forcibly halted with a kill signal.\nSet this value longer than the expected cleanup time for your process.\nIf this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this\nvalue overrides the value provided by the pod spec.\nValue must be non-negative integer. The value zero indicates stop immediately via\nthe kill signal (no opportunity to shut down).\nThis is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.\nMinimum value is 1. spec.terminationGracePeriodSeconds is used if unset.", - "format": "int64", - "type": "integer" - }, "timeoutSeconds": { - "description": "Number of seconds after which the probe times out.\nDefaults to 1 second. Minimum value is 1.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + "default": 1, + "description": "Number of seconds after which the probe times out.\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", "format": "int32", + "minimum": 1, "type": "integer" } }, diff --git a/pkg/apis/deployment/kubedeployment.go b/pkg/apis/deployment/kubedeployment.go index cefd6420c..df5cb5df4 100644 --- a/pkg/apis/deployment/kubedeployment.go +++ b/pkg/apis/deployment/kubedeployment.go @@ -316,9 +316,9 @@ func (deploy *Deployment) setDesiredDeploymentProperties(ctx context.Context, de desiredDeployment.Spec.Template.Spec.Containers[0].VolumeMounts = volumeMounts if hc := deployComponent.GetHealthChecks(); hc != nil { - desiredDeployment.Spec.Template.Spec.Containers[0].ReadinessProbe = hc.ReadinessProbe - desiredDeployment.Spec.Template.Spec.Containers[0].LivenessProbe = hc.LivenessProbe - desiredDeployment.Spec.Template.Spec.Containers[0].StartupProbe = hc.StartupProbe + desiredDeployment.Spec.Template.Spec.Containers[0].ReadinessProbe = hc.ReadinessProbe.MapToCoreProbe() + desiredDeployment.Spec.Template.Spec.Containers[0].LivenessProbe = hc.LivenessProbe.MapToCoreProbe() + desiredDeployment.Spec.Template.Spec.Containers[0].StartupProbe = hc.StartupProbe.MapToCoreProbe() } else { readinessProbe, err := getDefaultReadinessProbeForComponent(deployComponent) if err != nil { diff --git a/pkg/apis/deployment/kubedeployment_test.go b/pkg/apis/deployment/kubedeployment_test.go index 842bd474b..3847a4f3b 100644 --- a/pkg/apis/deployment/kubedeployment_test.go +++ b/pkg/apis/deployment/kubedeployment_test.go @@ -12,9 +12,7 @@ import ( "github.com/equinor/radix-operator/pkg/apis/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" ) func teardownReadinessProbe() { @@ -56,26 +54,26 @@ func TestComponentWithoutCustomHealthChecks(t *testing.T) { } func TestComponentWithCustomHealthChecks(t *testing.T) { tu, client, kubeUtil, radixclient, kedaClient, prometheusclient, _, certClient := SetupTest(t) - createProbe := func(handler corev1.ProbeHandler, seconds int32) *corev1.Probe { - return &corev1.Probe{ - ProbeHandler: handler, - InitialDelaySeconds: seconds, - TimeoutSeconds: seconds + 1, - PeriodSeconds: seconds + 2, - SuccessThreshold: seconds + 3, - FailureThreshold: seconds + 4, - TerminationGracePeriodSeconds: pointers.Ptr(int64(seconds + 5)), + createProbe := func(handler v1.RadixProbeHandler, seconds int32) *v1.RadixProbe { + return &v1.RadixProbe{ + RadixProbeHandler: handler, + InitialDelaySeconds: pointers.Ptr(seconds), + TimeoutSeconds: pointers.Ptr(seconds + 1), + PeriodSeconds: pointers.Ptr(seconds + 2), + SuccessThreshold: pointers.Ptr(seconds + 3), + FailureThreshold: pointers.Ptr(seconds + 4), + // TerminationGracePeriodSeconds: pointers.Ptr(int64(seconds + 5)), } } - readynessProbe := createProbe(corev1.ProbeHandler{HTTPGet: &corev1.HTTPGetAction{ - Port: intstr.IntOrString{IntVal: 5000}, + readynessProbe := createProbe(v1.RadixProbeHandler{HTTPGet: &v1.RadixProbeHTTPGetAction{ + Port: pointers.Ptr[int32](5000), }}, 10) - livenessProbe := createProbe(corev1.ProbeHandler{TCPSocket: &corev1.TCPSocketAction{ - Port: intstr.IntOrString{IntVal: 5000}, + livenessProbe := createProbe(v1.RadixProbeHandler{TCPSocket: &v1.RadixProbeTCPSocketAction{ + Port: pointers.Ptr[int32](5000), }}, 20) - startuProbe := createProbe(corev1.ProbeHandler{Exec: &corev1.ExecAction{ + startuProbe := createProbe(v1.RadixProbeHandler{Exec: &v1.RadixProbeExecAction{ Command: []string{"echo", "hello"}, }}, 30) diff --git a/pkg/apis/deployment/radixcomponent_test.go b/pkg/apis/deployment/radixcomponent_test.go index bc424fbb0..bde0275cf 100644 --- a/pkg/apis/deployment/radixcomponent_test.go +++ b/pkg/apis/deployment/radixcomponent_test.go @@ -17,7 +17,6 @@ import ( "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" - "k8s.io/apimachinery/pkg/util/intstr" ) type scenarioDef struct { @@ -1050,21 +1049,21 @@ func Test_GetRadixComponents_Monitoring(t *testing.T) { } func Test_GetRadixComponents_CustomHealthChecks(t *testing.T) { - createProbe := func(handler corev1.ProbeHandler, seconds int32) *corev1.Probe { - return &corev1.Probe{ - ProbeHandler: handler, - InitialDelaySeconds: seconds, - TimeoutSeconds: seconds + 1, - PeriodSeconds: seconds + 2, - SuccessThreshold: seconds + 3, - FailureThreshold: seconds + 4, - TerminationGracePeriodSeconds: pointers.Ptr(int64(seconds + 5)), + createProbe := func(handler radixv1.RadixProbeHandler, seconds int32) *radixv1.RadixProbe { + return &radixv1.RadixProbe{ + RadixProbeHandler: handler, + InitialDelaySeconds: &seconds, + TimeoutSeconds: pointers.Ptr(seconds + 1), + PeriodSeconds: pointers.Ptr(seconds + 2), + SuccessThreshold: pointers.Ptr(seconds + 3), + FailureThreshold: pointers.Ptr(seconds + 4), + // TerminationGracePeriodSeconds: pointers.Ptr(int64(seconds + 5)), } } - httpProbe := corev1.ProbeHandler{HTTPGet: &corev1.HTTPGetAction{Port: intstr.FromInt32(5000), Path: "/healthz", Scheme: "http"}} - execProbe := corev1.ProbeHandler{Exec: &corev1.ExecAction{Command: []string{"/bin/sh", "-c", "/healthz /healthz"}}} - tcpProbe := corev1.ProbeHandler{TCPSocket: &corev1.TCPSocketAction{Port: intstr.FromInt32(8000)}} + httpProbe := radixv1.RadixProbeHandler{HTTPGet: &radixv1.RadixProbeHTTPGetAction{Port: pointers.Ptr[int32](5000), Path: pointers.Ptr("/healthz"), Scheme: pointers.Ptr(corev1.URISchemeHTTP)}} + execProbe := radixv1.RadixProbeHandler{Exec: &radixv1.RadixProbeExecAction{Command: []string{"/bin/sh", "-c", "/healthz /healthz"}}} + tcpProbe := radixv1.RadixProbeHandler{TCPSocket: &radixv1.RadixProbeTCPSocketAction{Port: pointers.Ptr[int32](8000)}} testCases := []struct { description string diff --git a/pkg/apis/radix/v1/radixapptypes.go b/pkg/apis/radix/v1/radixapptypes.go index db8b4ecc2..70f27a040 100644 --- a/pkg/apis/radix/v1/radixapptypes.go +++ b/pkg/apis/radix/v1/radixapptypes.go @@ -4,7 +4,6 @@ import ( "strings" commonUtils "github.com/equinor/radix-common/utils" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -821,13 +820,13 @@ type RadixHealthChecks struct { // Container will be restarted if the probe fails. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes // +optional - LivenessProbe *v1.Probe `json:"livenessProbe,omitempty"` + LivenessProbe *RadixProbe `json:"livenessProbe,omitempty"` // Periodic probe of container service readiness. // Container will be removed from service endpoints if the probe fails. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes // Defaults to TCP Probe against the first listed port // +optional - ReadinessProbe *v1.Probe `json:"readinessProbe,omitempty"` + ReadinessProbe *RadixProbe `json:"readinessProbe,omitempty"` // StartupProbe indicates that the Pod has successfully initialized. // If specified, no other probes are executed until this completes successfully. // If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. @@ -835,7 +834,7 @@ type RadixHealthChecks struct { // when it might take a long time to load data or warm a cache, than during steady-state operation. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes // +optional - StartupProbe *v1.Probe `json:"startupProbe,omitempty"` + StartupProbe *RadixProbe `json:"startupProbe,omitempty"` } // PrivateImageHubEntries defines authentication information for private image registries. diff --git a/pkg/apis/radix/v1/radixhealthchecktypes.go b/pkg/apis/radix/v1/radixhealthchecktypes.go new file mode 100644 index 000000000..1ad2460fd --- /dev/null +++ b/pkg/apis/radix/v1/radixhealthchecktypes.go @@ -0,0 +1,209 @@ +package v1 + +import ( + "github.com/equinor/radix-common/utils/pointers" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/util/intstr" +) + +// RadixProbe describes a health check to be performed against a container to determine whether it is +// alive or ready to receive traffic. +type RadixProbe struct { + // The action taken to determine the health of a container + RadixProbeHandler `json:",inline"` + // 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 + // +optional + InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` + // Number of seconds after which the probe times out. + // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + // +kubebuilder:validation:Minimum=1 + // +default=1 + // +optional + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` + // How often (in seconds) to perform the probe. + // +kubebuilder:validation:Minimum=1 + // +default=10 + // +optional + PeriodSeconds *int32 `json:"periodSeconds,omitempty"` + // Minimum consecutive successes for the probe to be considered successful after having failed. + // Must be 1 for liveness and startup. + // +kubebuilder:validation:Minimum=1 + // +default=1 + // +optional + SuccessThreshold *int32 `json:"successThreshold,omitempty"` + // Minimum consecutive failures for the probe to be considered failed after having succeeded. + // +kubebuilder:validation:Minimum=1 + // +default=3 + // +optional + FailureThreshold *int32 `json:"failureThreshold,omitempty"` + + // // Optional duration in seconds the pod needs to terminate gracefully upon probe failure. + // // The grace period is the duration in seconds after the processes running in the pod are sent + // // a termination signal and the time when the processes are forcibly halted with a kill signal. + // // Set this value longer than the expected cleanup time for your process. + // // If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this + // // value overrides the value provided by the pod spec. + // // Value must be non-negative integer. The value zero indicates stop immediately via + // // the kill signal (no opportunity to shut down). + // // This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. + // // +kubebuilder:validation:Minimum=1 + // // +default=30 + // // +optional + // TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` +} + +func (rp *RadixProbe) MapToCoreProbe() *corev1.Probe { + if rp == nil { + return nil + } + + return &corev1.Probe{ + ProbeHandler: rp.RadixProbeHandler.MapToCoreProbe(), + InitialDelaySeconds: pointers.Val(rp.InitialDelaySeconds), + TimeoutSeconds: pointers.Val(rp.TimeoutSeconds), + PeriodSeconds: pointers.Val(rp.PeriodSeconds), + SuccessThreshold: pointers.Val(rp.SuccessThreshold), + FailureThreshold: pointers.Val(rp.FailureThreshold), + // TerminationGracePeriodSeconds: rp.TerminationGracePeriodSeconds, + } +} + +// RadixProbeHandler defines a specific action that should be taken in a probe. +// One and only one of the fields must be specified. +type RadixProbeHandler struct { + // Exec specifies the action to take. + Exec *RadixProbeExecAction `json:"exec,omitempty"` + // HTTPGet specifies the http request to perform. + HTTPGet *RadixProbeHTTPGetAction `json:"httpGet,omitempty"` + // TCPSocket specifies an action involving a TCP port. + TCPSocket *RadixProbeTCPSocketAction `json:"tcpSocket,omitempty"` + // GRPC specifies an action involving a GRPC port. + GRPC *RadixProbeGRPCAction `json:"grpc,omitempty"` +} + +func (p RadixProbeHandler) MapToCoreProbe() corev1.ProbeHandler { + return corev1.ProbeHandler{ + Exec: p.Exec.MapToCoreProbe(), + HTTPGet: p.HTTPGet.MapToCoreProbe(), + TCPSocket: p.TCPSocket.MapToCoreProbe(), + GRPC: p.GRPC.MapToCoreProbe(), + } +} + +// RadixProbeHTTPGetAction describes an action based on HTTP Get requests. +type RadixProbeHTTPGetAction struct { + // Path to access on the HTTP server. + // +optional + Path *string `json:"path,omitempty"` + // port number to access on the container. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + Port *int32 `json:"port"` + // Host name to connect to, defaults to the pod IP. You probably want to set + // "Host" in httpHeaders instead. + // +optional + Host *string `json:"host,omitempty"` + // Scheme to use for connecting to the host. + // Defaults to HTTP. + // +optional + // +kubebuilder:validation:Enum=HTTPS;HTTP + Scheme *corev1.URIScheme `json:"scheme,omitempty"` + // Custom headers to set in the request. HTTP allows repeated headers. + // +optional + // +listType=atomic + HTTPHeaders []corev1.HTTPHeader `json:"httpHeaders,omitempty"` +} + +func (a *RadixProbeHTTPGetAction) MapToCoreProbe() *corev1.HTTPGetAction { + if a == nil { + return nil + } + + var port intstr.IntOrString + if a.Port != nil { + port = intstr.FromInt32(*a.Port) + } + + return &corev1.HTTPGetAction{ + Path: pointers.Val(a.Path), + Port: port, + Host: pointers.Val(a.Host), + Scheme: pointers.Val(a.Scheme), + HTTPHeaders: a.HTTPHeaders, + } +} + +// RadixProbeExecAction describes a "run in container" action. +type RadixProbeExecAction struct { + // Command is the command line to execute inside the container, the working directory for the + // command is root ('/') in the container's filesystem. The command is simply exec'd, it is + // not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use + // a shell, you need to explicitly call out to that shell. + // Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + // +optional + // +listType=atomic + Command []string `json:"command,omitempty"` +} + +func (a *RadixProbeExecAction) MapToCoreProbe() *corev1.ExecAction { + if a == nil { + return nil + } + + return &corev1.ExecAction{ + Command: a.Command, + } +} + +// RadixProbeTCPSocketAction describes an action based on opening a socket +type RadixProbeTCPSocketAction struct { + // port number to access on the container. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + Port *int32 `json:"port"` + // Optional: Host name to connect to, defaults to the pod IP. + // +optional + Host *string `json:"host,omitempty"` +} + +func (a *RadixProbeTCPSocketAction) MapToCoreProbe() *corev1.TCPSocketAction { + if a == nil { + return nil + } + var port intstr.IntOrString + if a.Port != nil { + port = intstr.FromInt32(*a.Port) + } + + return &corev1.TCPSocketAction{ + Port: port, + Host: pointers.Val(a.Host), + } +} + +type RadixProbeGRPCAction struct { + // Port number of the gRPC service. + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + Port int32 `json:"port"` + + // Service is the name of the service to place in the gRPC HealthCheckRequest + // (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + // + // If this is not specified, the default behavior is defined by gRPC. + // +optional + // +default="" + Service *string `json:"service"` +} + +func (a *RadixProbeGRPCAction) MapToCoreProbe() *corev1.GRPCAction { + if a == nil { + return nil + } + + return &corev1.GRPCAction{ + Port: a.Port, + Service: a.Service, + } +} diff --git a/pkg/apis/radix/v1/zz_generated.deepcopy.go b/pkg/apis/radix/v1/zz_generated.deepcopy.go index 46f5fc750..af753a6e4 100644 --- a/pkg/apis/radix/v1/zz_generated.deepcopy.go +++ b/pkg/apis/radix/v1/zz_generated.deepcopy.go @@ -2179,17 +2179,17 @@ func (in *RadixHealthChecks) DeepCopyInto(out *RadixHealthChecks) { *out = *in if in.LivenessProbe != nil { in, out := &in.LivenessProbe, &out.LivenessProbe - *out = new(corev1.Probe) + *out = new(RadixProbe) (*in).DeepCopyInto(*out) } if in.ReadinessProbe != nil { in, out := &in.ReadinessProbe, &out.ReadinessProbe - *out = new(corev1.Probe) + *out = new(RadixProbe) (*in).DeepCopyInto(*out) } if in.StartupProbe != nil { in, out := &in.StartupProbe, &out.StartupProbe - *out = new(corev1.Probe) + *out = new(RadixProbe) (*in).DeepCopyInto(*out) } return @@ -2842,6 +2842,193 @@ func (in *RadixPrivateImageHubCredential) DeepCopy() *RadixPrivateImageHubCreden return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RadixProbe) DeepCopyInto(out *RadixProbe) { + *out = *in + in.RadixProbeHandler.DeepCopyInto(&out.RadixProbeHandler) + if in.InitialDelaySeconds != nil { + in, out := &in.InitialDelaySeconds, &out.InitialDelaySeconds + *out = new(int32) + **out = **in + } + if in.TimeoutSeconds != nil { + in, out := &in.TimeoutSeconds, &out.TimeoutSeconds + *out = new(int32) + **out = **in + } + if in.PeriodSeconds != nil { + in, out := &in.PeriodSeconds, &out.PeriodSeconds + *out = new(int32) + **out = **in + } + if in.SuccessThreshold != nil { + in, out := &in.SuccessThreshold, &out.SuccessThreshold + *out = new(int32) + **out = **in + } + if in.FailureThreshold != nil { + in, out := &in.FailureThreshold, &out.FailureThreshold + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RadixProbe. +func (in *RadixProbe) DeepCopy() *RadixProbe { + if in == nil { + return nil + } + out := new(RadixProbe) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RadixProbeExecAction) DeepCopyInto(out *RadixProbeExecAction) { + *out = *in + if in.Command != nil { + in, out := &in.Command, &out.Command + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RadixProbeExecAction. +func (in *RadixProbeExecAction) DeepCopy() *RadixProbeExecAction { + if in == nil { + return nil + } + out := new(RadixProbeExecAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RadixProbeGRPCAction) DeepCopyInto(out *RadixProbeGRPCAction) { + *out = *in + if in.Service != nil { + in, out := &in.Service, &out.Service + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RadixProbeGRPCAction. +func (in *RadixProbeGRPCAction) DeepCopy() *RadixProbeGRPCAction { + if in == nil { + return nil + } + out := new(RadixProbeGRPCAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RadixProbeHTTPGetAction) DeepCopyInto(out *RadixProbeHTTPGetAction) { + *out = *in + if in.Path != nil { + in, out := &in.Path, &out.Path + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(int32) + **out = **in + } + if in.Host != nil { + in, out := &in.Host, &out.Host + *out = new(string) + **out = **in + } + if in.Scheme != nil { + in, out := &in.Scheme, &out.Scheme + *out = new(corev1.URIScheme) + **out = **in + } + if in.HTTPHeaders != nil { + in, out := &in.HTTPHeaders, &out.HTTPHeaders + *out = make([]corev1.HTTPHeader, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RadixProbeHTTPGetAction. +func (in *RadixProbeHTTPGetAction) DeepCopy() *RadixProbeHTTPGetAction { + if in == nil { + return nil + } + out := new(RadixProbeHTTPGetAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RadixProbeHandler) DeepCopyInto(out *RadixProbeHandler) { + *out = *in + if in.Exec != nil { + in, out := &in.Exec, &out.Exec + *out = new(RadixProbeExecAction) + (*in).DeepCopyInto(*out) + } + if in.HTTPGet != nil { + in, out := &in.HTTPGet, &out.HTTPGet + *out = new(RadixProbeHTTPGetAction) + (*in).DeepCopyInto(*out) + } + if in.TCPSocket != nil { + in, out := &in.TCPSocket, &out.TCPSocket + *out = new(RadixProbeTCPSocketAction) + (*in).DeepCopyInto(*out) + } + if in.GRPC != nil { + in, out := &in.GRPC, &out.GRPC + *out = new(RadixProbeGRPCAction) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RadixProbeHandler. +func (in *RadixProbeHandler) DeepCopy() *RadixProbeHandler { + if in == nil { + return nil + } + out := new(RadixProbeHandler) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RadixProbeTCPSocketAction) DeepCopyInto(out *RadixProbeTCPSocketAction) { + *out = *in + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(int32) + **out = **in + } + if in.Host != nil { + in, out := &in.Host, &out.Host + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RadixProbeTCPSocketAction. +func (in *RadixProbeTCPSocketAction) DeepCopy() *RadixProbeTCPSocketAction { + if in == nil { + return nil + } + out := new(RadixProbeTCPSocketAction) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RadixPromoteSpec) DeepCopyInto(out *RadixPromoteSpec) { *out = *in diff --git a/pkg/apis/radixvalidators/errors.go b/pkg/apis/radixvalidators/errors.go index a2ab58f8b..ccc829e89 100644 --- a/pkg/apis/radixvalidators/errors.go +++ b/pkg/apis/radixvalidators/errors.go @@ -183,7 +183,7 @@ func ComponentForDNSExternalAliasIsNotMarkedAsPublicErrorWithMessage(component s // ComponentHasInvalidHealthChecks Component has invalid health checks func ComponentHasInvalidHealthChecks(component string, probeName string, err error) error { - return errors.WithMessagef(ErrComponentHasInvalidHealthCheck, "component %s has invalid health checks %s: %w", probeName, component, err) + return errors.WithMessagef(ErrComponentHasInvalidHealthCheck, "component %s has invalid health checks %s: %s", probeName, component, err.Error()) } // EnvironmentReferencedByComponentDoesNotExistErrorWithMessage Environment does not exists diff --git a/pkg/apis/radixvalidators/validate_ra.go b/pkg/apis/radixvalidators/validate_ra.go index 20d986cfa..99929d179 100644 --- a/pkg/apis/radixvalidators/validate_ra.go +++ b/pkg/apis/radixvalidators/validate_ra.go @@ -838,13 +838,13 @@ func validateHealthChecks(app *radixv1.RadixApplication) error { continue } - if err := validateProbe(component.HealthChecks.StartupProbe); err != nil { + if err := validateProbe(component.HealthChecks.StartupProbe, "StartupProbe"); err != nil { errs = append(errs, ComponentHasInvalidHealthChecks(component.Name, "StartupProbe", err)) } - if err := validateProbe(component.HealthChecks.ReadinessProbe); err != nil { + if err := validateProbe(component.HealthChecks.ReadinessProbe, "ReadinessProbe"); err != nil { errs = append(errs, ComponentHasInvalidHealthChecks(component.Name, "ReadinessProbe", err)) } - if err := validateProbe(component.HealthChecks.LivenessProbe); err != nil { + if err := validateProbe(component.HealthChecks.LivenessProbe, "LivenessProbe"); err != nil { errs = append(errs, ComponentHasInvalidHealthChecks(component.Name, "LivenessProbe", err)) } } @@ -852,18 +852,38 @@ func validateHealthChecks(app *radixv1.RadixApplication) error { return errors.Join(errs...) } -func validateProbe(probe *corev1.Probe) error { +func validateProbe(probe *radixv1.RadixProbe, name string) error { if probe == nil { return nil } + var errs []error if (probe.HTTPGet != nil && (probe.TCPSocket != nil || probe.Exec != nil)) || (probe.TCPSocket != nil && (probe.HTTPGet != nil || probe.Exec != nil)) || (probe.Exec != nil && (probe.HTTPGet != nil || probe.TCPSocket != nil)) { - return fmt.Errorf("HTTPGet, TCPSocket and Exec are mutually exclusive") + errs = append(errs, fmt.Errorf("HTTPGet, TCPSocket and Exec are mutually exclusive")) } - return nil + if probe.InitialDelaySeconds != nil && *probe.InitialDelaySeconds < 1 { + errs = append(errs, fmt.Errorf("InitialDelaySeconds must be equal or greater than 1")) + } + + if probe.TimeoutSeconds != nil && *probe.TimeoutSeconds < 1 { + errs = append(errs, fmt.Errorf("TimeoutSeconds must be equal or greater than 1")) + } + + if probe.PeriodSeconds != nil && *probe.PeriodSeconds < 1 { + errs = append(errs, fmt.Errorf("PeriodSeconds must be equal or greater than 1")) + } + + if probe.SuccessThreshold != nil && *probe.SuccessThreshold < 1 { + errs = append(errs, fmt.Errorf("SuccessThreshold must be equal or greater than 1")) + } + if (name == "StartupProbe" || name == "LivenessProbe") && probe.SuccessThreshold != nil && *probe.SuccessThreshold != 1 { + errs = append(errs, fmt.Errorf("SuccessThreshold must be equal to 1 for Liveness and Startup probes")) + } + + return errors.Join(errs...) } func getEnvVarNameMap(componentEnvVarsMap radixv1.EnvVarsMap, envsEnvVarsMap radixv1.EnvVarsMap) map[string]bool { diff --git a/pkg/apis/radixvalidators/validate_ra_test.go b/pkg/apis/radixvalidators/validate_ra_test.go index 2c16f3878..fa160e4d1 100644 --- a/pkg/apis/radixvalidators/validate_ra_test.go +++ b/pkg/apis/radixvalidators/validate_ra_test.go @@ -78,14 +78,6 @@ func Test_application_name_casing_is_validated(t *testing.T) { } } -func Test_Invalid_HealthChecks(t *testing.T) { - t.Errorf("Not implemented") -} - -func Test_Valid_HealthChecks(t *testing.T) { - t.Errorf("Not implemented") -} - func Test_invalid_ra(t *testing.T) { validRAFirstComponentName := "app" validRAFirstJobName := "job" @@ -614,6 +606,47 @@ func Test_invalid_ra(t *testing.T) { rr.Spec.Components[0].EnvironmentConfig[0].Authentication.OAuth2.Cookie.Expire = "30m" rr.Spec.Components[0].EnvironmentConfig[0].Authentication.OAuth2.Cookie.Refresh = "1h" }}, + {"no healthchecks are valid", nil, func(rr *radixv1.RadixApplication) { + rr.Spec.Components[0].HealthChecks = nil + }}, + {"custom healthchecks are valid", nil, func(rr *radixv1.RadixApplication) { + rr.Spec.Components[0].HealthChecks = &radixv1.RadixHealthChecks{ + LivenessProbe: &radixv1.RadixProbe{ + RadixProbeHandler: radixv1.RadixProbeHandler{HTTPGet: &radixv1.RadixProbeHTTPGetAction{Port: pointers.Ptr[int32](5000), Path: pointers.Ptr("/healthz")}}, + }, + ReadinessProbe: &radixv1.RadixProbe{ + RadixProbeHandler: radixv1.RadixProbeHandler{Exec: &radixv1.RadixProbeExecAction{Command: []string{"/bin/sh", "-c", "/healthz"}}}, + }, + StartupProbe: &radixv1.RadixProbe{ + RadixProbeHandler: radixv1.RadixProbeHandler{TCPSocket: &radixv1.RadixProbeTCPSocketAction{Port: pointers.Ptr[int32](5000)}}, + }, + } + }}, + {"invalid healthchecks are invalid", radixvalidators.ErrComponentHasInvalidHealthCheck, func(rr *radixv1.RadixApplication) { + rr.Spec.Components[0].HealthChecks = &radixv1.RadixHealthChecks{ + LivenessProbe: &radixv1.RadixProbe{ + RadixProbeHandler: radixv1.RadixProbeHandler{ + HTTPGet: &radixv1.RadixProbeHTTPGetAction{Port: pointers.Ptr[int32](5000), Path: pointers.Ptr("/healthz")}, + Exec: &radixv1.RadixProbeExecAction{Command: []string{"/bin/sh", "-c", "/healthz"}}, + TCPSocket: &radixv1.RadixProbeTCPSocketAction{Port: pointers.Ptr[int32](5000)}, + }, + }, + ReadinessProbe: &radixv1.RadixProbe{ + RadixProbeHandler: radixv1.RadixProbeHandler{ + HTTPGet: &radixv1.RadixProbeHTTPGetAction{Port: pointers.Ptr[int32](5000), Path: pointers.Ptr("/healthz")}, + Exec: &radixv1.RadixProbeExecAction{Command: []string{"/bin/sh", "-c", "/healthz"}}, + TCPSocket: &radixv1.RadixProbeTCPSocketAction{Port: pointers.Ptr[int32](5000)}, + }, + }, + StartupProbe: &radixv1.RadixProbe{ + RadixProbeHandler: radixv1.RadixProbeHandler{ + HTTPGet: &radixv1.RadixProbeHTTPGetAction{Port: pointers.Ptr[int32](5000), Path: pointers.Ptr("/healthz")}, + Exec: &radixv1.RadixProbeExecAction{Command: []string{"/bin/sh", "-c", "/healthz"}}, + TCPSocket: &radixv1.RadixProbeTCPSocketAction{Port: pointers.Ptr[int32](5000)}, + }, + }, + } + }}, {"duplicate name in job/component boundary", radixvalidators.DuplicateComponentOrJobNameErrorWithMessage([]string{validRAFirstComponentName}), func(ra *radixv1.RadixApplication) { job := *ra.Spec.Jobs[0].DeepCopy() job.Name = validRAFirstComponentName diff --git a/pkg/apis/utils/applicationcomponent_builder.go b/pkg/apis/utils/applicationcomponent_builder.go index 15aab5609..dae81bd3b 100644 --- a/pkg/apis/utils/applicationcomponent_builder.go +++ b/pkg/apis/utils/applicationcomponent_builder.go @@ -2,7 +2,6 @@ package utils import ( radixv1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - corev1 "k8s.io/api/core/v1" ) // RadixApplicationComponentBuilder Handles construction of RA component @@ -11,7 +10,7 @@ type RadixApplicationComponentBuilder interface { WithAlwaysPullImageOnDeploy(bool) RadixApplicationComponentBuilder WithSourceFolder(string) RadixApplicationComponentBuilder WithDockerfileName(string) RadixApplicationComponentBuilder - WithHealthChecks(startupProbe, readynessProbe, livenessProbe *corev1.Probe) RadixApplicationComponentBuilder + WithHealthChecks(startupProbe, readynessProbe, livenessProbe *radixv1.RadixProbe) RadixApplicationComponentBuilder WithImage(string) RadixApplicationComponentBuilder WithImageTagName(imageTagName string) RadixApplicationComponentBuilder WithPublic(bool) RadixApplicationComponentBuilder // Deprecated: For backwards compatibility WithPublic is still supported, new code should use WithPublicPort instead @@ -79,7 +78,7 @@ func (rcb *radixApplicationComponentBuilder) WithAlwaysPullImageOnDeploy(val boo return rcb } -func (rcb *radixApplicationComponentBuilder) WithHealthChecks(startupProbe, readynessProbe, livenessProbe *corev1.Probe) RadixApplicationComponentBuilder { +func (rcb *radixApplicationComponentBuilder) WithHealthChecks(startupProbe, readynessProbe, livenessProbe *radixv1.RadixProbe) RadixApplicationComponentBuilder { rcb.healtChecks = &radixv1.RadixHealthChecks{ LivenessProbe: livenessProbe, ReadinessProbe: readynessProbe, diff --git a/pkg/apis/utils/componentenvironment_builder.go b/pkg/apis/utils/componentenvironment_builder.go index 14e0c7f22..c53c56e55 100644 --- a/pkg/apis/utils/componentenvironment_builder.go +++ b/pkg/apis/utils/componentenvironment_builder.go @@ -2,7 +2,6 @@ package utils import ( radixv1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - corev1 "k8s.io/api/core/v1" ) // RadixEnvironmentConfigBuilder Handles construction of RA component environment @@ -10,7 +9,7 @@ type RadixEnvironmentConfigBuilder interface { WithEnvironment(string) RadixEnvironmentConfigBuilder WithSourceFolder(string) RadixEnvironmentConfigBuilder WithDockerfileName(string) RadixEnvironmentConfigBuilder - WithHealthChecks(startupProbe, readynessProbe, livenessProbe *corev1.Probe) RadixEnvironmentConfigBuilder + WithHealthChecks(startupProbe, readynessProbe, livenessProbe *radixv1.RadixProbe) RadixEnvironmentConfigBuilder WithImage(string) RadixEnvironmentConfigBuilder WithReplicas(*int) RadixEnvironmentConfigBuilder WithEnvironmentVariable(string, string) RadixEnvironmentConfigBuilder @@ -68,7 +67,7 @@ func (ceb *radixEnvironmentConfigBuilder) WithResource(request map[string]string return ceb } -func (ceb *radixEnvironmentConfigBuilder) WithHealthChecks(startupProbe, readynessProbe, livenessProbe *corev1.Probe) RadixEnvironmentConfigBuilder { +func (ceb *radixEnvironmentConfigBuilder) WithHealthChecks(startupProbe, readynessProbe, livenessProbe *radixv1.RadixProbe) RadixEnvironmentConfigBuilder { ceb.healtChecks = &radixv1.RadixHealthChecks{ LivenessProbe: livenessProbe, ReadinessProbe: readynessProbe, diff --git a/pkg/apis/utils/deploymentcomponent_builder.go b/pkg/apis/utils/deploymentcomponent_builder.go index c77728952..984c3ea62 100644 --- a/pkg/apis/utils/deploymentcomponent_builder.go +++ b/pkg/apis/utils/deploymentcomponent_builder.go @@ -2,7 +2,6 @@ package utils import ( v1 "github.com/equinor/radix-operator/pkg/apis/radix/v1" - corev1 "k8s.io/api/core/v1" ) // DeployComponentBuilder Handles construction of RD component @@ -24,7 +23,7 @@ type DeployComponentBuilder interface { WithResourceRequestsOnly(map[string]string) DeployComponentBuilder WithResource(map[string]string, map[string]string) DeployComponentBuilder WithVolumeMounts(...v1.RadixVolumeMount) DeployComponentBuilder - WithHealthChecks(startupProbe, readynessProbe, livenessProbe *corev1.Probe) DeployComponentBuilder + WithHealthChecks(startupProbe, readynessProbe, livenessProbe *v1.RadixProbe) DeployComponentBuilder WithNodeGpu(gpu string) DeployComponentBuilder WithNodeGpuCount(gpuCount string) DeployComponentBuilder WithIngressConfiguration(...string) DeployComponentBuilder @@ -80,7 +79,7 @@ func (dcb *deployComponentBuilder) WithVolumeMounts(volumeMounts ...v1.RadixVolu return dcb } -func (dcb *deployComponentBuilder) WithHealthChecks(startupProbe, readynessProbe, livenessProbe *corev1.Probe) DeployComponentBuilder { +func (dcb *deployComponentBuilder) WithHealthChecks(startupProbe, readynessProbe, livenessProbe *v1.RadixProbe) DeployComponentBuilder { dcb.healtChecks = &v1.RadixHealthChecks{ LivenessProbe: livenessProbe, ReadinessProbe: readynessProbe,