add hostnet and enableservicelinks

This commit is contained in:
Stavros kois
2023-01-30 21:57:50 +02:00
parent 491445329c
commit a1ab2d5960
11 changed files with 311 additions and 93 deletions

View File

@@ -7,4 +7,4 @@ MD033: false
MD024: false
MD013:
line_length: 200
line_length: 300

View File

@@ -0,0 +1,75 @@
suite: pod enableServiceLinks test
templates:
- common.yaml
tests:
- it: should pass with enableServiceLinks disabled from "global"
set:
podOptions:
enableServiceLinks: false
controllers:
controller-name1:
enabled: true
primary: true
type: DaemonSet
podSpec: {}
asserts:
- documentIndex: &daemonSetDoc 0
isKind:
of: DaemonSet
- documentIndex: *daemonSetDoc
equal:
path: spec.template.spec.enableServiceLinks
value: false
- it: should pass with enableServiceLinks enabled from "global"
set:
podOptions:
enableServiceLinks: true
controllers:
controller-name1:
enabled: true
primary: true
type: DaemonSet
podSpec: {}
asserts:
- documentIndex: *daemonSetDoc
isKind:
of: DaemonSet
- documentIndex: *daemonSetDoc
equal:
path: spec.template.spec.enableServiceLinks
value: true
- it: should pass with disabled enableServiceLinks from pod
set:
podOptions:
enableServiceLinks: true
controllers:
controller-name1:
enabled: true
primary: true
type: DaemonSet
podSpec:
enableServiceLinks: false
asserts:
- documentIndex: *daemonSetDoc
equal:
path: spec.template.spec.enableServiceLinks
value: false
- it: should pass with enabled enableServiceLinks from pod
set:
podOptions:
enableServiceLinks: false
controllers:
controller-name1:
enabled: true
primary: true
type: DaemonSet
podSpec:
enableServiceLinks: true
asserts:
- documentIndex: *daemonSetDoc
equal:
path: spec.template.spec.enableServiceLinks
value: true

View File

@@ -0,0 +1,75 @@
suite: pod hostnetwork test
templates:
- common.yaml
tests:
- it: should pass with hostnetwork disabled from "global"
set:
podOptions:
hostNetwork: false
controllers:
controller-name1:
enabled: true
primary: true
type: Deployment
podSpec: {}
asserts:
- documentIndex: &deploymentDoc 0
isKind:
of: Deployment
- documentIndex: *deploymentDoc
equal:
path: spec.template.spec.hostNetwork
value: false
- it: should pass with hostnetwork enabled from "global"
set:
podOptions:
hostNetwork: true
controllers:
controller-name1:
enabled: true
primary: true
type: Deployment
podSpec: {}
asserts:
- documentIndex: *deploymentDoc
isKind:
of: Deployment
- documentIndex: *deploymentDoc
equal:
path: spec.template.spec.hostNetwork
value: true
- it: should pass with disabled hostnetwork from pod
set:
podOptions:
hostNetwork: true
controllers:
controller-name1:
enabled: true
primary: true
type: Deployment
podSpec:
hostNetwork: false
asserts:
- documentIndex: *deploymentDoc
equal:
path: spec.template.spec.hostNetwork
value: false
- it: should pass with enabled hostnetwork from pod
set:
podOptions:
hostNetwork: false
controllers:
controller-name1:
enabled: true
primary: true
type: Deployment
podSpec:
hostNetwork: true
asserts:
- documentIndex: *deploymentDoc
equal:
path: spec.template.spec.hostNetwork
value: true

View File

@@ -1,29 +1,31 @@
# CronJob
| Key | Type | Required | Helm Template | Default | Description |
| :------------------------------------------------------- | :-------: | :------: | :-----------: | :----------------: | :---------------------------------------------------- |
| controllers | `dict` | ❌ | ❌ | `{}` | Define the controllers as dicts |
| controllers.[controller-name] | `dict` | ✅ | ❌ | `{}` | Holds controller definition |
| controllers.[controller-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the controller |
| controllers.[controller-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the controller as primary |
| controllers.[controller-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for controller |
| controllers.[controller-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for controller |
| controllers.[controller-name].type | `string` | ✅ | ❌ | `""` | Define the type (kind) of the controller |
| controllers.[controller-name].schedule | `string` | ✅ | ✅ | `""` | Define the schedule |
| controllers.[controller-name].timezone | `string` | ❌ | ✅ | `{{ .Values.TZ }}` | Define the timezone |
| controllers.[controller-name].concurrencyPolicy | `string` | ❌ | ✅ | `Forbid` | Define the concurrencyPolicy (Allow, Replace, Forbid) |
| controllers.[controller-name].failedJobsHistoryLimit | `int` | ❌ | ❌ | `1` | Define the failedJobsHistoryLimit |
| controllers.[controller-name].successfulJobsHistoryLimit | `int` | ❌ | ❌ | `3` | Define the successfulJobsHistoryLimit |
| controllers.[controller-name].startingDeadlineSeconds | `int` | ❌ | ❌ | | Define the startingDeadlineSeconds |
| controllers.[controller-name].completionMode | `string` | ❌ | ❌ | `NonIndexed` | Define the completionMode (Indexed, NonIndexed) |
| controllers.[controller-name].backoffLimit | `int` | ❌ | ❌ | `5` | Define the backoffLimit |
| controllers.[controller-name].completions | `int` | ❌ | ❌ | | Define the completions |
| controllers.[controller-name].parallelism | `int` | ❌ | ❌ | `1` | Define the parallelism |
| controllers.[controller-name].ttlSecondsAfterFinished | `int` | ❌ | ❌ | `120` | Define the ttlSecondsAfterFinished |
| controllers.[controller-name].activeDeadlineSeconds | `int` | ❌ | ❌ | | Define the activeDeadlineSeconds |
| controllers.[controller-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition |
| controllers.[controller-name].podSpec.labels | `dict` | ❌ | ✅ | `{}` | Pod Labels |
| controllers.[controller-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations |
| Key | Type | Required | Helm Template | Default | Description |
| :------------------------------------------------------- | :-------: | :------: | :-----------: | :---------------------------------------------------: | :---------------------------------------------------- |
| controllers | `dict` | ❌ | ❌ | `{}` | Define the controllers as dicts |
| controllers.[controller-name] | `dict` | ✅ | ❌ | `{}` | Holds controller definition |
| controllers.[controller-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the controller |
| controllers.[controller-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the controller as primary |
| controllers.[controller-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for controller |
| controllers.[controller-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for controller |
| controllers.[controller-name].type | `string` | ✅ | ❌ | `""` | Define the type (kind) of the controller |
| controllers.[controller-name].schedule | `string` | ✅ | ✅ | `""` | Define the schedule |
| controllers.[controller-name].timezone | `string` | ❌ | ✅ | `{{ .Values.TZ }}` | Define the timezone |
| controllers.[controller-name].concurrencyPolicy | `string` | ❌ | ✅ | `Forbid` | Define the concurrencyPolicy (Allow, Replace, Forbid) |
| controllers.[controller-name].failedJobsHistoryLimit | `int` | ❌ | ❌ | `1` | Define the failedJobsHistoryLimit |
| controllers.[controller-name].successfulJobsHistoryLimit | `int` | ❌ | ❌ | `3` | Define the successfulJobsHistoryLimit |
| controllers.[controller-name].startingDeadlineSeconds | `int` | ❌ | ❌ | | Define the startingDeadlineSeconds |
| controllers.[controller-name].completionMode | `string` | ❌ | ❌ | `NonIndexed` | Define the completionMode (Indexed, NonIndexed) |
| controllers.[controller-name].backoffLimit | `int` | ❌ | ❌ | `5` | Define the backoffLimit |
| controllers.[controller-name].completions | `int` | ❌ | ❌ | | Define the completions |
| controllers.[controller-name].parallelism | `int` | ❌ | ❌ | `1` | Define the parallelism |
| controllers.[controller-name].ttlSecondsAfterFinished | `int` | ❌ | ❌ | `120` | Define the ttlSecondsAfterFinished |
| controllers.[controller-name].activeDeadlineSeconds | `int` | ❌ | ❌ | | Define the activeDeadlineSeconds |
| controllers.[controller-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition |
| controllers.[controller-name].podSpec.labels | `dict` | ❌ | ✅ | `{}` | Pod Labels |
| controllers.[controller-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations |
| controllers.[controller-name].podSpec.hostNetwork | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.hostNetwork }}` (false) | Pod's hostNetwork |
| controllers.[controller-name].podSpec.enableServiceLinks | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.enableServiceLinks }}` (false) | Pod's enableServiceLinks |
---
@@ -65,6 +67,8 @@ controllers:
podSpec:
labels: {}
annotations: {}
hostNetwork: false
enableServiceLinks: false
other-controller-name:
enabled: true

View File

@@ -1,21 +1,23 @@
# DaemonSet
| Key | Type | Required | Helm Template | Default | Description |
| :--------------------------------------------------------- | :-------: | :------: | :-----------: | :-------------: | :------------------------------------------------------------------- |
| controllers | `dict` | ❌ | ❌ | `{}` | Define the controllers as dicts |
| controllers.[controller-name] | `dict` | ✅ | ❌ | `{}` | Holds controller definition |
| controllers.[controller-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the controller |
| controllers.[controller-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the controller as primary |
| controllers.[controller-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for controller |
| controllers.[controller-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for controller |
| controllers.[controller-name].type | `string` | ✅ | ❌ | `""` | Define the type (kind) of the controller |
| controllers.[controller-name].strategy | `string` | ❌ | ❌ | `RollingUpdate` | Define the strategy of the controller (OnDelete, RollingUpdate) |
| controllers.[controller-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.maxSurge | `int` | ❌ | ❌ | | Define the maxSurge, Only when strategy is RollingUpdate |
| controllers.[controller-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition |
| controllers.[controller-name].podSpec.labels | `dict` | ❌ | ✅ | `{}` | Pod Labels |
| controllers.[controller-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations |
| Key | Type | Required | Helm Template | Default | Description |
| :--------------------------------------------------------- | :-------: | :------: | :-----------: | :---------------------------------------------------: | :------------------------------------------------------------------- |
| controllers | `dict` | ❌ | ❌ | `{}` | Define the controllers as dicts |
| controllers.[controller-name] | `dict` | ✅ | ❌ | `{}` | Holds controller definition |
| controllers.[controller-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the controller |
| controllers.[controller-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the controller as primary |
| controllers.[controller-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for controller |
| controllers.[controller-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for controller |
| controllers.[controller-name].type | `string` | ✅ | ❌ | `""` | Define the type (kind) of the controller |
| controllers.[controller-name].strategy | `string` | ❌ | ❌ | `RollingUpdate` | Define the strategy of the controller (OnDelete, RollingUpdate) |
| controllers.[controller-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.maxSurge | `int` | ❌ | ❌ | | Define the maxSurge, Only when strategy is RollingUpdate |
| controllers.[controller-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition |
| controllers.[controller-name].podSpec.labels | `dict` | ❌ | ✅ | `{}` | Pod Labels |
| controllers.[controller-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations |
| controllers.[controller-name].podSpec.hostNetwork | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.hostNetwork }}` (false) | Pod's hostNetwork |
| controllers.[controller-name].podSpec.enableServiceLinks | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.enableServiceLinks }}` (false) | Pod's enableServiceLinks |
---
@@ -51,6 +53,8 @@ controllers:
podSpec:
labels: {}
annotations: {}
hostNetwork: false
enableServiceLinks: false
other-controller-name:
enabled: true

View File

@@ -1,21 +1,23 @@
# Deployment
| Key | Type | Required | Helm Template | Default | Description |
| :--------------------------------------------------------- | :-------: | :------: | :-----------: | :--------: | :------------------------------------------------------------------- |
| controllers | `dict` | ❌ | ❌ | `{}` | Define the controllers as dicts |
| controllers.[controller-name] | `dict` | ✅ | ❌ | `{}` | Holds controller definition |
| controllers.[controller-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the controller |
| controllers.[controller-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the controller as primary |
| controllers.[controller-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for controller |
| controllers.[controller-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for controller |
| controllers.[controller-name].type | `string` | ✅ | ❌ | `""` | Define the type (kind) of the controller |
| controllers.[controller-name].strategy | `string` | ❌ | ❌ | `Recreate` | Define the strategy of the controller (Recreate, RollingUpdate) |
| controllers.[controller-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.maxSurge | `int` | ❌ | ❌ | | Define the maxSurge, Only when strategy is RollingUpdate |
| controllers.[controller-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition |
| controllers.[controller-name].podSpec.labels | `dict` | ❌ | ✅ | `{}` | Pod Labels |
| controllers.[controller-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations |
| Key | Type | Required | Helm Template | Default | Description |
| :--------------------------------------------------------- | :-------: | :------: | :-----------: | :---------------------------------------------------: | :------------------------------------------------------------------- |
| controllers | `dict` | ❌ | ❌ | `{}` | Define the controllers as dicts |
| controllers.[controller-name] | `dict` | ✅ | ❌ | `{}` | Holds controller definition |
| controllers.[controller-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the controller |
| controllers.[controller-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the controller as primary |
| controllers.[controller-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for controller |
| controllers.[controller-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for controller |
| controllers.[controller-name].type | `string` | ✅ | ❌ | `""` | Define the type (kind) of the controller |
| controllers.[controller-name].strategy | `string` | ❌ | ❌ | `Recreate` | Define the strategy of the controller (Recreate, RollingUpdate) |
| controllers.[controller-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.maxSurge | `int` | ❌ | ❌ | | Define the maxSurge, Only when strategy is RollingUpdate |
| controllers.[controller-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition |
| controllers.[controller-name].podSpec.labels | `dict` | ❌ | ✅ | `{}` | Pod Labels |
| controllers.[controller-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations |
| controllers.[controller-name].podSpec.hostNetwork | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.hostNetwork }}` (false) | Pod's hostNetwork |
| controllers.[controller-name].podSpec.enableServiceLinks | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.enableServiceLinks }}` (false) | Pod's enableServiceLinks |
---
@@ -51,6 +53,8 @@ controllers:
podSpec:
labels: {}
annotations: {}
hostNetwork: false
enableServiceLinks: false
other-controller-name:
enabled: true

View File

@@ -1,23 +1,25 @@
# Job
| Key | Type | Required | Helm Template | Default | Description |
| :---------------------------------------------------- | :-------: | :------: | :-----------: | :----------: | :---------------------------------------------- |
| controllers | `dict` | ❌ | ❌ | `{}` | Define the controllers as dicts |
| controllers.[controller-name] | `dict` | ✅ | ❌ | `{}` | Holds controller definition |
| controllers.[controller-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the controller |
| controllers.[controller-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the controller as primary |
| controllers.[controller-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for controller |
| controllers.[controller-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for controller |
| controllers.[controller-name].type | `string` | ✅ | ❌ | `""` | Define the type (kind) of the controller |
| controllers.[controller-name].completionMode | `string` | ❌ | ❌ | `NonIndexed` | Define the completionMode (Indexed, NonIndexed) |
| controllers.[controller-name].backoffLimit | `int` | ❌ | ❌ | `5` | Define the backoffLimit |
| controllers.[controller-name].completions | `int` | ❌ | ❌ | | Define the completions |
| controllers.[controller-name].parallelism | `int` | ❌ | ❌ | `1` | Define the parallelism |
| controllers.[controller-name].ttlSecondsAfterFinished | `int` | ❌ | ❌ | `120` | Define the ttlSecondsAfterFinished |
| controllers.[controller-name].activeDeadlineSeconds | `int` | ❌ | ❌ | | Define the activeDeadlineSeconds |
| controllers.[controller-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition |
| controllers.[controller-name].podSpec.labels | `dict` | ❌ | ✅ | `{}` | Pod Labels |
| controllers.[controller-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations |
| Key | Type | Required | Helm Template | Default | Description |
| :------------------------------------------------------- | :-------: | :------: | :-----------: | :---------------------------------------------------: | :---------------------------------------------- |
| controllers | `dict` | ❌ | ❌ | `{}` | Define the controllers as dicts |
| controllers.[controller-name] | `dict` | ✅ | ❌ | `{}` | Holds controller definition |
| controllers.[controller-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the controller |
| controllers.[controller-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the controller as primary |
| controllers.[controller-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for controller |
| controllers.[controller-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for controller |
| controllers.[controller-name].type | `string` | ✅ | ❌ | `""` | Define the type (kind) of the controller |
| controllers.[controller-name].completionMode | `string` | ❌ | ❌ | `NonIndexed` | Define the completionMode (Indexed, NonIndexed) |
| controllers.[controller-name].backoffLimit | `int` | ❌ | ❌ | `5` | Define the backoffLimit |
| controllers.[controller-name].completions | `int` | ❌ | ❌ | | Define the completions |
| controllers.[controller-name].parallelism | `int` | ❌ | ❌ | `1` | Define the parallelism |
| controllers.[controller-name].ttlSecondsAfterFinished | `int` | ❌ | ❌ | `120` | Define the ttlSecondsAfterFinished |
| controllers.[controller-name].activeDeadlineSeconds | `int` | ❌ | ❌ | | Define the activeDeadlineSeconds |
| controllers.[controller-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition |
| controllers.[controller-name].podSpec.labels | `dict` | ❌ | ✅ | `{}` | Pod Labels |
| controllers.[controller-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations |
| controllers.[controller-name].podSpec.hostNetwork | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.hostNetwork }}` (false) | Pod's hostNetwork |
| controllers.[controller-name].podSpec.enableServiceLinks | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.enableServiceLinks }}` (false) | Pod's enableServiceLinks |
---
@@ -53,6 +55,8 @@ controllers:
podSpec:
labels: {}
annotations: {}
hostNetwork: false
enableServiceLinks: false
other-controller-name:
enabled: true

View File

@@ -1,21 +1,23 @@
# DaemonSet
| Key | Type | Required | Helm Template | Default | Description |
| :--------------------------------------------------------- | :-------: | :------: | :-----------: | :-------------: | :------------------------------------------------------------------- |
| controllers | `dict` | ❌ | ❌ | `{}` | Define the controllers as dicts |
| controllers.[controller-name] | `dict` | ✅ | ❌ | `{}` | Holds controller definition |
| controllers.[controller-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the controller |
| controllers.[controller-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the controller as primary |
| controllers.[controller-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for controller |
| controllers.[controller-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for controller |
| controllers.[controller-name].type | `string` | ✅ | ❌ | `""` | Define the type (kind) of the controller |
| controllers.[controller-name].strategy | `string` | ❌ | ❌ | `RollingUpdate` | Define the strategy of the controller (OnDelete, RollingUpdate) |
| controllers.[controller-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.partition | `int` | ❌ | ❌ | | Define the partition, Only when strategy is RollingUpdate |
| controllers.[controller-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition |
| controllers.[controller-name].podSpec.labels | `dict` | ❌ | ✅ | `{}` | Pod Labels |
| controllers.[controller-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations |
| Key | Type | Required | Helm Template | Default | Description |
| :--------------------------------------------------------- | :-------: | :------: | :-----------: | :---------------------------------------------------: | :------------------------------------------------------------------- |
| controllers | `dict` | ❌ | ❌ | `{}` | Define the controllers as dicts |
| controllers.[controller-name] | `dict` | ✅ | ❌ | `{}` | Holds controller definition |
| controllers.[controller-name].enabled | `boolean` | ✅ | ❌ | `false` | Enables or Disables the controller |
| controllers.[controller-name].primary | `boolean` | ✅ | ❌ | `false` | Sets the controller as primary |
| controllers.[controller-name].labels | `dict` | ❌ | ✅ | `{}` | Additional labels for controller |
| controllers.[controller-name].annotations | `dict` | ❌ | ✅ | `{}` | Additional annotations for controller |
| controllers.[controller-name].type | `string` | ✅ | ❌ | `""` | Define the type (kind) of the controller |
| controllers.[controller-name].strategy | `string` | ❌ | ❌ | `RollingUpdate` | Define the strategy of the controller (OnDelete, RollingUpdate) |
| controllers.[controller-name].rollingUpdate | `dict` | ❌ | ❌ | `{}` | Holds the rollingUpdate options, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.maxUnavailable | `int` | ❌ | ❌ | | Define the maxUnavailable, Only when strategy is RollingUpdate |
| controllers.[controller-name].rollingUpdate.partition | `int` | ❌ | ❌ | | Define the partition, Only when strategy is RollingUpdate |
| controllers.[controller-name].podSpec | `dict` | ✅ | ❌ | `{}` | Holds the pod definition |
| controllers.[controller-name].podSpec.labels | `dict` | ❌ | ✅ | `{}` | Pod Labels |
| controllers.[controller-name].podSpec.annotations | `dict` | ❌ | ✅ | `{}` | Pod Annotations |
| controllers.[controller-name].podSpec.hostNetwork | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.hostNetwork }}` (false) | Pod's hostNetwork |
| controllers.[controller-name].podSpec.enableServiceLinks | `boolean` | ❌ | ❌ | `{{ .Values.podOptions.enableServiceLinks }}` (false) | Pod's enableServiceLinks |
---
@@ -51,6 +53,8 @@ controllers:
podSpec:
labels: {}
annotations: {}
hostNetwork: false
enableServiceLinks: false
other-controller-name:
enabled: true

View File

@@ -11,6 +11,6 @@ objectData: The object data to be used to render the Pod.
imagePullSecrets:
{{- . | nindent 2 }}
{{- end }}
hostNetwork: false
hostNetwork: {{ include "ix.v1.common.lib.pod.hostNetwork" (dict "rootCtx" $rootCtx "objectData" $objectData) }}
enableServiceLinks: {{ include "ix.v1.common.lib.pod.enableServiceLinks" (dict "rootCtx" $rootCtx "objectData" $objectData) }}
{{- end -}}

View File

@@ -0,0 +1,24 @@
{{/* Returns enableServiceLinks */}}
{{/* Call this template:
{{ include "ix.v1.common.lib.pod.enableServiceLinks" (dict "rootCtx" $ "objectData" $objectData) }}
rootCtx: The root context of the template. It is used to access the global context.
objectData: The object data to be used to render the Pod.
*/}}
{{- define "ix.v1.common.lib.pod.enableServiceLinks" -}}
{{- $rootCtx := .rootCtx -}}
{{- $objectData := .objectData -}}
{{- $enableServiceLinks := false -}}
{{/* Initialize from the "global" option */}}
{{- if (kindIs "bool" $rootCtx.Values.podOptions.enableServiceLinks) -}}
{{- $enableServiceLinks = $rootCtx.Values.podOptions.enableServiceLinks -}}
{{- end -}}
{{/* Override with pod's option */}}
{{- if (kindIs "bool" $objectData.podSpec.enableServiceLinks) -}}
{{- $enableServiceLinks = $objectData.podSpec.enableServiceLinks -}}
{{- end -}}
{{- $enableServiceLinks -}}
{{- end -}}

View File

@@ -0,0 +1,24 @@
{{/* Returns Host Network */}}
{{/* Call this template:
{{ include "ix.v1.common.lib.pod.hostNetwork" (dict "rootCtx" $ "objectData" $objectData) }}
rootCtx: The root context of the template. It is used to access the global context.
objectData: The object data to be used to render the Pod.
*/}}
{{- define "ix.v1.common.lib.pod.hostNetwork" -}}
{{- $rootCtx := .rootCtx -}}
{{- $objectData := .objectData -}}
{{- $hostNet := false -}}
{{/* Initialize from the "global" option */}}
{{- if (kindIs "bool" $rootCtx.Values.podOptions.hostNetwork) -}}
{{- $hostNet = $rootCtx.Values.podOptions.hostNetwork -}}
{{- end -}}
{{/* Override with pod's option */}}
{{- if (kindIs "bool" $objectData.podSpec.hostNetwork) -}}
{{- $hostNet = $objectData.podSpec.hostNetwork -}}
{{- end -}}
{{- $hostNet -}}
{{- end -}}