Skip to content

Commit fee5a70

Browse files
committed
update deepcopy and crd
Signed-off-by: DavidSpek <vanderspek.david@gmail.com>
1 parent 033ff47 commit fee5a70

File tree

3 files changed

+263
-0
lines changed

3 files changed

+263
-0
lines changed

pkg/apis/acid.zalan.do/v1/crds.go

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,132 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
363363
},
364364
},
365365
},
366+
"livenessProbe": {
367+
Description: "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes",
368+
Type: "object",
369+
Properties: map[string]apiextv1.JSONSchemaProps{
370+
"exec": {
371+
Description: "One and only one of the following should be specified. Exec specifies the action to take.",
372+
Type: "object",
373+
Properties: map[string]apiextv1.JSONSchemaProps{
374+
"command": {
375+
Description: "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.",
376+
Type: "array",
377+
Items: &apiextv1.JSONSchemaPropsOrArray{
378+
Schema: &apiextv1.JSONSchemaProps{
379+
Type: "string",
380+
},
381+
},
382+
},
383+
},
384+
},
385+
"failureThreshold": {
386+
Description: "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.",
387+
Type: "integer",
388+
Format: "int32",
389+
},
390+
"httpGet": {
391+
Description: "HTTPGet specifies the http request to perform.",
392+
Type: "object",
393+
Required: []string{"port"},
394+
Properties: map[string]apiextv1.JSONSchemaProps{
395+
"host": {
396+
Description: "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.",
397+
Type: "string",
398+
},
399+
"httpHeaders": {
400+
Description: "Custom headers to set in the request. HTTP allows repeated headers.",
401+
Type: "array",
402+
Items: &apiextv1.JSONSchemaPropsOrArray{
403+
Schema: &apiextv1.JSONSchemaProps{
404+
Description: "HTTPHeader describes a custom header to be used in HTTP probes",
405+
Type: "object",
406+
Required: []string{"name", "value"},
407+
Properties: map[string]apiextv1.JSONSchemaProps{
408+
"name": {
409+
Description: "The header field name",
410+
Type: "string",
411+
},
412+
"value": {
413+
Description: "The header field value",
414+
Type: "string",
415+
},
416+
},
417+
},
418+
},
419+
},
420+
"path": {
421+
Description: "Path to access on the HTTP server.",
422+
Type: "string",
423+
},
424+
"port": {
425+
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.",
426+
AnyOf: []apiextv1.JSONSchemaProps{
427+
{
428+
Type: "integer",
429+
},
430+
{
431+
Type: "string",
432+
},
433+
},
434+
XIntOrString: true,
435+
},
436+
"scheme": {
437+
Description: "Scheme to use for connecting to the host. Defaults to HTTP.",
438+
Type: "string",
439+
},
440+
},
441+
},
442+
"initialDelaySeconds": {
443+
Description: "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes",
444+
Type: "integer",
445+
Format: "int32",
446+
},
447+
"periodSeconds": {
448+
Description: "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.",
449+
Type: "integer",
450+
Format: "int32",
451+
},
452+
"successThreshold": {
453+
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.",
454+
Type: "integer",
455+
Format: "int32",
456+
},
457+
"tcpSocket": {
458+
Description: "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook",
459+
Type: "object",
460+
Required: []string{"port"},
461+
Properties: map[string]apiextv1.JSONSchemaProps{
462+
"host": {
463+
Description: "Optional: Host name to connect to, defaults to the pod IP.",
464+
Type: "string",
465+
},
466+
"port": {
467+
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.",
468+
XIntOrString: true,
469+
AnyOf: []apiextv1.JSONSchemaProps{
470+
{
471+
Type: "integer",
472+
},
473+
{
474+
Type: "string",
475+
},
476+
},
477+
},
478+
},
479+
},
480+
"terminationGracePeriodSeconds": {
481+
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.",
482+
Type: "integer",
483+
Format: "int64",
484+
},
485+
"timeoutSeconds": {
486+
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",
487+
Type: "integer",
488+
Format: "int32",
489+
},
490+
},
491+
},
366492
"nodeAffinity": {
367493
Type: "object",
368494
Properties: map[string]apiextv1.JSONSchemaProps{
@@ -1360,6 +1486,132 @@ var OperatorConfigCRDResourceValidation = apiextv1.CustomResourceValidation{
13601486
},
13611487
},
13621488
},
1489+
"liveness_probe": {
1490+
Description: "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes",
1491+
Type: "object",
1492+
Properties: map[string]apiextv1.JSONSchemaProps{
1493+
"exec": {
1494+
Description: "One and only one of the following should be specified. Exec specifies the action to take.",
1495+
Type: "object",
1496+
Properties: map[string]apiextv1.JSONSchemaProps{
1497+
"command": {
1498+
Description: "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.",
1499+
Type: "array",
1500+
Items: &apiextv1.JSONSchemaPropsOrArray{
1501+
Schema: &apiextv1.JSONSchemaProps{
1502+
Type: "string",
1503+
},
1504+
},
1505+
},
1506+
},
1507+
},
1508+
"failureThreshold": {
1509+
Description: "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.",
1510+
Type: "integer",
1511+
Format: "int32",
1512+
},
1513+
"httpGet": {
1514+
Description: "HTTPGet specifies the http request to perform.",
1515+
Type: "object",
1516+
Required: []string{"port"},
1517+
Properties: map[string]apiextv1.JSONSchemaProps{
1518+
"host": {
1519+
Description: "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.",
1520+
Type: "string",
1521+
},
1522+
"httpHeaders": {
1523+
Description: "Custom headers to set in the request. HTTP allows repeated headers.",
1524+
Type: "array",
1525+
Items: &apiextv1.JSONSchemaPropsOrArray{
1526+
Schema: &apiextv1.JSONSchemaProps{
1527+
Description: "HTTPHeader describes a custom header to be used in HTTP probes",
1528+
Type: "object",
1529+
Required: []string{"name", "value"},
1530+
Properties: map[string]apiextv1.JSONSchemaProps{
1531+
"name": {
1532+
Description: "The header field name",
1533+
Type: "string",
1534+
},
1535+
"value": {
1536+
Description: "The header field value",
1537+
Type: "string",
1538+
},
1539+
},
1540+
},
1541+
},
1542+
},
1543+
"path": {
1544+
Description: "Path to access on the HTTP server.",
1545+
Type: "string",
1546+
},
1547+
"port": {
1548+
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.",
1549+
AnyOf: []apiextv1.JSONSchemaProps{
1550+
{
1551+
Type: "integer",
1552+
},
1553+
{
1554+
Type: "string",
1555+
},
1556+
},
1557+
XIntOrString: true,
1558+
},
1559+
"scheme": {
1560+
Description: "Scheme to use for connecting to the host. Defaults to HTTP.",
1561+
Type: "string",
1562+
},
1563+
},
1564+
},
1565+
"initialDelaySeconds": {
1566+
Description: "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes",
1567+
Type: "integer",
1568+
Format: "int32",
1569+
},
1570+
"periodSeconds": {
1571+
Description: "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.",
1572+
Type: "integer",
1573+
Format: "int32",
1574+
},
1575+
"successThreshold": {
1576+
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.",
1577+
Type: "integer",
1578+
Format: "int32",
1579+
},
1580+
"tcpSocket": {
1581+
Description: "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported TODO: implement a realistic TCP lifecycle hook",
1582+
Type: "object",
1583+
Required: []string{"port"},
1584+
Properties: map[string]apiextv1.JSONSchemaProps{
1585+
"host": {
1586+
Description: "Optional: Host name to connect to, defaults to the pod IP.",
1587+
Type: "string",
1588+
},
1589+
"port": {
1590+
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.",
1591+
XIntOrString: true,
1592+
AnyOf: []apiextv1.JSONSchemaProps{
1593+
{
1594+
Type: "integer",
1595+
},
1596+
{
1597+
Type: "string",
1598+
},
1599+
},
1600+
},
1601+
},
1602+
},
1603+
"terminationGracePeriodSeconds": {
1604+
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.",
1605+
Type: "integer",
1606+
Format: "int64",
1607+
},
1608+
"timeoutSeconds": {
1609+
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",
1610+
Type: "integer",
1611+
Format: "int32",
1612+
},
1613+
},
1614+
},
13631615
"master_pod_move_timeout": {
13641616
Type: "string",
13651617
},

pkg/apis/acid.zalan.do/v1/zz_generated.deepcopy.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/util/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ type Resources struct {
6161
NodeReadinessLabel map[string]string `name:"node_readiness_label" default:""`
6262
NodeReadinessLabelMerge string `name:"node_readiness_label_merge" default:"OR"`
6363
ShmVolume *bool `name:"enable_shm_volume" default:"true"`
64+
LivenessProbe *v1.Probe `name:"liveness_probe"`
6465

6566
MaxInstances int32 `name:"max_instances" default:"-1"`
6667
MinInstances int32 `name:"min_instances" default:"-1"`

0 commit comments

Comments
 (0)