mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 08:37:03 +02:00
feat(common): Release common 4.0.0 (#398)
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
This commit is contained in:
parent
1e210f43e3
commit
a01a89cb13
327 changed files with 11181 additions and 7330 deletions
|
@ -64,6 +64,8 @@ nav:
|
|||
- index.md
|
||||
- Common Library:
|
||||
- common-library/index.md
|
||||
- Generated Resources:
|
||||
- common-library/resources/names.md
|
||||
- Storage:
|
||||
- Permissions: common-library/storage/permissions.md
|
||||
- Global options: common-library/storage/globalOptions.md
|
||||
|
@ -78,8 +80,10 @@ nav:
|
|||
- How To...:
|
||||
- common-library/howto/index.md
|
||||
- Default container options: common-library/howto/default-container-options.md
|
||||
- Default Pod options: common-library/howto/default-pod-options.md
|
||||
- App Template:
|
||||
- app-template/index.md
|
||||
- Upgrade instructions: app-template/upgrade-instructions.md
|
||||
- How To...:
|
||||
- app-template/howto/index.md
|
||||
- Helm templates: app-template/howto/helm-templates.md
|
||||
|
|
1
.github/renovate/custom-managers.json5
vendored
1
.github/renovate/custom-managers.json5
vendored
|
@ -6,7 +6,6 @@
|
|||
description: "Process common lib json schema references",
|
||||
fileMatch: ["\\.json$"],
|
||||
matchStrings: [
|
||||
// https://raw.githubusercontent.com/bjw-s-labs/helm-charts/common-3.0.3/charts/library/common/values.schema.json
|
||||
"https:\\/\\/raw.githubusercontent.com\\/bjw-s-labs\\/helm-charts\\/(?<depName>\\S+?)-(?<currentValue>[\\d\\.]+?)\\/\\S+",
|
||||
],
|
||||
datasourceTemplate: "helm",
|
||||
|
|
2
.github/workflows/chart-release-steps.yaml
vendored
2
.github/workflows/chart-release-steps.yaml
vendored
|
@ -63,7 +63,6 @@ jobs:
|
|||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
path: src
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install Helm
|
||||
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
|
||||
|
@ -160,7 +159,6 @@ jobs:
|
|||
with:
|
||||
path: gh-pages
|
||||
ref: gh-pages
|
||||
persist-credentials: false
|
||||
|
||||
- name: Copy package to gh-pages structure
|
||||
id: copy-package
|
||||
|
|
2
.github/workflows/charts-release.yaml
vendored
2
.github/workflows/charts-release.yaml
vendored
|
@ -53,7 +53,7 @@ jobs:
|
|||
patterns: |
|
||||
library/**
|
||||
|
||||
- name: Get changed library charts
|
||||
- name: Get changed charts
|
||||
id: changed-charts
|
||||
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||
uses: bjw-s-labs/action-changed-files@930cef8463348e168cab7235c47fe95a7a235f65 # v0.3.3
|
||||
|
|
2
.github/workflows/charts-test.yaml
vendored
2
.github/workflows/charts-test.yaml
vendored
|
@ -30,10 +30,12 @@ jobs:
|
|||
chart: ${{ fromJSON(inputs.charts) }}
|
||||
k8s_version:
|
||||
[
|
||||
"v1.28.15",
|
||||
"v1.29.13",
|
||||
"v1.30.11",
|
||||
"v1.31.7",
|
||||
"v1.32.3",
|
||||
"v1.33.0",
|
||||
]
|
||||
fail-fast: false
|
||||
steps:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://taskfile.dev/schema.json
|
||||
version: "3"
|
||||
|
||||
vars:
|
||||
|
|
17
.taskfiles/docs.yaml
Normal file
17
.taskfiles/docs.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://taskfile.dev/schema.json
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
serve:
|
||||
desc: Serve documentation locally
|
||||
deps:
|
||||
- install_prerequisies
|
||||
cmds:
|
||||
- mkdocs serve -c -f .ci/mkdocs/mkdocs.yml
|
||||
|
||||
install_prerequisies:
|
||||
desc: Install prerequisites
|
||||
internal: true
|
||||
cmds:
|
||||
- pip install -r docs/requirements.txt
|
|
@ -1,23 +0,0 @@
|
|||
---
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
init:
|
||||
desc: Install pre-commit hooks
|
||||
cmds:
|
||||
- pre-commit install --install-hooks --config .ci/pre-commit/config.yaml
|
||||
|
||||
update:
|
||||
desc: Update pre-commit hooks
|
||||
cmds:
|
||||
- pre-commit autoupdate --config .ci/pre-commit/config.yaml
|
||||
|
||||
run:
|
||||
desc: Run pre-commit
|
||||
cmds:
|
||||
- pre-commit run --config .ci/pre-commit/config.yaml
|
||||
|
||||
run-all:
|
||||
desc: Run pre-commit on all files
|
||||
cmds:
|
||||
- pre-commit run --all-files --config .ci/pre-commit/config.yaml
|
|
@ -7,7 +7,7 @@ vars:
|
|||
|
||||
includes:
|
||||
charts: .taskfiles/charts.yaml
|
||||
precommit: .taskfiles/precommit.yaml
|
||||
docs: .taskfiles/docs.yaml
|
||||
|
||||
tasks:
|
||||
default:
|
||||
|
|
|
@ -3,8 +3,8 @@ apiVersion: v2
|
|||
name: common
|
||||
description: Function library for Helm charts
|
||||
type: library
|
||||
version: 3.7.3
|
||||
kubeVersion: ">=1.22.0-0"
|
||||
version: 4.0.0
|
||||
kubeVersion: ">=1.28.0-0"
|
||||
keywords:
|
||||
- common
|
||||
- library
|
||||
|
@ -16,9 +16,48 @@ sources:
|
|||
- https://github.com/bjw-s-labs/helm-charts
|
||||
annotations:
|
||||
artifacthub.io/changes: |-
|
||||
- kind: removed
|
||||
description: |-
|
||||
Individual `valuesToObject` functions have been removed in favor of a centralized `bjw-s.common.lib.valuesToObject` function.
|
||||
- kind: fixed
|
||||
description: |-
|
||||
Fixed name suffix for HTTPRoute
|
||||
- kind: fixed
|
||||
Fixed empty backendRefs in HTTPRoute leading to invalid spec
|
||||
- kind: added
|
||||
description: |-
|
||||
Fixed incorrect default backendRefs values in HTTPRoute
|
||||
Added support for setting `parentRefs[].port` in HTTPRoute
|
||||
- kind: added
|
||||
description: |-
|
||||
Added support for setting `sessionPersistence` in HTTPRoute
|
||||
- kind: added
|
||||
description: |-
|
||||
Added support for setting `resources` on the Pod Level in Kubernetes >= 1.32
|
||||
- kind: added
|
||||
description: |-
|
||||
Added explicit JSON schema for `rbac` root key
|
||||
- kind: added
|
||||
description: |-
|
||||
Allow configuring the merge strategy for `defaultPodOptions`
|
||||
- kind: added
|
||||
description: |-
|
||||
Added support for setting `subPathExpr` on globalMounts and advancedMounts persistence items
|
||||
- kind: added
|
||||
description: |-
|
||||
Added support for automatically determining the target controller for Services if there is only one enabled controller
|
||||
- kind: added
|
||||
description: |-
|
||||
Added support for automatically determining the target service for Ingress paths if there is only one enabled Service
|
||||
- kind: changed
|
||||
description: |-
|
||||
**Breaking**: Standardized resource name logic for all resources. This may cause changes in the generated resource names.
|
||||
links:
|
||||
- name: Documentation
|
||||
url: https://bjw-s-labs.github.io/helm-charts/docs/common-library/resources/names/
|
||||
- kind: changed
|
||||
description: |-
|
||||
**Breaking**: Increased the minimum supported Kubernetes version to 1.28.0
|
||||
- kind: changed
|
||||
description: |-
|
||||
**Breaking**: ServiceAccounts no longer create a static token by default. This is now controlled by the `staticToken` field in the `serviceAccount` object.
|
||||
- kind: changed
|
||||
description: |-
|
||||
**Breaking**: Renamed the hardcoded app.kubernetes.io/component label to app.kubernetes.io/controller
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
# common
|
||||
|
||||
 
|
||||
 
|
||||
|
||||
Function library for Helm charts
|
||||
|
||||
## Source Code
|
||||
|
||||
* <https://github.com/bjw-s-labs/helm-charts>
|
||||
|
||||
## Requirements
|
||||
|
||||
Kubernetes: `>=1.22.0-0`
|
||||
Kubernetes: `>=1.28.0-0`
|
||||
|
||||
## Dependencies
|
||||
|
||||
|
@ -27,7 +31,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
|
|||
# Chart.yaml
|
||||
dependencies:
|
||||
- name: common
|
||||
version: 3.7.3
|
||||
version: 4.0.0
|
||||
repository: https://bjw-s-labs.github.io/helm-charts/
|
||||
```
|
||||
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
{
|
||||
"instance": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
|
@ -17,9 +23,6 @@
|
|||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
"nameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
"data": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
|
@ -38,4 +41,6 @@
|
|||
{"required": ["binaryData"]}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
{
|
||||
"instance": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
|
@ -24,9 +30,6 @@
|
|||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
"nameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
"pod": {
|
||||
"$ref": "pod.json#/options"
|
||||
},
|
||||
|
@ -263,7 +266,10 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"statefulset": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
|
@ -301,6 +307,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
"statefulset.volumeClaimTemplate": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
|
@ -348,6 +355,7 @@
|
|||
"size"
|
||||
]
|
||||
},
|
||||
|
||||
"cronjob": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
|
@ -396,6 +404,7 @@
|
|||
"schedule"
|
||||
]
|
||||
},
|
||||
|
||||
"job": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
|
|
|
@ -1,4 +1,29 @@
|
|||
{
|
||||
"resourceIdentifier": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"forceRename": {
|
||||
"type": "string",
|
||||
"description": "Override the default resource name. This field is mutually exclusive with the prefix and suffix fields."
|
||||
},
|
||||
"prefix": {
|
||||
"type": "string",
|
||||
"description": "Prefix to prepend to the resource name. This field is mutually exclusive with the forceRename field.",
|
||||
"default": ""
|
||||
},
|
||||
"suffix": {
|
||||
"type": "string",
|
||||
"description": "Suffix to append to the resource name. Defaults to the resource identifier if there are multiple items, otherwise it defaults to empty. This field is mutually exclusive with the forceRename field."
|
||||
}
|
||||
},
|
||||
"not" : {
|
||||
"anyOf" : [
|
||||
{"required" : ["forceRename", "suffix"]},
|
||||
{"required" : ["forceRename", "prefix"]}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"annotations": {
|
||||
"type": ["object", "null"],
|
||||
"additionalProperties": {
|
||||
|
|
|
@ -1,41 +1,36 @@
|
|||
{
|
||||
"instance": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
|
||||
"annotations": {
|
||||
"$ref": "definitions.json#/annotations"
|
||||
},
|
||||
|
||||
"className": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
"defaultBackend": {
|
||||
"$ref": "k8s-api.json#/networking.v1.ingressBackend"
|
||||
},
|
||||
|
||||
"hosts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/hostEntry"
|
||||
}
|
||||
},
|
||||
|
||||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
|
||||
"nameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
"tls": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
@ -43,6 +38,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"hostEntry": {
|
||||
|
@ -70,7 +67,7 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"required": ["path", "service"]
|
||||
"required": ["path"]
|
||||
},
|
||||
"title": "paths",
|
||||
"type": "array"
|
||||
|
@ -119,7 +116,6 @@
|
|||
"port": {
|
||||
"type": ["string", "integer"]
|
||||
}
|
||||
},
|
||||
"required": ["identifier"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{
|
||||
"instance": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
|
@ -17,9 +23,6 @@
|
|||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
"nameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
"podSelector": {},
|
||||
"policyTypes": {
|
||||
"type": "array",
|
||||
|
@ -49,4 +52,6 @@
|
|||
},
|
||||
"required": ["rules"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
},
|
||||
|
||||
"persistentVolumeClaimItem": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
|
||||
|
@ -20,6 +23,9 @@
|
|||
"type": {
|
||||
"const": "persistentVolumeClaim"
|
||||
},
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
|
@ -39,9 +45,6 @@
|
|||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
"nameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
"retain": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
@ -58,6 +61,8 @@
|
|||
"globalMounts": {"$ref": "#/globalMounts"}
|
||||
},
|
||||
"required": ["accessMode", "size"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"persistentVolumeClaimWithExistingClaimItem": {
|
||||
|
@ -330,6 +335,9 @@
|
|||
"subPath": {
|
||||
"type": "string"
|
||||
},
|
||||
"subPathExpr": {
|
||||
"type": "string"
|
||||
},
|
||||
"mountPropagation": {
|
||||
"type": "string"
|
||||
}
|
||||
|
|
|
@ -67,6 +67,9 @@
|
|||
"priorityClassName": {
|
||||
"type": "string"
|
||||
},
|
||||
"resources": {
|
||||
"$ref": "k8s-api.json#/core.v1.ResourceRequirements"
|
||||
},
|
||||
"restartPolicy": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
{
|
||||
"instance": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
|
@ -19,14 +25,10 @@
|
|||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
"nameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
"forceRename": {
|
||||
"type": "string"
|
||||
},
|
||||
"spec": {}
|
||||
},
|
||||
"required": ["apiVersion", "kind", "spec"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
118
charts/library/common/schemas/rbac.json
Normal file
118
charts/library/common/schemas/rbac.json
Normal file
|
@ -0,0 +1,118 @@
|
|||
{
|
||||
"role": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Role",
|
||||
"ClusterRole"
|
||||
],
|
||||
"default": "Role"
|
||||
},
|
||||
"annotations": {
|
||||
"$ref": "definitions.json#/annotations"
|
||||
},
|
||||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
"rules": {
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": ["type", "rules"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"roleBinding": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"RoleBinding",
|
||||
"ClusterRoleBinding"
|
||||
],
|
||||
"default": "RoleBinding"
|
||||
},
|
||||
"annotations": {
|
||||
"$ref": "definitions.json#/annotations"
|
||||
},
|
||||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
"roleRef": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"identifier": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Role",
|
||||
"ClusterRole"
|
||||
]
|
||||
}
|
||||
},
|
||||
"oneOf": [
|
||||
{"required": ["identifier"]},
|
||||
{"required": ["name", "kind"]}
|
||||
]
|
||||
},
|
||||
"subjects": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"identifier": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"type": "string"
|
||||
},
|
||||
"namespace": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"oneOf": [
|
||||
{"required": ["identifier"]},
|
||||
{"required": ["name", "kind", "namespace"]}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["type", "roleRef", "subjects"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,9 +1,14 @@
|
|||
{
|
||||
"instance": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
|
||||
"properties": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
|
@ -12,6 +17,9 @@
|
|||
"annotations": {
|
||||
"$ref": "definitions.json#/annotations"
|
||||
},
|
||||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
|
||||
"hostnames": {
|
||||
"type": "array",
|
||||
|
@ -23,14 +31,6 @@
|
|||
"enum": ["GRPCRoute", "HTTPRoute", "TCPRoute", "TLSRoute", "UDPRoute"]
|
||||
},
|
||||
|
||||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
|
||||
"nameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
"parentRefs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
@ -51,6 +51,9 @@
|
|||
},
|
||||
"sectionName": {
|
||||
"type": "string"
|
||||
},
|
||||
"port": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
|
@ -79,7 +82,12 @@
|
|||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"description": "A reference to a backend Service name."
|
||||
},
|
||||
"identifier": {
|
||||
"type": "string",
|
||||
"description": "A reference to a backend service that is defined within the chart values."
|
||||
},
|
||||
"port": {
|
||||
"type": ["string", "integer"]
|
||||
|
@ -115,6 +123,10 @@
|
|||
"type": "array",
|
||||
"items": {}
|
||||
},
|
||||
"sessionPersistence": {
|
||||
"description": "SessionPersistence defines the desired state of SessionPersistence",
|
||||
"type": "object"
|
||||
},
|
||||
"timeouts": {
|
||||
"type": "object"
|
||||
}
|
||||
|
@ -123,4 +135,6 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
{
|
||||
"instance": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
|
@ -17,9 +23,6 @@
|
|||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
"nameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -32,4 +35,6 @@
|
|||
},
|
||||
"required": ["stringData"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
{
|
||||
"instance": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
|
@ -13,9 +19,6 @@
|
|||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
"nameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -86,7 +89,9 @@
|
|||
},
|
||||
"extraSelectorLabels": {}
|
||||
},
|
||||
"required": ["controller"]
|
||||
"required": []
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"servicePort": {
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
{
|
||||
"settings": {
|
||||
"instance": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"create": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
"default": true
|
||||
},
|
||||
"annotations": {
|
||||
"$ref": "definitions.json#/annotations"
|
||||
|
@ -16,28 +19,12 @@
|
|||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
"extraServiceAccounts": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"create": {
|
||||
"staticToken": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"annotations": {
|
||||
"$ref": "definitions.json#/annotations"
|
||||
},
|
||||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
{
|
||||
"instance": {
|
||||
"allOf": [
|
||||
{ "$ref": "definitions.json#/resourceIdentifier" },
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"forceRename": {},
|
||||
"prefix": {},
|
||||
"suffix": {},
|
||||
"enabled": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
|
@ -13,9 +19,6 @@
|
|||
"labels": {
|
||||
"$ref": "definitions.json#/labels"
|
||||
},
|
||||
"nameOverride": {
|
||||
"type": "string"
|
||||
},
|
||||
"endpoints": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
@ -62,4 +65,6 @@
|
|||
"serviceName": {"not": {"required": ["selector"]}}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,13 +6,10 @@ using the common library.
|
|||
{{- $rootContext := .rootContext -}}
|
||||
{{- $cronjobObject := .object -}}
|
||||
|
||||
{{- $timeZone := "" -}}
|
||||
{{- if ge (int $rootContext.Capabilities.KubeVersion.Minor) 27 }}
|
||||
{{- $timeZone = dig "cronjob" "timeZone" "" $cronjobObject -}}
|
||||
{{- end -}}
|
||||
{{- $timeZone := dig "cronjob" "timeZone" "" $cronjobObject -}}
|
||||
|
||||
{{- $labels := merge
|
||||
(dict "app.kubernetes.io/component" $cronjobObject.identifier)
|
||||
(dict "app.kubernetes.io/controller" $cronjobObject.identifier)
|
||||
($cronjobObject.labels | default dict)
|
||||
(include "bjw-s.common.lib.metadata.allLabels" $rootContext | fromYaml)
|
||||
-}}
|
||||
|
|
|
@ -7,7 +7,7 @@ within the common library.
|
|||
{{- $daemonsetObject := .object -}}
|
||||
|
||||
{{- $labels := merge
|
||||
(dict "app.kubernetes.io/component" $daemonsetObject.identifier)
|
||||
(dict "app.kubernetes.io/controller" $daemonsetObject.identifier)
|
||||
($daemonsetObject.labels | default dict)
|
||||
(include "bjw-s.common.lib.metadata.allLabels" $rootContext | fromYaml)
|
||||
-}}
|
||||
|
@ -37,7 +37,7 @@ spec:
|
|||
revisionHistoryLimit: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" $daemonsetObject.revisionHistoryLimit "default" 3) }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: {{ $daemonsetObject.identifier }}
|
||||
app.kubernetes.io/controller: {{ $daemonsetObject.identifier }}
|
||||
{{- include "bjw-s.common.lib.metadata.selectorLabels" $rootContext | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
|
|
|
@ -7,7 +7,7 @@ using the common library.
|
|||
{{- $deploymentObject := .object -}}
|
||||
|
||||
{{- $labels := merge
|
||||
(dict "app.kubernetes.io/component" $deploymentObject.identifier)
|
||||
(dict "app.kubernetes.io/controller" $deploymentObject.identifier)
|
||||
($deploymentObject.labels | default dict)
|
||||
(include "bjw-s.common.lib.metadata.allLabels" $rootContext | fromYaml)
|
||||
-}}
|
||||
|
@ -57,7 +57,7 @@ spec:
|
|||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: {{ $deploymentObject.identifier }}
|
||||
app.kubernetes.io/controller: {{ $deploymentObject.identifier }}
|
||||
{{- include "bjw-s.common.lib.metadata.selectorLabels" $rootContext | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
|
|
|
@ -72,7 +72,7 @@ spec:
|
|||
{{ else if .service.identifier -}}
|
||||
{{ $service = (include "bjw-s.common.lib.service.getByIdentifier" (dict "rootContext" $rootContext "id" .service.identifier) | fromYaml ) -}}
|
||||
{{ if not $service -}}
|
||||
{{fail (printf "No service found with this identifier. (ingress: '%s', path: '%s', identifier: '%s')" $ingressObject.identifier .path .service.identifier)}}
|
||||
{{fail (printf "No enabled Service found with this identifier. (ingress: '%s', path: '%s', identifier: '%s')" $ingressObject.identifier .path .service.identifier)}}
|
||||
{{ end -}}
|
||||
{{ $serviceName = $service.name -}}
|
||||
{{ end -}}
|
||||
|
|
|
@ -7,7 +7,7 @@ within the common library.
|
|||
{{- $jobObject := .object -}}
|
||||
|
||||
{{- $labels := merge
|
||||
(dict "app.kubernetes.io/component" $jobObject.identifier)
|
||||
(dict "app.kubernetes.io/controller" $jobObject.identifier)
|
||||
($jobObject.labels | default dict)
|
||||
(include "bjw-s.common.lib.metadata.allLabels" $rootContext | fromYaml)
|
||||
-}}
|
||||
|
|
|
@ -20,7 +20,7 @@ within the common library.
|
|||
{{- else -}}
|
||||
{{- $podSelector = dict "matchLabels" (merge
|
||||
($networkPolicyObject.extraSelectorLabels | default dict)
|
||||
(dict "app.kubernetes.io/component" $networkPolicyObject.controller)
|
||||
(dict "app.kubernetes.io/controller" $networkPolicyObject.controller)
|
||||
(include "bjw-s.common.lib.metadata.selectorLabels" $rootContext | fromYaml)
|
||||
) -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -20,7 +20,6 @@ within the common library.
|
|||
$annotations
|
||||
-}}
|
||||
{{- end -}}
|
||||
|
||||
---
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
|
|
|
@ -25,16 +25,21 @@ kind: {{ . }}
|
|||
metadata:
|
||||
name: {{ $roleObject.name }}
|
||||
{{- with $labels }}
|
||||
labels: {{- toYaml . | nindent 4 -}}
|
||||
labels:
|
||||
{{- range $key, $value := . }}
|
||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with $annotations }}
|
||||
annotations: {{- toYaml . | nindent 4 -}}
|
||||
annotations:
|
||||
{{- range $key, $value := . }}
|
||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{ if eq $roleObject.type "Role" -}}
|
||||
{{- end }}
|
||||
{{- if eq $roleObject.type "Role" }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
{{- end -}}
|
||||
{{ with $rules }}
|
||||
{{- end }}
|
||||
{{- with $rules }}
|
||||
rules: {{- tpl . $rootContext | nindent 2 }}
|
||||
{{- end }}
|
||||
|
||||
{{- end -}}
|
||||
|
|
|
@ -18,6 +18,9 @@ This template serves as a blueprint for generating RoleBinding objects in Kubern
|
|||
{{- range $subject := . -}}
|
||||
{{- if hasKey . "identifier" -}}
|
||||
{{- $subject := include "bjw-s.common.lib.serviceAccount.getByIdentifier" (dict "rootContext" $rootContext "id" .identifier) | fromYaml -}}
|
||||
{{- if not $subject }}
|
||||
{{- fail (printf "No enabled ServiceAccount found with this identifier. (rolebinding: '%s', identifier: '%s')" $roleBindingObject.identifier .identifier) -}}
|
||||
{{- end -}}
|
||||
{{- $subject = pick $subject "name" -}}
|
||||
{{- $_ := set $subject "kind" "ServiceAccount" -}}
|
||||
{{- $_ := set $subject "namespace" $rootContext.Release.Namespace -}}
|
||||
|
@ -38,7 +41,6 @@ This template serves as a blueprint for generating RoleBinding objects in Kubern
|
|||
{{- $_ := set $role "name" .name -}}
|
||||
{{- $_ := set $role "type" .kind -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
|
@ -48,10 +50,16 @@ kind: {{ . }}
|
|||
metadata:
|
||||
name: {{ $roleBindingObject.name }}
|
||||
{{- with $labels }}
|
||||
labels: {{- toYaml . | nindent 4 -}}
|
||||
labels:
|
||||
{{- range $key, $value := . }}
|
||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with $annotations }}
|
||||
annotations: {{- toYaml . | nindent 4 -}}
|
||||
annotations:
|
||||
{{- range $key, $value := . }}
|
||||
{{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ if eq $roleBindingObject.type "RoleBinding" -}}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
|
|
|
@ -50,6 +50,9 @@ spec:
|
|||
{{- if .sectionName }}
|
||||
sectionName: {{ .sectionName | quote }}
|
||||
{{- end }}
|
||||
{{- if .port }}
|
||||
port: {{ .port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (ne $routeKind "TCPRoute") (ne $routeKind "UDPRoute") $routeObject.hostnames }}
|
||||
hostnames:
|
||||
|
@ -60,33 +63,45 @@ spec:
|
|||
rules:
|
||||
{{- range $routeObject.rules }}
|
||||
- backendRefs:
|
||||
{{- if empty .backendRefs }}
|
||||
{{- printf " []" }}
|
||||
{{- else }}
|
||||
{{- range .backendRefs }}
|
||||
{{ $service := include "bjw-s.common.lib.service.getByIdentifier" (dict "rootContext" $rootContext "id" .name) | fromYaml -}}
|
||||
{{ $servicePrimaryPort := dict -}}
|
||||
{{ if $service -}}
|
||||
{{ $servicePrimaryPort = include "bjw-s.common.lib.service.primaryPort" (dict "rootContext" $rootContext "serviceObject" $service) | fromYaml -}}
|
||||
{{- $service := dict }}
|
||||
{{- $serviceName := "" }}
|
||||
{{- $defaultServicePort := dict }}
|
||||
{{- if .name }}
|
||||
{{- $serviceName = tpl .name $rootContext }}
|
||||
{{- else if .identifier }}
|
||||
{{- $service = (include "bjw-s.common.lib.service.getByIdentifier" (dict "rootContext" $rootContext "id" .identifier) | fromYaml ) }}
|
||||
{{- if not $service }}
|
||||
{{- fail (printf "No enabled Service found with this identifier. (route: '%s', identifier: '%s')" $routeObject.identifier .identifier) }}
|
||||
{{- end }}
|
||||
{{- $serviceName = $service.name }}
|
||||
{{- $defaultServicePort = include "bjw-s.common.lib.service.primaryPort" (dict "rootContext" $rootContext "serviceObject" $service) | fromYaml }}
|
||||
{{- end }}
|
||||
- group: {{ .group | default "" | quote}}
|
||||
kind: {{ .kind | default "Service" }}
|
||||
name: {{ $service.name | default .name }}
|
||||
name: {{ $serviceName }}
|
||||
namespace: {{ .namespace | default $rootContext.Release.Namespace }}
|
||||
port: {{ .port | default $servicePrimaryPort.port }}
|
||||
port: {{ .port | default $defaultServicePort.port }}
|
||||
weight: {{ include "bjw-s.common.lib.defaultKeepNonNullValue" (dict "value" .weight "default" 1) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if or (eq $routeKind "HTTPRoute") (eq $routeKind "GRPCRoute") }}
|
||||
{{- with .matches }}
|
||||
matches:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
matches: {{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .filters }}
|
||||
filters:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
filters: {{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .sessionPersistence }}
|
||||
sessionPersistence: {{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if (eq $routeKind "HTTPRoute") }}
|
||||
{{- with .timeouts }}
|
||||
timeouts:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
timeouts: {{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
@ -114,7 +114,7 @@ spec:
|
|||
{{- end -}}
|
||||
{{- with (merge
|
||||
($serviceObject.extraSelectorLabels | default dict)
|
||||
(dict "app.kubernetes.io/component" $serviceObject.controller)
|
||||
(dict "app.kubernetes.io/controller" $serviceObject.controller)
|
||||
(include "bjw-s.common.lib.metadata.selectorLabels" $rootContext | fromYaml)
|
||||
) }}
|
||||
selector: {{- toYaml . | nindent 4 }}
|
||||
|
|
|
@ -32,6 +32,8 @@ metadata:
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
namespace: {{ $rootContext.Release.Namespace }}
|
||||
{{- if $serviceAccountObject.staticToken }}
|
||||
secrets:
|
||||
- name: {{ get (include "bjw-s.common.lib.secret.getByIdentifier" (dict "rootContext" $rootContext "id" (printf "%s-sa-token" $serviceAccountObject.identifier) ) | fromYaml) "name"}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
|
|
@ -7,7 +7,7 @@ within the common library.
|
|||
{{- $statefulsetObject := .object -}}
|
||||
|
||||
{{- $labels := merge
|
||||
(dict "app.kubernetes.io/component" $statefulsetObject.identifier)
|
||||
(dict "app.kubernetes.io/controller" $statefulsetObject.identifier)
|
||||
($statefulsetObject.labels | default dict)
|
||||
(include "bjw-s.common.lib.metadata.allLabels" $rootContext | fromYaml)
|
||||
-}}
|
||||
|
@ -45,7 +45,7 @@ spec:
|
|||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: {{ $statefulsetObject.identifier }}
|
||||
app.kubernetes.io/controller: {{ $statefulsetObject.identifier }}
|
||||
{{- include "bjw-s.common.lib.metadata.selectorLabels" $rootContext | nindent 6 }}
|
||||
serviceName: {{ include "bjw-s.common.lib.chart.names.fullname" $rootContext }}
|
||||
{{- with (dig "statefulset" "persistentVolumeClaimRetentionPolicy" nil $statefulsetObject) }}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
{{/*
|
||||
Determine a recourse name based on Helm values
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.determineResourceNameFromValues" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
{{- $itemCount := .itemCount -}}
|
||||
|
||||
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- if $objectValues.forceRename -}}
|
||||
{{- $objectName = tpl $objectValues.forceRename $rootContext -}}
|
||||
{{- else -}}
|
||||
{{- if not (empty $objectValues.prefix) -}}
|
||||
{{- $renderedPrefix := (tpl $objectValues.prefix $rootContext) -}}
|
||||
{{- if not (eq $objectName $renderedPrefix) -}}
|
||||
{{- $objectName = printf "%s-%s" $renderedPrefix $objectName -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not (empty $itemCount) -}}
|
||||
{{- if (gt $itemCount 1) -}}
|
||||
{{- if not (hasSuffix (printf "-%s" $identifier) $objectName) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not (empty $objectValues.suffix) -}}
|
||||
{{- $renderedSuffix := (tpl $objectValues.suffix $rootContext) -}}
|
||||
{{- if not (hasSuffix (printf "-%s" $renderedSuffix) $objectName) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $renderedSuffix -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $objectName | lower -}}
|
||||
{{- end -}}
|
|
@ -5,25 +5,12 @@ Convert values to an object
|
|||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
{{- $itemCount := .itemCount -}}
|
||||
|
||||
{{- /* Determine and inject the name */ -}}
|
||||
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- if $objectValues.forceRename -}}
|
||||
{{- $objectName = tpl $objectValues.forceRename $rootContext -}}
|
||||
{{- else if $objectValues.nameOverride -}}
|
||||
{{- $override := tpl $objectValues.nameOverride $rootContext -}}
|
||||
{{- if not (eq $objectName $override) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $override -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if not (eq $objectName $identifier) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $objectName := (include "bjw-s.common.lib.determineResourceNameFromValues" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" $itemCount)) -}}
|
||||
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
{{- /* Return the object */ -}}
|
||||
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
{{/*
|
||||
Return the enabled configMaps.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.configMap.enabledConfigmaps" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledSecrets := dict -}}
|
||||
|
||||
{{- range $identifier, $secret := $rootContext.Values.configMaps -}}
|
||||
{{- if kindIs "map" $secret -}}
|
||||
{{- /* Enable Secret by default, but allow override */ -}}
|
||||
{{- $secretEnabled := true -}}
|
||||
{{- if hasKey $secret "enabled" -}}
|
||||
{{- $secretEnabled = $secret.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $secretEnabled -}}
|
||||
{{- $_ := set $enabledSecrets $identifier . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledSecrets | toYaml -}}
|
||||
{{- end -}}
|
|
@ -4,9 +4,10 @@ Return a configMap Object by its Identifier.
|
|||
{{- define "bjw-s.common.lib.configMap.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledConfigMaps := (include "bjw-s.common.lib.configMap.enabledConfigmaps" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- $configMapValues := dig $identifier nil $rootContext.Values.configMaps -}}
|
||||
{{- if not (empty $configMapValues) -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $configMapValues) -}}
|
||||
{{- if (hasKey $enabledConfigMaps $identifier) -}}
|
||||
{{- $objectValues := get $enabledConfigMaps $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledConfigMaps)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -6,9 +6,10 @@ Validate configMap values
|
|||
{{- $configMapValues := .object -}}
|
||||
{{- $identifier := .id -}}
|
||||
|
||||
{{- if empty $configMapValues -}}
|
||||
{{- if eq (len (without (keys $configMapValues) "name" "identifier")) 0 -}}
|
||||
{{- fail (printf "There was an error loading ConfigMap: %s. If it was automatically generated from a folder verify that files are properly flagged as `binary` or `escaped`" $identifier) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if and (empty (get $configMapValues "data")) (empty (get $configMapValues "binaryData")) -}}
|
||||
{{- fail (printf "No data or binaryData specified for configMap. (configMap: %s)" $configMapValues.identifier) }}
|
||||
{{- end -}}
|
||||
|
|
|
@ -81,20 +81,22 @@ volumeMounts used by the container.
|
|||
|
||||
{{- /* Use the specified subPath if provided */ -}}
|
||||
{{- with .subPath -}}
|
||||
{{- $subPath := . -}}
|
||||
{{- $_ := set $volumeMount "subPath" $subPath -}}
|
||||
{{- $_ := set $volumeMount "subPath" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Use the specified subPathExpr if provided */ -}}
|
||||
{{- with .subPathExpr -}}
|
||||
{{- $_ := set $volumeMount "subPathExpr" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Use the specified readOnly setting if provided */ -}}
|
||||
{{- with .readOnly -}}
|
||||
{{- $readOnly := . -}}
|
||||
{{- $_ := set $volumeMount "readOnly" $readOnly -}}
|
||||
{{- $_ := set $volumeMount "readOnly" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Use the specified mountPropagation setting if provided */ -}}
|
||||
{{- with .mountPropagation -}}
|
||||
{{- $mountPropagation := . -}}
|
||||
{{- $_ := set $volumeMount "mountPropagation" $mountPropagation -}}
|
||||
{{- $_ := set $volumeMount "mountPropagation" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledVolumeMounts = append $enabledVolumeMounts $volumeMount -}}
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
{{/*
|
||||
Return a controller by its identifier.
|
||||
Return a controller object by its Identifier.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.controller.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledControllers := (include "bjw-s.common.lib.controller.enabledControllers" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- $enabledControllers := include "bjw-s.common.lib.controller.enabledControllers" (dict "rootContext" $rootContext) | fromYaml -}}
|
||||
{{- $controllerValues := get $enabledControllers $identifier -}}
|
||||
{{- if (hasKey $enabledControllers $identifier) -}}
|
||||
{{- $objectValues := get $enabledControllers $identifier -}}
|
||||
|
||||
{{- if not (empty $controllerValues) -}}
|
||||
{{- include "bjw-s.common.lib.controller.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $controllerValues) -}}
|
||||
{{- /* Default the controller type to Deployment */ -}}
|
||||
{{- if empty (dig "type" nil $objectValues) -}}
|
||||
{{- $_ := set $objectValues "type" "deployment" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledControllers)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
{{/*
|
||||
Convert controller values to an object
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.controller.valuesToObject" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
|
||||
{{- /* Default the controller type to Deployment */ -}}
|
||||
{{- if empty (dig "type" nil $objectValues) -}}
|
||||
{{- $_ := set $objectValues "type" "deployment" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Determine and inject the controller name */ -}}
|
||||
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- if $objectValues.nameOverride -}}
|
||||
{{- $override := tpl $objectValues.nameOverride $rootContext -}}
|
||||
{{- if not (eq $objectName $override) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $override -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $enabledControllers := (include "bjw-s.common.lib.controller.enabledControllers" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
{{- if gt (len $enabledControllers) 1 -}}
|
||||
{{- if not (eq $objectName $identifier) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- /* Return the controller object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
|
@ -5,6 +5,12 @@ Convert Cronjob values to an object
|
|||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
{{- $itemCount := .itemCount -}}
|
||||
|
||||
{{- $objectName := (include "bjw-s.common.lib.determineResourceNameFromValues" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" $itemCount)) -}}
|
||||
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- if not (hasKey $objectValues "pod") -}}
|
||||
{{- $_ := set $objectValues "pod" dict -}}
|
||||
|
@ -13,6 +19,5 @@ Convert Cronjob values to an object
|
|||
{{- $restartPolicy := default "Never" $objectValues.pod.restartPolicy -}}
|
||||
{{- $_ := set $objectValues.pod "restartPolicy" $restartPolicy -}}
|
||||
|
||||
{{- /* Return the CronJob object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
{{/*
|
||||
Return an Ingress Object by its Identifier.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.ingress.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
|
||||
{{- $enabledServices := (include "bjw-s.common.lib.service.enabledServices" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- $enabledIngresses := (include "bjw-s.common.lib.ingress.enabledIngresses" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- if (hasKey $enabledIngresses $identifier) -}}
|
||||
{{- $objectValues := get $enabledIngresses $identifier -}}
|
||||
{{- $object := include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledIngresses)) | fromYaml -}}
|
||||
|
||||
{{- /* Try to automatically determine the default Service identifier if needed and possible */ -}}
|
||||
{{- if eq 1 (len $enabledServices) -}}
|
||||
{{- range $object.hosts -}}
|
||||
{{- range .paths -}}
|
||||
{{- if not (has "service" (keys .)) -}}
|
||||
{{- $_ := set . "service" (dict "identifier" ($enabledServices | keys | first)) -}}
|
||||
{{- else if and (not .service.name) (not .service.identifier) -}}
|
||||
{{- $_ := set .service "identifier" ($enabledServices | keys | first) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $object | toYaml -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -3,5 +3,21 @@ Validate Ingress values
|
|||
*/}}
|
||||
{{- define "bjw-s.common.lib.ingress.validate" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $ingressValues := .object -}}
|
||||
{{- $ingressObject := .object -}}
|
||||
|
||||
{{- $enabledServices := (include "bjw-s.common.lib.service.enabledServices" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
|
||||
{{/* Verify automatic service detection */}}
|
||||
{{- if not (eq 1 (len $enabledServices)) -}}
|
||||
{{- range $ingressObject.hosts -}}
|
||||
{{- $host := . -}}
|
||||
{{- range $host.paths -}}
|
||||
{{- $path := . -}}
|
||||
{{- if or (not (has "service" (keys .))) (and (not $path.service.name) (not $path.service.identifier)) -}}
|
||||
{{- fail (printf "Either service.name or service.identifier is required because automatic Service detection is not possible. (ingress: %s, host: %s, path: %s)" $ingressObject.identifier $host.host $path.path ) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
{{/*
|
||||
Convert ingress values to an object
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.ingress.valuesToObject" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
|
||||
{{- /* Determine and inject the ingress name */ -}}
|
||||
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- if $objectValues.nameOverride -}}
|
||||
{{- $override := tpl $objectValues.nameOverride $rootContext -}}
|
||||
{{- if not (eq $objectName $override) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $override -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $enabledIngresses := (include "bjw-s.common.lib.ingress.enabledIngresses" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
{{- if gt (len $enabledIngresses) 1 -}}
|
||||
{{- if not (eq $objectName $identifier) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- /* Return the ingress object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
|
@ -1,7 +1,7 @@
|
|||
{{/*
|
||||
Return the enabled NetworkPolicies.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.networkPolicy.enabledNetworkPolicies" -}}
|
||||
{{- define "bjw-s.common.lib.networkpolicy.enabledNetworkPolicies" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledNetworkPolicies := dict -}}
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{{/*
|
||||
Return a NetworkPolicy object by its Identifier.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.networkpolicy.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledNetworkPolicies := (include "bjw-s.common.lib.networkpolicy.enabledNetworkPolicies" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- if (hasKey $enabledNetworkPolicies $identifier) -}}
|
||||
{{- $objectValues := get $enabledNetworkPolicies $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledNetworkPolicies)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -1,30 +0,0 @@
|
|||
{{/*
|
||||
Convert networkPolicy values to an object
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.networkpolicy.valuesToObject" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
|
||||
{{- /* Determine and inject the networkPolicy name */ -}}
|
||||
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- if $objectValues.nameOverride -}}
|
||||
{{- $override := tpl $objectValues.nameOverride $rootContext -}}
|
||||
{{- if not (eq $objectName $override) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $override -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $enabledNetworkPolicies := (include "bjw-s.common.lib.networkPolicy.enabledNetworkPolicies" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
{{- if gt (len $enabledNetworkPolicies) 1 -}}
|
||||
{{- if not (eq $objectName $identifier) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- /* Return the networkPolicy object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
|
@ -6,9 +6,10 @@ Returns the value for the specified field
|
|||
{{- $controllerObject := .ctx.controllerObject -}}
|
||||
{{- $option := .option -}}
|
||||
{{- $default := default "" .default -}}
|
||||
|
||||
{{- $value := $default -}}
|
||||
|
||||
{{- $defaultPodOptionsStrategy := dig "defaultPodOptionsStrategy" "overwrite" $rootContext.Values -}}
|
||||
|
||||
{{- /* Set to the default if it is set */ -}}
|
||||
{{- $defaultOption := dig $option nil (default dict $rootContext.Values.defaultPodOptions) -}}
|
||||
{{- if kindIs "bool" $defaultOption -}}
|
||||
|
@ -19,8 +20,15 @@ Returns the value for the specified field
|
|||
|
||||
{{- /* See if a pod-specific override is needed */ -}}
|
||||
{{- $podOption := dig $option nil (default dict $controllerObject.pod) -}}
|
||||
|
||||
{{- if kindIs "bool" $podOption -}}
|
||||
{{- $value = $podOption -}}
|
||||
{{- else if kindIs "map" $podOption -}}
|
||||
{{- if eq "merge" $defaultPodOptionsStrategy -}}
|
||||
{{- $value = merge $podOption $value -}}
|
||||
{{- else if eq "overwrite" $defaultPodOptionsStrategy -}}
|
||||
{{- $value = $podOption -}}
|
||||
{{- end -}}
|
||||
{{- else if not (empty $podOption) -}}
|
||||
{{- $value = $podOption -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -48,6 +48,11 @@ imagePullSecrets: {{ . | nindent 2 }}
|
|||
{{- with (include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "terminationGracePeriodSeconds")) }}
|
||||
terminationGracePeriodSeconds: {{ . | trim }}
|
||||
{{- end -}}
|
||||
{{- if ge ($rootContext.Capabilities.KubeVersion.Minor | int) 32 }}
|
||||
{{- with (include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "resources")) }}
|
||||
resources: {{ . | nindent 2 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- with (include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "restartPolicy")) }}
|
||||
restartPolicy: {{ . | trim }}
|
||||
{{- end -}}
|
||||
|
|
|
@ -4,24 +4,20 @@ Returns the value for serviceAccountName
|
|||
{{- define "bjw-s.common.lib.pod.field.serviceAccountName" -}}
|
||||
{{- $rootContext := .ctx.rootContext -}}
|
||||
{{- $controllerObject := .ctx.controllerObject -}}
|
||||
|
||||
{{- $serviceAccountName := "default" -}}
|
||||
|
||||
{{- if $rootContext.Values.enforceServiceAccountCreation -}}
|
||||
{{- if (get (include "bjw-s.common.lib.serviceAccount.getByIdentifier" (dict "rootContext" $rootContext "id" "default") | fromYaml) "create") -}}
|
||||
{{- $serviceAccountName = get (include "bjw-s.common.lib.serviceAccount.getByIdentifier" (dict "rootContext" $rootContext "id" "default") | fromYaml) "name" -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $serviceAccountName = get (include "bjw-s.common.lib.serviceAccount.getByIdentifier" (dict "rootContext" $rootContext "id" "default") | fromYaml) "name" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with $controllerObject.serviceAccount -}}
|
||||
{{- if hasKey . "identifier" -}}
|
||||
{{- $serviceAccountName = get (include "bjw-s.common.lib.serviceAccount.getByIdentifier" (dict "rootContext" $rootContext "id" .identifier) | fromYaml) "name" -}}
|
||||
{{- $subject := (include "bjw-s.common.lib.serviceAccount.getByIdentifier" (dict "rootContext" $rootContext "id" .identifier) | fromYaml) -}}
|
||||
|
||||
{{- if not $subject }}
|
||||
{{- fail (printf "No enabled ServiceAccount found with this identifier. (controller: '%s', identifier: '%s')" $controllerObject.identifier .identifier) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $serviceAccountName = get $subject "name" -}}
|
||||
{{- else if hasKey . "name" -}}
|
||||
{{- $serviceAccountName = .name -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $serviceAccountName -}}
|
||||
|
||||
{{- end -}}
|
||||
|
|
|
@ -46,15 +46,8 @@ Returns the value for volumes
|
|||
{{- $pvcName = $persistenceValues.existingClaim -}}
|
||||
{{- else -}}
|
||||
{{- /* Otherwise refer to the PVC name */ -}}
|
||||
{{- if $persistenceValues.nameOverride -}}
|
||||
{{- if not (eq $persistenceValues.nameOverride "-") -}}
|
||||
{{- $pvcName = (printf "%s-%s" (include "bjw-s.common.lib.chart.names.fullname" $rootContext) $persistenceValues.nameOverride) -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if not (eq $pvcName $identifier) -}}
|
||||
{{- $pvcName = (printf "%s-%s" (include "bjw-s.common.lib.chart.names.fullname" $rootContext) $identifier) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $object := (include "bjw-s.common.lib.pvc.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
{{- $pvcName = get $object "name" -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $volume "persistentVolumeClaim" (dict "claimName" $pvcName) -}}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ Returns the value for labels
|
|||
|
||||
{{- /* Default labels */ -}}
|
||||
{{- $labels := merge
|
||||
(dict "app.kubernetes.io/component" $controllerObject.identifier)
|
||||
(dict "app.kubernetes.io/controller" $controllerObject.identifier)
|
||||
-}}
|
||||
|
||||
{{- /* Include global labels if specified */ -}}
|
||||
|
|
23
charts/library/common/templates/lib/pvc/_enabled_pvcs.tpl
Normal file
23
charts/library/common/templates/lib/pvc/_enabled_pvcs.tpl
Normal file
|
@ -0,0 +1,23 @@
|
|||
{{/*
|
||||
Return the enabled PVCs.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.pvc.enabledPVCs" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledPVCs := dict -}}
|
||||
|
||||
{{- range $identifier, $persistenceItem := $rootContext.Values.persistence -}}
|
||||
{{- if kindIs "map" $persistenceItem -}}
|
||||
{{- /* Enable PVC by default, but allow override */ -}}
|
||||
{{- $pvcEnabled := true -}}
|
||||
{{- if hasKey $persistenceItem "enabled" -}}
|
||||
{{- $pvcEnabled = $persistenceItem.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if and $pvcEnabled (eq (default "persistentVolumeClaim" $persistenceItem.type) "persistentVolumeClaim") (not $persistenceItem.existingClaim) -}}
|
||||
{{- $_ := set $enabledPVCs $identifier . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledPVCs | toYaml -}}
|
||||
{{- end -}}
|
23
charts/library/common/templates/lib/pvc/_enabled_roles.tpl
Normal file
23
charts/library/common/templates/lib/pvc/_enabled_roles.tpl
Normal file
|
@ -0,0 +1,23 @@
|
|||
{{/*
|
||||
Return the enabled roles.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.rbac.role.enabledRoles" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledRoles := dict -}}
|
||||
|
||||
{{- range $name, $role := $rootContext.Values.rbac.roles -}}
|
||||
{{- if kindIs "map" $role -}}
|
||||
{{- /* Enable Role by default, but allow override */ -}}
|
||||
{{- $roleEnabled := true -}}
|
||||
{{- if hasKey $role "enabled" -}}
|
||||
{{- $roleEnabled = $role.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $roleEnabled -}}
|
||||
{{- $_ := set $enabledRoles $name . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledRoles | toYaml -}}
|
||||
{{- end -}}
|
13
charts/library/common/templates/lib/pvc/_getByIdentifier.tpl
Normal file
13
charts/library/common/templates/lib/pvc/_getByIdentifier.tpl
Normal file
|
@ -0,0 +1,13 @@
|
|||
{{/*
|
||||
Return a PVC object by its Identifier.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.pvc.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledPVCs := (include "bjw-s.common.lib.pvc.enabledPVCs" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- if (hasKey $enabledPVCs $identifier) -}}
|
||||
{{- $objectValues := get $enabledPVCs $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledPVCs)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -1,7 +0,0 @@
|
|||
{{/*
|
||||
Validate PVC values
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.pvc.validate" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $pvcObject := .object -}}
|
||||
{{- end -}}
|
|
@ -1,26 +0,0 @@
|
|||
{{/*
|
||||
Convert PVC values to an object
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.pvc.valuesToObject" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
|
||||
{{- /* Determine and inject the PVC name */ -}}
|
||||
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- if $objectValues.nameOverride -}}
|
||||
{{- if ne $objectValues.nameOverride "-" -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if not (eq $objectName $identifier) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- /* Return the PVC object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
|
@ -0,0 +1,23 @@
|
|||
{{/*
|
||||
Return the enabled raw resources.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.rawResource.enabledRawResources" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledRawResources := dict -}}
|
||||
|
||||
{{- range $name, $resource := $rootContext.Values.rawResources -}}
|
||||
{{- if kindIs "map" $resource -}}
|
||||
{{- /* Enable Raw Resource by default, but allow override */ -}}
|
||||
{{- $resourceEnabled := true -}}
|
||||
{{- if hasKey $resource "enabled" -}}
|
||||
{{- $resourceEnabled = $resource.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $resourceEnabled -}}
|
||||
{{- $_ := set $enabledRawResources $name . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledRawResources | toYaml -}}
|
||||
{{- end -}}
|
|
@ -0,0 +1,13 @@
|
|||
{{/*
|
||||
Return a RawResource Object by its Identifier.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.rawResource.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledRawResources := (include "bjw-s.common.lib.rawResource.enabledRawResources" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- if (hasKey $enabledRawResources $identifier) -}}
|
||||
{{- $objectValues := get $enabledRawResources $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledRawResources)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -1,7 +0,0 @@
|
|||
{{/*
|
||||
Validate raw resource values
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.rawResource.validate" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $resourceObject := .object -}}
|
||||
{{- end -}}
|
23
charts/library/common/templates/lib/role/_enabled_roles.tpl
Normal file
23
charts/library/common/templates/lib/role/_enabled_roles.tpl
Normal file
|
@ -0,0 +1,23 @@
|
|||
{{/*
|
||||
Return the enabled roles.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.rbac.role.enabledRoles" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledRoles := dict -}}
|
||||
|
||||
{{- range $name, $role := $rootContext.Values.rbac.roles -}}
|
||||
{{- if kindIs "map" $role -}}
|
||||
{{- /* Enable Role by default, but allow override */ -}}
|
||||
{{- $roleEnabled := true -}}
|
||||
{{- if hasKey $role "enabled" -}}
|
||||
{{- $roleEnabled = $role.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $roleEnabled -}}
|
||||
{{- $_ := set $enabledRoles $name . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledRoles | toYaml -}}
|
||||
{{- end -}}
|
|
@ -4,9 +4,10 @@ Return a Role Object by its Identifier.
|
|||
{{- define "bjw-s.common.lib.rbac.role.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledRoles := (include "bjw-s.common.lib.rbac.role.enabledRoles" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- $roleValues := dig $identifier nil $rootContext.Values.rbac.roles -}}
|
||||
{{- if not (empty $roleValues) -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $roleValues) -}}
|
||||
{{- if (hasKey $enabledRoles $identifier) -}}
|
||||
{{- $objectValues := get $enabledRoles $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledRoles)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -4,15 +4,9 @@ Validate Role values
|
|||
{{- define "bjw-s.common.lib.rbac.role.validate" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $roleValues := .object -}}
|
||||
{{- $type := required "The role needs to have an explicitly declared type" $roleValues.type -}}
|
||||
{{- $typeList := list "Role" "ClusterRole" -}}
|
||||
{{- $rules := $roleValues.rules -}}
|
||||
|
||||
{{- if not (mustHas $type $typeList) -}}
|
||||
{{- fail (printf "\nYou selected: `%s`. Type must be one of:\n%s\n" $type ($typeList|toYaml)) -}}
|
||||
{{- end -}}
|
||||
{{- if not $rules -}}
|
||||
{{- fail "Rules can't be empty" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
{{/*
|
||||
Return the enabled RoleBindings.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.rbac.roleBinding.enabledRoleBindings" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledRoleBindings := dict -}}
|
||||
|
||||
{{- range $name, $role := $rootContext.Values.rbac.bindings -}}
|
||||
{{- if kindIs "map" $role -}}
|
||||
{{- /* Enable Role by default, but allow override */ -}}
|
||||
{{- $roleEnabled := true -}}
|
||||
{{- if hasKey $role "enabled" -}}
|
||||
{{- $roleEnabled = $role.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $roleEnabled -}}
|
||||
{{- $_ := set $enabledRoleBindings $name . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledRoleBindings | toYaml -}}
|
||||
{{- end -}}
|
|
@ -4,9 +4,10 @@ Return a RoleBinding Object by its Identifier.
|
|||
{{- define "bjw-s.common.lib.rbac.roleBinding.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledRoleBindings := (include "bjw-s.common.lib.rbac.roleBinding.enabledRoleBindings" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- $roleBindingValues := dig $identifier nil $rootContext.Values.rbac.bindings -}}
|
||||
{{- if not (empty $roleBindingValues) -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $roleBindingValues) -}}
|
||||
{{- if (hasKey $enabledRoleBindings $identifier) -}}
|
||||
{{- $objectValues := get $enabledRoleBindings $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledRoleBindings)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
{{/*
|
||||
Validate RoleBinding values
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.rbac.roleBinding.validate" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $roleBindingValues := .object -}}
|
||||
{{- $type := required "The binding needs to have an explicitly declared type" $roleBindingValues.type -}}
|
||||
{{- $typeList := list "RoleBinding" "ClusterRoleBinding" -}}
|
||||
{{- $subjects := $roleBindingValues.subjects -}}
|
||||
{{- $roleRef := required "A roleRef is required" $roleBindingValues.roleRef -}}
|
||||
|
||||
{{- if not (mustHas $type $typeList) -}}
|
||||
{{- fail (printf "\nYou selected: `%s`. Type must be one of:\n%s\n" $type ($typeList|toYaml)) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if not (hasKey $roleRef "identifier") -}}
|
||||
{{- $name := required "If not using identifier roleRef must have a `name` key" $roleRef.name -}}
|
||||
{{- $name := required "If not using identifier roleRef must have a `kind` key" $roleRef.kind -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range $subject := $subjects -}}
|
||||
{{- if not (hasKey . "identifier") -}}
|
||||
{{- if not (hasKey . "name") -}}
|
||||
{{- $name := required "If not using identifier a subject must have a `name` key" .name -}}
|
||||
{{- else if not (hasKey . "namespace") -}}
|
||||
{{- $namespace := required "If not using identifier a subject must have a `namespace` key" .namespace -}}
|
||||
{{- else if not (hasKey . "kind") -}}
|
||||
{{- $kind := required "If not using identifier a subject must have a `kind` key" .kind -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -0,0 +1,13 @@
|
|||
{{/*
|
||||
Return a Route object by its Identifier.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.route.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledRoutes := (include "bjw-s.common.lib.route.enabledRoutes" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- if (hasKey $enabledRoutes $identifier) -}}
|
||||
{{- $objectValues := get $enabledRoutes $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledRoutes)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -1,30 +0,0 @@
|
|||
{{/*
|
||||
Convert Route values to an object
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.route.valuesToObject" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
|
||||
{{- /* Determine and inject the Route name */ -}}
|
||||
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- if $objectValues.nameOverride -}}
|
||||
{{- $override := tpl $objectValues.nameOverride $rootContext -}}
|
||||
{{- if not (eq $objectName $override) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $override -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $enabledRoutes := (include "bjw-s.common.lib.route.enabledRoutes" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
{{- if and (not $objectValues.primary) (gt (len $enabledRoutes) 1) -}}
|
||||
{{- if not (eq $objectName $identifier) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- /* Return the Route object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
|
@ -0,0 +1,23 @@
|
|||
{{/*
|
||||
Return the enabled secrets.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.secret.enabledSecrets" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledSecrets := dict -}}
|
||||
|
||||
{{- range $identifier, $secret := $rootContext.Values.secrets -}}
|
||||
{{- if kindIs "map" $secret -}}
|
||||
{{- /* Enable Secret by default, but allow override */ -}}
|
||||
{{- $secretEnabled := true -}}
|
||||
{{- if hasKey $secret "enabled" -}}
|
||||
{{- $secretEnabled = $secret.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $secretEnabled -}}
|
||||
{{- $_ := set $enabledSecrets $identifier . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledSecrets | toYaml -}}
|
||||
{{- end -}}
|
|
@ -4,9 +4,10 @@ Return a secret Object by its Identifier.
|
|||
{{- define "bjw-s.common.lib.secret.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledSecrets := (include "bjw-s.common.lib.secret.enabledSecrets" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- $secretValues := dig $identifier nil $rootContext.Values.secrets -}}
|
||||
{{- if not (empty $secretValues) -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $secretValues) -}}
|
||||
{{- if (hasKey $enabledSecrets $identifier) -}}
|
||||
{{- $objectValues := get $enabledSecrets $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledSecrets)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
{{/*
|
||||
Validate Secret values
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.secret.validate" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $secretValues := .object -}}
|
||||
{{- end -}}
|
|
@ -14,6 +14,8 @@ Return the enabled services.
|
|||
{{- end -}}
|
||||
|
||||
{{- if $serviceEnabled -}}
|
||||
|
||||
|
||||
{{- $_ := set $enabledServices $name . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -4,10 +4,19 @@ Return a service Object by its Identifier.
|
|||
{{- define "bjw-s.common.lib.service.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledServices := (include "bjw-s.common.lib.service.enabledServices" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
{{- $enabledControllers := (include "bjw-s.common.lib.controller.enabledControllers" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
|
||||
{{- range $name, $serviceValues := $rootContext.Values.service -}}
|
||||
{{- if eq $name $identifier -}}
|
||||
{{- include "bjw-s.common.lib.service.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $serviceValues) -}}
|
||||
{{- if (hasKey $enabledServices $identifier) -}}
|
||||
{{- $objectValues := get $enabledServices $identifier -}}
|
||||
{{- $object := include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledServices)) | fromYaml -}}
|
||||
|
||||
{{- if eq 1 (len $enabledControllers) -}}
|
||||
{{- if (empty (dig "controller" nil $object)) -}}
|
||||
{{- $_ := set $object "controller" ($enabledControllers | keys | first) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $object | toYaml -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -5,7 +5,7 @@ Return the primary service object for a controller
|
|||
{{- $rootContext := .rootContext -}}
|
||||
{{- $controllerIdentifier := .controllerIdentifier -}}
|
||||
|
||||
{{- $identifier := "" -}}
|
||||
{{- $serviceIdentifier := "" -}}
|
||||
{{- $result := dict -}}
|
||||
|
||||
{{- /* Loop over all enabled services */ -}}
|
||||
|
@ -13,27 +13,29 @@ Return the primary service object for a controller
|
|||
{{- if $enabledServices -}}
|
||||
{{- /* We are only interested in services for the specified controller */ -}}
|
||||
{{- $enabledServicesForController := dict -}}
|
||||
{{- range $name, $service := $enabledServices -}}
|
||||
{{- if eq $service.controller $controllerIdentifier -}}
|
||||
{{- $_ := set $enabledServicesForController $name $service -}}
|
||||
{{- range $identifier, $serviceObject := $enabledServices -}}
|
||||
{{- if eq $serviceObject.controller $controllerIdentifier -}}
|
||||
{{- $_ := set $enabledServicesForController $identifier $serviceObject -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range $name, $service := $enabledServicesForController -}}
|
||||
{{- range $identifier, $serviceObject := $enabledServicesForController -}}
|
||||
{{- /* Determine the Service that has been marked as primary */ -}}
|
||||
{{- if $service.primary -}}
|
||||
{{- $identifier = $name -}}
|
||||
{{- $result = $service -}}
|
||||
{{- if $serviceObject.primary -}}
|
||||
{{- $serviceIdentifier = $identifier -}}
|
||||
{{- $result = $serviceObject -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Return the first Service (alphabetically) if none has been explicitly marked as primary */ -}}
|
||||
{{- if not $result -}}
|
||||
{{- $firstServiceKey := keys $enabledServicesForController | sortAlpha | first -}}
|
||||
{{- $result = get $enabledServicesForController $firstServiceKey -}}
|
||||
{{- $identifier = $result.identifier -}}
|
||||
{{- $serviceIdentifier = $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- include "bjw-s.common.lib.service.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $result) -}}
|
||||
{{- if not (empty $serviceIdentifier) -}}
|
||||
{{- include "bjw-s.common.lib.service.getByIdentifier" (dict "rootContext" $rootContext "id" $serviceIdentifier) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -5,6 +5,15 @@ Validate Service values
|
|||
{{- $rootContext := .rootContext -}}
|
||||
{{- $serviceObject := .object -}}
|
||||
|
||||
{{- $enabledControllers := (include "bjw-s.common.lib.controller.enabledControllers" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
|
||||
{{/* Verify automatic controller detection */}}
|
||||
{{- if not (eq 1 (len $enabledControllers)) -}}
|
||||
{{- if or (not (has "controller" (keys $serviceObject))) (empty (get $serviceObject "controller")) -}}
|
||||
{{- fail (printf "controller field is required because automatic controller detection is not possible. (service: %s)" $serviceObject.identifier ) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if empty (get $serviceObject "controller") -}}
|
||||
{{- fail (printf "controller field is required for Service. (service: %s)" $serviceObject.identifier) -}}
|
||||
{{- end -}}
|
||||
|
@ -29,13 +38,13 @@ Validate Service values
|
|||
{{- $enabledPorts := include "bjw-s.common.lib.service.enabledPorts" (dict "rootContext" $rootContext "serviceObject" $serviceObject) | fromYaml }}
|
||||
{{- /* Validate at least one port is enabled */ -}}
|
||||
{{- if not $enabledPorts -}}
|
||||
{{- fail (printf "no ports are enabled for Service with key \"%s\"" $serviceObject.identifier) -}}
|
||||
{{- fail (printf "No ports are enabled for Service with this identifier. (service: '%s')" $serviceObject.identifier) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range $name, $port := $enabledPorts -}}
|
||||
{{- /* Validate a port number is configured */ -}}
|
||||
{{- if not $port.port -}}
|
||||
{{- fail (printf "no port number is configured for port \"%s\" under Service with key \"%s\"" $name $serviceObject.identifier) -}}
|
||||
{{- fail (printf "No port number is configured for this port. (port: '%s', service: '%s')" $name $serviceObject.identifier) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
{{/*
|
||||
Convert Service values to an object
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.service.valuesToObject" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
|
||||
{{- /* Determine and inject the Service name */ -}}
|
||||
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- if $objectValues.nameOverride -}}
|
||||
{{- $override := tpl $objectValues.nameOverride $rootContext -}}
|
||||
{{- if not (eq $objectName $override) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $override -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $enabledServices := (include "bjw-s.common.lib.service.enabledServices" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
{{- if and (not $objectValues.primary) (gt (len $enabledServices) 1) -}}
|
||||
{{- if not (eq $objectName $identifier) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- /* Return the Service object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
|
@ -0,0 +1,23 @@
|
|||
{{/*
|
||||
Return the enabled serviceAccounts.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.serviceAccount.enabledServiceAccounts" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledServiceAccounts := dict -}}
|
||||
|
||||
{{- range $identifier, $serviceAccount := $rootContext.Values.serviceAccount -}}
|
||||
{{- if kindIs "map" $serviceAccount -}}
|
||||
{{- /* Enable Service by default, but allow override */ -}}
|
||||
{{- $serviceAccountEnabled := true -}}
|
||||
{{- if hasKey $serviceAccount "enabled" -}}
|
||||
{{- $serviceAccountEnabled = $serviceAccount.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $serviceAccountEnabled -}}
|
||||
{{- $_ := set $enabledServiceAccounts $identifier . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledServiceAccounts | toYaml -}}
|
||||
{{- end -}}
|
|
@ -4,18 +4,10 @@ Return a ServiceAccount Object by its Identifier.
|
|||
{{- define "bjw-s.common.lib.serviceAccount.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- if eq $identifier "default" -}}
|
||||
{{- $serviceAccount := deepCopy $rootContext.Values.serviceAccount -}}
|
||||
{{- if and (eq ($serviceAccount.name) "") (not $serviceAccount.create ) -}}
|
||||
{{- $_ := set $serviceAccount "name" "default" -}}
|
||||
{{- end -}}
|
||||
{{- include "bjw-s.common.lib.serviceAccount.valuesToObject" (dict "rootContext" $rootContext "id" "default" "values" $serviceAccount) -}}
|
||||
{{- else -}}
|
||||
{{- $serviceAccountValues := dig "extraServiceAccounts" $identifier nil $rootContext.Values.serviceAccount -}}
|
||||
{{- if not (empty $serviceAccountValues) -}}
|
||||
{{- include "bjw-s.common.lib.serviceAccount.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $serviceAccountValues) -}}
|
||||
{{- else -}}
|
||||
{{- fail (printf "No ServiceAccount configured with identifier: %s" $identifier) -}}
|
||||
{{- end -}}
|
||||
{{- $enabledServiceAccounts := (include "bjw-s.common.lib.serviceAccount.enabledServiceAccounts" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- if (hasKey $enabledServiceAccounts $identifier) -}}
|
||||
{{- $objectValues := get $enabledServiceAccounts $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledServiceAccounts)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
{{/*
|
||||
Convert ServiceAccount values to an object
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.serviceAccount.valuesToObject" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
|
||||
{{- /* Determine and inject the serviceAccount name */ -}}
|
||||
{{- $defaultServiceAccountName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- $objectName := $defaultServiceAccountName -}}
|
||||
|
||||
{{- with $objectValues.name -}}
|
||||
{{- $objectName = . -}}
|
||||
{{- end -}}
|
||||
{{- if and (ne $identifier "default") (not $objectValues.name) -}}
|
||||
{{- $objectName = printf "%s-%s" $defaultServiceAccountName $identifier -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
{{- /* Return the serviceAccount object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
|
@ -1,20 +1,20 @@
|
|||
{{/*
|
||||
Return the enabled ServiceMonitors.
|
||||
Return the enabled serviceMonitors.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.serviceMonitor.enabledServiceMonitors" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledServiceMonitors := dict -}}
|
||||
|
||||
{{- range $name, $serviceMonitor := $rootContext.Values.serviceMonitor -}}
|
||||
{{- range $identifier, $serviceMonitor := $rootContext.Values.serviceMonitor -}}
|
||||
{{- if kindIs "map" $serviceMonitor -}}
|
||||
{{- /* Enable by default, but allow override */ -}}
|
||||
{{- /* Enable Service by default, but allow override */ -}}
|
||||
{{- $serviceMonitorEnabled := true -}}
|
||||
{{- if hasKey $serviceMonitor "enabled" -}}
|
||||
{{- $serviceMonitorEnabled = $serviceMonitor.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $serviceMonitorEnabled -}}
|
||||
{{- $_ := set $enabledServiceMonitors $name . -}}
|
||||
{{- $_ := set $enabledServiceMonitors $identifier . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
{{/*
|
||||
Return a ServiceMonitor Object by its Identifier.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.serviceMonitor.getByIdentifier" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $enabledServiceMonitors := (include "bjw-s.common.lib.serviceMonitor.enabledServiceMonitors" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
|
||||
{{- if (hasKey $enabledServiceMonitors $identifier) -}}
|
||||
{{- $objectValues := get $enabledServiceMonitors $identifier -}}
|
||||
{{- include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" (len $enabledServiceMonitors)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -1,30 +0,0 @@
|
|||
{{/*
|
||||
Convert ServiceMonitor values to an object
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.serviceMonitor.valuesToObject" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
|
||||
{{- /* Determine and inject the ServiceMonitor name */ -}}
|
||||
{{- $objectName := (include "bjw-s.common.lib.chart.names.fullname" $rootContext) -}}
|
||||
|
||||
{{- if $objectValues.nameOverride -}}
|
||||
{{- $override := tpl $objectValues.nameOverride $rootContext -}}
|
||||
{{- if not (eq $objectName $override) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $override -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $enabledServiceMonitors := (include "bjw-s.common.lib.serviceMonitor.enabledServiceMonitors" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
{{- if gt (len $enabledServiceMonitors) 1 -}}
|
||||
{{- if not (eq $objectName $identifier) -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- /* Return the ServiceMonitor object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
|
@ -5,10 +5,15 @@ Convert StatefulSet values to an object
|
|||
{{- $rootContext := .rootContext -}}
|
||||
{{- $identifier := .id -}}
|
||||
{{- $objectValues := .values -}}
|
||||
{{- $itemCount := .itemCount -}}
|
||||
|
||||
{{- $objectName := (include "bjw-s.common.lib.determineResourceNameFromValues" (dict "rootContext" $rootContext "id" $identifier "values" $objectValues "itemCount" $itemCount)) -}}
|
||||
|
||||
{{- $_ := set $objectValues "name" $objectName -}}
|
||||
{{- $_ := set $objectValues "identifier" $identifier -}}
|
||||
|
||||
{{- $strategy := default "RollingUpdate" $objectValues.strategy -}}
|
||||
{{- $_ := set $objectValues "strategy" $strategy -}}
|
||||
|
||||
{{- /* Return the StatefulSet object */ -}}
|
||||
{{- $objectValues | toYaml -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -2,21 +2,23 @@
|
|||
Secondary entrypoint and primary loader for the common chart
|
||||
*/}}
|
||||
{{- define "bjw-s.common.loader.generate" -}}
|
||||
{{- $rootContext := $ -}}
|
||||
|
||||
{{- /* Run global chart validations */ -}}
|
||||
{{- include "bjw-s.common.lib.chart.validate" . -}}
|
||||
{{- include "bjw-s.common.lib.chart.validate" $rootContext -}}
|
||||
|
||||
{{- /* Build the templates */ -}}
|
||||
{{- include "bjw-s.common.render.pvcs" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.serviceAccount" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.configMaps.fromFolder" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.configMaps" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.controllers" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.services" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.ingresses" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.serviceMonitors" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.routes" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.secrets" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.networkpolicies" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.rawResources" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.rbac" . | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.pvcs" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.serviceAccount" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.configMaps.fromFolder" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.configMaps" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.controllers" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.services" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.ingresses" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.serviceMonitors" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.routes" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.secrets" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.networkpolicies" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.rawResources" $rootContext | nindent 0 -}}
|
||||
{{- include "bjw-s.common.render.rbac" $rootContext | nindent 0 -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -4,25 +4,18 @@ Renders the configMap objects required by the chart.
|
|||
{{- define "bjw-s.common.render.configMaps" -}}
|
||||
{{- $rootContext := $ -}}
|
||||
|
||||
{{- /* Generate named configMaps as required */ -}}
|
||||
{{- range $key, $configMap := .Values.configMaps }}
|
||||
{{- /* Enable configMap by default, but allow override */ -}}
|
||||
{{- $configMapEnabled := true -}}
|
||||
{{- if hasKey $configMap "enabled" -}}
|
||||
{{- $configMapEnabled = $configMap.enabled -}}
|
||||
{{- end -}}
|
||||
{{- /* Generate configMaps as required */ -}}
|
||||
{{- $enabledConfigMaps := (include "bjw-s.common.lib.configMap.enabledConfigmaps" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
|
||||
{{- if $configMapEnabled -}}
|
||||
{{- $configMapValues := (mustDeepCopy $configMap) -}}
|
||||
{{- range $identifier := keys $enabledConfigMaps -}}
|
||||
{{- /* Generate object from the raw configMap values */ -}}
|
||||
{{- $configMapObject := (include "bjw-s.common.lib.configMap.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- /* Create object from the raw configMap values */ -}}
|
||||
{{- $configMapObject := (include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $configMapValues)) | fromYaml -}}
|
||||
{{- /* Perform validations on the configMap before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.configMap.validate" (dict "rootContext" $ "object" $configMapObject "id" $key) -}}
|
||||
{{- include "bjw-s.common.lib.configMap.validate" (dict "rootContext" $rootContext "object" $configMapObject "id" $identifier) -}}
|
||||
|
||||
{{/* Include the configMap class */}}
|
||||
{{- include "bjw-s.common.class.configMap" (dict "rootContext" $ "object" $configMapObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- include "bjw-s.common.class.configMap" (dict "rootContext" $rootContext "object" $configMapObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
@ -30,23 +23,26 @@ Renders the configMap objects required by the chart.
|
|||
Renders configMap objects required by the chart from a folder in the repo's path.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.render.configMaps.fromFolder" -}}
|
||||
{{- $rootContext := $ -}}
|
||||
|
||||
{{- $valuesCopy := .Values -}}
|
||||
{{- $configMapsFromFolder := .Values.configMapsFromFolder | default dict -}}
|
||||
{{- $valuesCopy := $rootContext.Values -}}
|
||||
{{- $configMapsFromFolder := $rootContext.Values.configMapsFromFolder | default dict -}}
|
||||
{{- $configMapsFromFolderEnabled := dig "enabled" false $configMapsFromFolder -}}
|
||||
|
||||
{{- if $configMapsFromFolderEnabled -}}
|
||||
{{- /* Perform validations before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.configMap.fromFolder.validate" (dict "rootContext" $ "basePath" $configMapsFromFolder.basePath) -}}
|
||||
{{- $basePath := $configMapsFromFolder.basePath -}}
|
||||
|
||||
{{/* Generate a list of unique top level folders */}}
|
||||
{{ $topLevelFolders := dict}}
|
||||
{{- $basePath := $configMapsFromFolder.basePath -}}
|
||||
{{- $topLevelFolders := dict -}}
|
||||
{{- range $path, $_ := .Files.Glob (printf "%s/*/*" $basePath) -}}
|
||||
{{- $_ := set $topLevelFolders (dir $path) "" -}}
|
||||
{{- end -}}
|
||||
{{- $top_level_folder_list := keys $topLevelFolders | sortAlpha -}}
|
||||
{{/* Iterate over the top level folders */}}
|
||||
{{ range $path := $top_level_folder_list }}
|
||||
|
||||
{{- /* Iterate over the top level folders */ -}}
|
||||
{{- range $path := $top_level_folder_list -}}
|
||||
{{- $folder := base $path -}}
|
||||
{{- $configMapData := dict -}}
|
||||
{{- $configMapBinaryData := dict -}}
|
||||
|
@ -70,16 +66,16 @@ Renders configMap objects required by the chart from a folder in the repo's path
|
|||
{{- $configMapData = merge $configMapData (dict $file $fileContent) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- $configMapValues := dict "enabled" true "forceRename" $configMapForceRename "labels" $configMapLabels "annotations" $configMapAnnotations "data" $configMapData "binaryData" $configMapBinaryData -}}
|
||||
{{- $configMapObject := (include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $ "id" $folder "values" $configMapValues)) | fromYaml -}}
|
||||
{{/* Append it to .Values.configMaps so it can be created by "bjw-s.common.render.configMaps" and fetched by identifier */}}
|
||||
{{- $existingConfigMaps := (get $valuesCopy "configMaps"| default dict) -}}
|
||||
{{- $mergedConfigMaps := deepCopy $existingConfigMaps | merge (dict (base $path) $configMapValues) -}}
|
||||
{{- $valuesCopy := merge $valuesCopy (dict "configMaps" $mergedConfigMaps) -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- $configMapObject := (include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $folder "values" $configMapValues) | fromYaml) -}}
|
||||
|
||||
{{ end }}
|
||||
{{- /* Append it to .Values.configMaps so it can be created by "bjw-s.common.render.configMaps" and fetched by identifier */ -}}
|
||||
{{- $existingConfigMaps := (get $valuesCopy "configMaps" | default dict) -}}
|
||||
{{- $mergedConfigMaps := deepCopy $existingConfigMaps | merge (dict $folder $configMapObject) -}}
|
||||
|
||||
{{- $valuesCopy := merge $valuesCopy (dict "configMaps" $mergedConfigMaps) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -5,43 +5,38 @@ Renders the controller objects required by the chart.
|
|||
{{- $rootContext := $ -}}
|
||||
|
||||
{{- /* Generate named controller objects as required */ -}}
|
||||
{{- range $key, $controller := .Values.controllers -}}
|
||||
{{- /* Enable controller by default, but allow override */ -}}
|
||||
{{- $controllerEnabled := true -}}
|
||||
{{- if hasKey $controller "enabled" -}}
|
||||
{{- $controllerEnabled = $controller.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $controllerEnabled -}}
|
||||
{{- $controllerValues := $controller -}}
|
||||
|
||||
{{- $enabledControllers := (include "bjw-s.common.lib.controller.enabledControllers" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- range $identifier := keys $enabledControllers -}}
|
||||
{{- /* Create object from the raw controller values */ -}}
|
||||
{{- $controllerObject := (include "bjw-s.common.lib.controller.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $controllerValues)) | fromYaml -}}
|
||||
{{- $controllerObject := (include "bjw-s.common.lib.controller.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- /* Perform validations on the controller before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.controller.validate" (dict "rootContext" $rootContext "object" $controllerObject) -}}
|
||||
|
||||
{{- if eq $controllerObject.type "deployment" -}}
|
||||
{{- $deploymentObject := (include "bjw-s.common.lib.deployment.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $controllerObject)) | fromYaml -}}
|
||||
{{- $deploymentObject := (include "bjw-s.common.lib.deployment.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $controllerObject "itemCount" (len $enabledControllers))) | fromYaml -}}
|
||||
{{- include "bjw-s.common.lib.deployment.validate" (dict "rootContext" $rootContext "object" $deploymentObject) -}}
|
||||
{{- include "bjw-s.common.class.deployment" (dict "rootContext" $rootContext "object" $deploymentObject) | nindent 0 -}}
|
||||
|
||||
{{- else if eq $controllerObject.type "cronjob" -}}
|
||||
{{- $cronjobObject := (include "bjw-s.common.lib.cronjob.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $controllerObject)) | fromYaml -}}
|
||||
{{- $cronjobObject := (include "bjw-s.common.lib.cronjob.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $controllerObject "itemCount" (len $enabledControllers))) | fromYaml -}}
|
||||
{{- include "bjw-s.common.lib.cronjob.validate" (dict "rootContext" $rootContext "object" $cronjobObject) -}}
|
||||
{{- include "bjw-s.common.class.cronjob" (dict "rootContext" $rootContext "object" $cronjobObject) | nindent 0 -}}
|
||||
|
||||
{{- else if eq $controllerObject.type "daemonset" -}}
|
||||
{{- $daemonsetObject := (include "bjw-s.common.lib.daemonset.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $controllerObject)) | fromYaml -}}
|
||||
{{- $daemonsetObject := (include "bjw-s.common.lib.daemonset.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $controllerObject "itemCount" (len $enabledControllers))) | fromYaml -}}
|
||||
{{- include "bjw-s.common.lib.daemonset.validate" (dict "rootContext" $rootContext "object" $daemonsetObject) -}}
|
||||
{{- include "bjw-s.common.class.daemonset" (dict "rootContext" $rootContext "object" $daemonsetObject) | nindent 0 -}}
|
||||
|
||||
{{- else if eq $controllerObject.type "statefulset" -}}
|
||||
{{- $statefulsetObject := (include "bjw-s.common.lib.statefulset.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $controllerObject)) | fromYaml -}}
|
||||
{{- $statefulsetObject := (include "bjw-s.common.lib.statefulset.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $controllerObject "itemCount" (len $enabledControllers))) | fromYaml -}}
|
||||
{{- include "bjw-s.common.lib.statefulset.validate" (dict "rootContext" $rootContext "object" $statefulsetObject) -}}
|
||||
{{- include "bjw-s.common.class.statefulset" (dict "rootContext" $rootContext "object" $statefulsetObject) | nindent 0 -}}
|
||||
|
||||
{{- else if eq $controllerObject.type "job" -}}
|
||||
{{- $jobObject := (include "bjw-s.common.lib.job.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $controllerObject)) | fromYaml -}}
|
||||
{{- $jobObject := (include "bjw-s.common.lib.job.valuesToObject" (dict "rootContext" $rootContext "id" $identifier "values" $controllerObject "itemCount" (len $enabledControllers))) | fromYaml -}}
|
||||
{{- include "bjw-s.common.lib.job.validate" (dict "rootContext" $rootContext "object" $jobObject) -}}
|
||||
{{- include "bjw-s.common.class.job" (dict "rootContext" $rootContext "object" $jobObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -2,25 +2,18 @@
|
|||
Renders the Ingress objects required by the chart.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.render.ingresses" -}}
|
||||
{{- /* Generate named Ingresses as required */ -}}
|
||||
{{- range $key, $ingress := .Values.ingress }}
|
||||
{{- /* Enable Ingress by default, but allow override */ -}}
|
||||
{{- $ingressEnabled := true -}}
|
||||
{{- if hasKey $ingress "enabled" -}}
|
||||
{{- $ingressEnabled = $ingress.enabled -}}
|
||||
{{- end -}}
|
||||
{{- $rootContext := $ -}}
|
||||
|
||||
{{- if $ingressEnabled -}}
|
||||
{{- $ingressValues := (mustDeepCopy $ingress) -}}
|
||||
{{- /* Generate Ingresses as required */ -}}
|
||||
{{- $enabledIngresses := (include "bjw-s.common.lib.ingress.enabledIngresses" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- range $identifier := keys $enabledIngresses -}}
|
||||
{{- /* Generate object from the raw persistence values */ -}}
|
||||
{{- $ingressObject := (include "bjw-s.common.lib.ingress.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- /* Create object from the raw ingress values */ -}}
|
||||
{{- $ingressObject := (include "bjw-s.common.lib.ingress.valuesToObject" (dict "rootContext" $ "id" $key "values" $ingressValues)) | fromYaml -}}
|
||||
{{- /* Perform validations on the Ingress before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.ingress.validate" (dict "rootContext" $rootContext "object" $ingressObject) -}}
|
||||
|
||||
{{- /* Perform validations on the ingress before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.ingress.validate" (dict "rootContext" $ "object" $ingressObject) -}}
|
||||
|
||||
{{/* Include the ingress class */}}
|
||||
{{- /* Include the ingress class */ -}}
|
||||
{{- include "bjw-s.common.class.ingress" (dict "rootContext" $ "object" $ingressObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -2,25 +2,18 @@
|
|||
Renders the networkPolicy objects required by the chart.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.render.networkpolicies" -}}
|
||||
{{- /* Generate named networkPolicy as required */ -}}
|
||||
{{- range $key, $networkPolicy := .Values.networkpolicies }}
|
||||
{{- /* Enable networkPolicy by default, but allow override */ -}}
|
||||
{{- $networkPolicyEnabled := true -}}
|
||||
{{- if hasKey $networkPolicy "enabled" -}}
|
||||
{{- $networkPolicyEnabled = $networkPolicy.enabled -}}
|
||||
{{- end -}}
|
||||
{{- $rootContext := $ -}}
|
||||
|
||||
{{- if $networkPolicyEnabled -}}
|
||||
{{- $networkPolicyValues := (mustDeepCopy $networkPolicy) -}}
|
||||
|
||||
{{- /* Create object from the raw networkPolicy values */ -}}
|
||||
{{- $networkPolicyObject := (include "bjw-s.common.lib.networkpolicy.valuesToObject" (dict "rootContext" $ "id" $key "values" $networkPolicyValues)) | fromYaml -}}
|
||||
{{- /* Generate networkPolicy as required */ -}}
|
||||
{{- $enabledNetworkPolicies := (include "bjw-s.common.lib.networkpolicy.enabledNetworkPolicies" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- range $identifier := keys $enabledNetworkPolicies -}}
|
||||
{{- /* Generate object from the raw persistence values */ -}}
|
||||
{{- $networkPolicyObject := (include "bjw-s.common.lib.networkpolicy.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- /* Perform validations on the networkPolicy before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.networkpolicy.validate" (dict "rootContext" $ "object" $networkPolicyObject) -}}
|
||||
|
||||
{{/* Include the networkPolicy class */}}
|
||||
{{- /* Include the networkPolicy class */ -}}
|
||||
{{- include "bjw-s.common.class.networkpolicy" (dict "rootContext" $ "object" $networkPolicyObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,26 +1,16 @@
|
|||
{{/*
|
||||
Renders the Persistent Volume Claim objects required by the chart.
|
||||
Renders the Persistent Volume Claim objects required by the chart
|
||||
*/}}
|
||||
{{- define "bjw-s.common.render.pvcs" -}}
|
||||
{{- $rootContext := $ -}}
|
||||
|
||||
{{- /* Generate pvc as required */ -}}
|
||||
{{- range $key, $pvc := .Values.persistence -}}
|
||||
{{- /* Enable PVC by default, but allow override */ -}}
|
||||
{{- $pvcEnabled := true -}}
|
||||
{{- if hasKey $pvc "enabled" -}}
|
||||
{{- $pvcEnabled = $pvc.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if and $pvcEnabled (eq (default "persistentVolumeClaim" $pvc.type) "persistentVolumeClaim") (not $pvc.existingClaim) -}}
|
||||
{{- $pvcValues := (mustDeepCopy $pvc) -}}
|
||||
|
||||
{{- /* Create object from the raw PVC values */ -}}
|
||||
{{- $pvcObject := (include "bjw-s.common.lib.pvc.valuesToObject" (dict "rootContext" $ "id" $key "values" $pvcValues)) | fromYaml -}}
|
||||
|
||||
{{- /* Perform validations on the PVC before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.pvc.validate" (dict "rootContext" $ "object" $pvcValues) -}}
|
||||
{{- $enabledPVCs := (include "bjw-s.common.lib.pvc.enabledPVCs" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- range $identifier := keys $enabledPVCs -}}
|
||||
{{- /* Generate object from the raw persistence values */ -}}
|
||||
{{- $pvcObject := (include "bjw-s.common.lib.pvc.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- /* Include the PVC class */ -}}
|
||||
{{- include "bjw-s.common.class.pvc" (dict "rootContext" $ "object" $pvcValues) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- include "bjw-s.common.class.pvc" (dict "rootContext" $rootContext "object" $pvcObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -5,24 +5,12 @@ Renders other arbirtrary objects required by the chart.
|
|||
{{- $rootContext := $ -}}
|
||||
|
||||
{{- /* Generate raw resources as required */ -}}
|
||||
{{- range $key, $resource := .Values.rawResources -}}
|
||||
{{- /* Enable by default, but allow override */ -}}
|
||||
{{- $resourceEnabled := true -}}
|
||||
{{- if hasKey $resource "enabled" -}}
|
||||
{{- $resourceEnabled = $resource.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $resourceEnabled -}}
|
||||
{{- $resourceValues := (mustDeepCopy $resource) -}}
|
||||
|
||||
{{- /* Create object from the raw resource values */ -}}
|
||||
{{- $resourceObject := (include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $resourceValues)) | fromYaml -}}
|
||||
|
||||
{{- /* Perform validations on the resource before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.rawResource.validate" (dict "rootContext" $ "object" $resourceValues) -}}
|
||||
{{- $enabledRawResources := (include "bjw-s.common.lib.rawResource.enabledRawResources" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- range $identifier := keys $enabledRawResources -}}
|
||||
{{- /* Generate object from the raw resource values */ -}}
|
||||
{{- $rawResourceObject := (include "bjw-s.common.lib.rawResource.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- /* Include the raw resource class */ -}}
|
||||
{{- include "bjw-s.common.class.rawResource" (dict "rootContext" $ "object" $resourceValues) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- include "bjw-s.common.class.rawResource" (dict "rootContext" $rootContext "object" $rawResourceObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -4,9 +4,7 @@ Renders RBAC objects required by the chart.
|
|||
{{- define "bjw-s.common.render.rbac" -}}
|
||||
{{- $rootContext := . -}}
|
||||
{{- include "bjw-s.common.render.rbac.roles" (dict "rootContext" $rootContext) -}}
|
||||
|
||||
{{- include "bjw-s.common.render.rbac.roleBindings" (dict "rootContext" $rootContext) -}}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{/*
|
||||
|
@ -14,27 +12,16 @@ Renders RBAC Role objects required by the chart.
|
|||
*/}}
|
||||
{{- define "bjw-s.common.render.rbac.roles" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- /* Generate named Roles as required */ -}}
|
||||
{{- range $key, $role := $rootContext.Values.rbac.roles }}
|
||||
{{- /* Enable role by default, but allow override */ -}}
|
||||
{{- $roleEnabled := true -}}
|
||||
{{- if hasKey $role "enabled" -}}
|
||||
{{- $roleEnabled = $role.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $roleEnabled -}}
|
||||
{{- $roleValues := (mustDeepCopy $role) -}}
|
||||
|
||||
{{- /* Create object from the raw role values */ -}}
|
||||
{{- $roleObject := (include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $roleValues)) | fromYaml -}}
|
||||
{{- $enabledRoles := (include "bjw-s.common.lib.rbac.role.enabledRoles" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- range $identifier := keys $enabledRoles -}}
|
||||
{{- /* Generate object from the raw role values */ -}}
|
||||
{{- $roleObject := (include "bjw-s.common.lib.rbac.role.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- /* Perform validations on the role before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.rbac.role.validate" (dict "rootContext" $rootContext "object" $roleObject) -}}
|
||||
|
||||
{{/* Include the role class */}}
|
||||
{{- include "bjw-s.common.class.rbac.Role" (dict "rootContext" $rootContext "object" $roleObject) | nindent 0 -}}
|
||||
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
@ -43,25 +30,12 @@ Renders RBAC RoleBinding objects required by the chart.
|
|||
*/}}
|
||||
{{- define "bjw-s.common.render.rbac.roleBindings" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- range $key, $roleBinding := $rootContext.Values.rbac.bindings }}
|
||||
{{- /* Enable RoleBinding by default, but allow override */ -}}
|
||||
{{- $roleBindingEnabled := true -}}
|
||||
{{- if hasKey $roleBinding "enabled" -}}
|
||||
{{- $roleBindingEnabled = $roleBinding.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $roleBindingEnabled -}}
|
||||
{{- $roleBindingValues := (mustDeepCopy $roleBinding) -}}
|
||||
|
||||
{{- /* Create object from the raw RoleBinding values */ -}}
|
||||
{{- $roleBindingObject := (include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $roleBindingValues)) | fromYaml -}}
|
||||
|
||||
{{- /* Perform validations on the RoleBinding before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.rbac.roleBinding.validate" (dict "rootContext" $rootContext "object" $roleBindingObject) -}}
|
||||
{{- $enabledRoleBindings := (include "bjw-s.common.lib.rbac.roleBinding.enabledRoleBindings" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- range $identifier := keys $enabledRoleBindings -}}
|
||||
{{- /* Generate object from the raw role values */ -}}
|
||||
{{- $roleBindingObject := (include "bjw-s.common.lib.rbac.roleBinding.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{/* Include the RoleBinding class */}}
|
||||
{{- include "bjw-s.common.class.rbac.roleBinding" (dict "rootContext" $rootContext "object" $roleBindingObject) | nindent 0 -}}
|
||||
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
Renders the Route objects required by the chart
|
||||
*/}}
|
||||
{{- define "bjw-s.common.render.routes" -}}
|
||||
{{- /* Generate named routes as required */ -}}
|
||||
{{- $enabledRoutes := (include "bjw-s.common.lib.route.enabledRoutes" (dict "rootContext" $) | fromYaml ) -}}
|
||||
{{- range $key, $route := $enabledRoutes -}}
|
||||
{{- $routeValues := (mustDeepCopy $route) -}}
|
||||
{{- $rootContext := $ -}}
|
||||
|
||||
{{- /* Create object from the raw Route values */ -}}
|
||||
{{- $routeObject := (include "bjw-s.common.lib.route.valuesToObject" (dict "rootContext" $ "id" $key "values" $routeValues)) | fromYaml -}}
|
||||
{{- /* Generate named routes as required */ -}}
|
||||
{{- $enabledRoutes := (include "bjw-s.common.lib.route.enabledRoutes" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- range $identifier := keys $enabledRoutes -}}
|
||||
{{- /* Generate object from the raw route values */ -}}
|
||||
{{- $routeObject := (include "bjw-s.common.lib.route.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- /* Perform validations on the Route before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.route.validate" (dict "rootContext" $ "object" $routeObject) -}}
|
||||
{{- include "bjw-s.common.lib.route.validate" (dict "rootContext" $rootContext "object" $routeObject) -}}
|
||||
|
||||
{{- /* Include the Route class */ -}}
|
||||
{{- include "bjw-s.common.class.route" (dict "rootContext" $ "object" $routeObject) | nindent 0 -}}
|
||||
{{- include "bjw-s.common.class.route" (dict "rootContext" $rootContext "object" $routeObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -5,24 +5,13 @@ Renders the Secret objects required by the chart.
|
|||
{{- $rootContext := $ -}}
|
||||
|
||||
{{- /* Generate named Secrets as required */ -}}
|
||||
{{- range $key, $secret := .Values.secrets }}
|
||||
{{- /* Enable Secret by default, but allow override */ -}}
|
||||
{{- $secretEnabled := true -}}
|
||||
{{- if hasKey $secret "enabled" -}}
|
||||
{{- $secretEnabled = $secret.enabled -}}
|
||||
{{- end -}}
|
||||
{{- $enabledSecrets := (include "bjw-s.common.lib.secret.enabledSecrets" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
|
||||
{{- if $secretEnabled -}}
|
||||
{{- $secretValues := (mustDeepCopy $secret) -}}
|
||||
{{- range $identifier := keys $enabledSecrets -}}
|
||||
{{- /* Generate object from the raw secret values */ -}}
|
||||
{{- $secretObject := (include "bjw-s.common.lib.secret.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- /* Create object from the raw Secret values */ -}}
|
||||
{{- $secretObject := (include "bjw-s.common.lib.valuesToObject" (dict "rootContext" $rootContext "id" $key "values" $secretValues)) | fromYaml -}}
|
||||
|
||||
{{- /* Perform validations on the Secret before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.secret.validate" (dict "rootContext" $ "object" $secretObject) -}}
|
||||
|
||||
{{/* Include the Secret class */}}
|
||||
{{- include "bjw-s.common.class.secret" (dict "rootContext" $ "object" $secretObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- /* Include the Secret class */ -}}
|
||||
{{- include "bjw-s.common.class.secret" (dict "rootContext" $rootContext "object" $secretObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,26 +1,19 @@
|
|||
{{/*
|
||||
Renders the serviceMonitor objects required by the chart.
|
||||
Renders the serviceMonitor object required by the chart.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.render.serviceMonitors" -}}
|
||||
{{- $rootContext := $ -}}
|
||||
|
||||
{{- /* Generate named serviceMonitors as required */ -}}
|
||||
{{- range $key, $serviceMonitor := .Values.serviceMonitor -}}
|
||||
{{- /* Enable ServiceMonitor by default, but allow override */ -}}
|
||||
{{- $serviceMonitorEnabled := true -}}
|
||||
{{- if hasKey $serviceMonitor "enabled" -}}
|
||||
{{- $serviceMonitorEnabled = $serviceMonitor.enabled -}}
|
||||
{{- end -}}
|
||||
{{- $enabledServiceMonitors := (include "bjw-s.common.lib.serviceMonitor.enabledServiceMonitors" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
||||
{{- range $identifier := keys $enabledServiceMonitors -}}
|
||||
{{- /* Generate object from the raw serviceMonitor values */ -}}
|
||||
{{- $serviceMonitorObject := (include "bjw-s.common.lib.serviceMonitor.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
||||
|
||||
{{- if $serviceMonitorEnabled -}}
|
||||
{{- $serviceMonitorValues := (mustDeepCopy $serviceMonitor) -}}
|
||||
{{- /* Perform validations on the ServiceMonitor before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.serviceMonitor.validate" (dict "rootContext" $rootContext "object" $serviceMonitorObject) -}}
|
||||
|
||||
{{- /* Create object from the raw ServiceMonitor values */ -}}
|
||||
{{- $serviceMonitorObject := (include "bjw-s.common.lib.serviceMonitor.valuesToObject" (dict "rootContext" $ "id" $key "values" $serviceMonitorValues)) | fromYaml -}}
|
||||
|
||||
{{- /* Perform validations on the serviceMonitor before rendering */ -}}
|
||||
{{- include "bjw-s.common.lib.serviceMonitor.validate" (dict "rootContext" $ "object" $serviceMonitorObject) -}}
|
||||
|
||||
{{/* Include the serviceMonitor class */}}
|
||||
{{- include "bjw-s.common.class.serviceMonitor" (dict "rootContext" $ "object" $serviceMonitorObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- /* Include the ServiceMonitor class */ -}}
|
||||
{{- include "bjw-s.common.class.serviceMonitor" (dict "rootContext" $rootContext "object" $serviceMonitorObject) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue