feat(common)!: Migrate library chart

This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2022-08-07 11:45:41 +02:00
parent 49ebc2bb2f
commit a1a80f5ff5
No known key found for this signature in database
GPG key ID: BC5E2BD907F9A8EC
59 changed files with 499 additions and 885 deletions

View file

@ -0,0 +1,16 @@
---
apiVersion: v2
description: A common powered chart template. This can be useful for small projects that don't have their own chart.
name: common-chart
version: 0.1.0
maintainers:
- name: bjw-s
email: me@bjw-s.dev
dependencies:
- name: common
repository: https://bjw-s.github.io/helm-charts
version: 0.1.0
annotations:
artifacthub.io/changes: |-
- kind: changed
description: Set `common` chart dependency to version 0.1.0

View file

@ -0,0 +1,22 @@
image:
repository: b4bz/homer
tag: latest
pullPolicy: IfNotPresent
service:
main:
ports:
http:
port: 8080
ingress:
main:
enabled: true
probes:
liveness:
enabled: true
readiness:
enabled: true
startup:
enabled: true

View file

@ -0,0 +1,32 @@
image:
repository: b4bz/homer
tag: latest
pullPolicy: IfNotPresent
service:
main:
ports:
http:
port: 8080
ingress:
main:
enabled: true
persistence:
config:
enabled: true
emptyDir:
enabled: true
mountPath: /www/assets
addons:
codeserver:
enabled: true
workingDir: "/www/assets"
ingress:
main:
enabled: true
volumeMounts:
- name: config
mountPath: /www/assets

View file

@ -0,0 +1,26 @@
image:
repository: b4bz/homer
tag: latest
pullPolicy: IfNotPresent
service:
main:
ports:
http:
port: 8080
ingress:
main:
enabled: true
probes:
liveness:
enabled: true
readiness:
enabled: true
startup:
enabled: true
addons:
netshoot:
enabled: true

View file

@ -0,0 +1,29 @@
image:
repository: ghcr.io/k8s-at-home/qbittorrent
tag: latest
pullPolicy: IfNotPresent
service:
main:
ports:
http:
port: 8080
persistence:
config:
enabled: true
emptyDir:
enabled: true
mountPath: /config
addons:
promtail:
enabled: true
loki: http://loki.monitoring.svc.cluster.local:3100/loki/api/v1/push
logs:
- name: qbittorrent
path: /config/data/qBittorrent/logs/*.log
volumeMounts:
- name: config
mountPath: /config
readOnly: true

View file

@ -45,7 +45,7 @@ tests:
- documentIndex: *AddonServiceDocument
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart
value: RELEASE-NAME-common-chart
- it: addon enabled with deployKey should pass
set:
@ -83,11 +83,11 @@ tests:
items:
- key: id_rsa
path: id_rsa
secretName: RELEASE-NAME-kah-common-chart-deploykey
secretName: RELEASE-NAME-common-chart-deploykey
- documentIndex: *AddonDeployKeySecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart-deploykey
value: RELEASE-NAME-common-chart-deploykey
- it: addon enabled with InlineBase64 deployKey should pass
set:
@ -125,11 +125,11 @@ tests:
items:
- key: id_rsa
path: id_rsa
secretName: RELEASE-NAME-kah-common-chart-deploykey
secretName: RELEASE-NAME-common-chart-deploykey
- documentIndex: *AddonDeployKeySecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart-deploykey
value: RELEASE-NAME-common-chart-deploykey
- it: addon enabled with existingSecret deployKey should pass
set:

View file

@ -68,11 +68,11 @@ tests:
items:
- key: vpnConfigfile
path: vpnConfigfile
secretName: RELEASE-NAME-kah-common-chart-vpnconfig
secretName: RELEASE-NAME-common-chart-vpnconfig
- documentIndex: *AddonVPNConfigSecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart-vpnconfig
value: RELEASE-NAME-common-chart-vpnconfig
- it: addon enabled with existing configFile secret should pass
set:
@ -129,3 +129,52 @@ tests:
equal:
path: spec.template.spec.containers[0].name
value: vpn
- it: addon enabled with custom env vars dict should pass
set:
addons:
vpn:
enabled: true
env:
int: 1
float: 1.5
string: value_of_env
template: "{{ .Release.Name }}-admin"
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
not: true
equal:
path: spec.template.spec.containers[1].name
value: vpn
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[0]
value:
name: float
value: "1.5"
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[1]
value:
name: int
value: "1"
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[2]
value:
name: string
value: value_of_env
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[3]
value:
name: template
value: RELEASE-NAME-admin

View file

@ -20,8 +20,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
- it: custom metadata should pass
set:
@ -47,8 +47,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
test_label: test
- it: custom metadata with global metadata should pass
@ -81,7 +81,7 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
app.kubernetes.io/name: common-chart
global_label: test
helm.sh/chart: kah-common-chart-1.1.2
helm.sh/chart: common-chart-0.1.0
test_label: test

View file

@ -71,7 +71,7 @@ tests:
- documentIndex: 0
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart-config
value: RELEASE-NAME-common-chart-config
- it: with nameOverride should pass
set:
@ -88,4 +88,4 @@ tests:
- documentIndex: 0
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart-http
value: RELEASE-NAME-common-chart-http

View file

@ -15,4 +15,4 @@ tests:
equal:
path: spec.template.metadata.annotations
value:
checksum/config: 08f1047e9078ea3a6e593bffc1bf2d1b7db4163b9bb0c8203d8c70f2a6a5e551
checksum/config: 3cd90a9f7d2c08b3d9d41d1be650110f4974009dcaf0a3d9e0616c90d80e1d38

View file

@ -56,21 +56,6 @@ tests:
name: string
value: "1"
- it: KeyValue float should pass
set:
env:
string: 4.2
asserts:
- documentIndex: &DeploymentDoc 0
isKind:
of: Deployment
- documentIndex: *DeploymentDoc
equal:
path: spec.template.spec.containers[0].env[0]
value:
name: string
value: "4.2"
- it: List should pass
set:
env:

View file

@ -40,4 +40,4 @@ tests:
path: spec.template.spec.containers[0].envFrom[0]
value:
secretRef:
name: RELEASE-NAME-kah-common-chart
name: RELEASE-NAME-common-chart

View file

@ -18,8 +18,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
- it: custom metadata should pass
set:
@ -44,8 +44,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
test_label: test
- it: custom metadata with global metadata should pass
@ -77,7 +77,7 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
app.kubernetes.io/name: common-chart
global_label: test
helm.sh/chart: kah-common-chart-1.1.2
helm.sh/chart: common-chart-0.1.0
test_label: test

View file

@ -18,8 +18,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
- it: custom metadata should pass
set:
@ -44,8 +44,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
test_label: test
- it: custom metadata with global metadata should pass
@ -77,7 +77,7 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
app.kubernetes.io/name: common-chart
global_label: test
helm.sh/chart: kah-common-chart-1.1.2
helm.sh/chart: common-chart-0.1.0
test_label: test

View file

@ -18,8 +18,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
- it: custom metadata should pass
set:
@ -44,8 +44,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
test_label: test
- it: custom metadata with global metadata should pass
@ -77,7 +77,7 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
app.kubernetes.io/name: common-chart
global_label: test
helm.sh/chart: kah-common-chart-1.1.2
helm.sh/chart: common-chart-0.1.0
test_label: test

View file

@ -10,7 +10,7 @@ tests:
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart
value: RELEASE-NAME-common-chart
- it: daemonset should pass
set:
@ -22,7 +22,7 @@ tests:
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart
value: RELEASE-NAME-common-chart
- it: statefulset should pass
set:
@ -34,7 +34,7 @@ tests:
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart
value: RELEASE-NAME-common-chart
- it: disabled should pass
set:

View file

@ -18,8 +18,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
- it: custom metadata should pass
set:
@ -44,8 +44,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
test_label: test
- it: custom metadata with global metadata should pass
@ -77,7 +77,7 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
app.kubernetes.io/name: common-chart
global_label: test
helm.sh/chart: kah-common-chart-1.1.2
helm.sh/chart: common-chart-0.1.0
test_label: test

View file

@ -13,7 +13,7 @@ tests:
equal:
path: spec.rules[0].http.paths[0].backend
value:
serviceName: RELEASE-NAME-kah-common-chart
serviceName: RELEASE-NAME-common-chart
servicePort: null
- it: custom service reference should pass

View file

@ -17,7 +17,7 @@ tests:
value:
name: config
persistentVolumeClaim:
claimName: RELEASE-NAME-kah-common-chart-config
claimName: RELEASE-NAME-common-chart-config
- it: with existingClaim should pass
set:
@ -55,7 +55,7 @@ tests:
value:
name: claimWithoutSuffix
persistentVolumeClaim:
claimName: RELEASE-NAME-kah-common-chart
claimName: RELEASE-NAME-common-chart
- it: custom suffix should pass
set:
@ -75,4 +75,4 @@ tests:
value:
name: claimWithNameOverride
persistentVolumeClaim:
claimName: RELEASE-NAME-kah-common-chart-suffix
claimName: RELEASE-NAME-common-chart-suffix

View file

@ -65,7 +65,7 @@ tests:
value:
name: configmap
configMap:
name: RELEASE-NAME-kah-common-chart-config
name: RELEASE-NAME-common-chart-config
- it: secret persistence type should pass
set:

View file

@ -0,0 +1,91 @@
suite: pod additional containers
templates:
- common.yaml
tests:
- it: with explicit name should pass
set:
additionalContainers:
additional1:
name: template-test
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[1].name
value: template-test
- it: with implicit name should pass
set:
additionalContainers:
additional1:
image: template-test
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[1].name
value: additional1
- it: with templated name should pass
set:
additionalContainers:
additional1:
name: "{{ .Release.Name }}-container"
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[1].name
value: RELEASE-NAME-container
- it: with custom env vars dict should pass
set:
env:
main_env: value
additionalContainers:
additional1:
env:
int: 1
float: 1.5
string: value_of_env
template: "{{ .Release.Name }}-admin"
asserts:
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[0].env[0]
value:
name: main_env
value: "value"
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[0]
value:
name: float
value: "1.5"
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[1]
value:
name: int
value: "1"
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[2]
value:
name: string
value: value_of_env
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[3]
value:
name: template
value: RELEASE-NAME-admin

View file

@ -0,0 +1,83 @@
suite: pod initContainers
templates:
- common.yaml
tests:
- it: with explicit name should pass
set:
initContainers:
init1:
name: template-test
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.initContainers[0].name
value: template-test
- it: with implicit name should pass
set:
initContainers:
init1:
image: template-test
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.initContainers[0].name
value: init1
- it: with templated name should pass
set:
initContainers:
init1:
name: "{{ .Release.Name }}-container"
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.initContainers[0].name
value: RELEASE-NAME-container
- it: with custom env vars dict should pass
set:
initContainers:
init1:
env:
int: 1
float: 1.5
string: value_of_env
template: "{{ .Release.Name }}-admin"
asserts:
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.initContainers[0].env[0]
value:
name: float
value: "1.5"
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.initContainers[0].env[1]
value:
name: int
value: "1"
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.initContainers[0].env[2]
value:
name: string
value: value_of_env
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.initContainers[0].env[3]
value:
name: template
value: RELEASE-NAME-admin

View file

@ -18,8 +18,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
- it: retain enabled should pass
set:
@ -41,8 +41,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
- it: custom metadata should pass
set:
@ -67,8 +67,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
test_label: test
- it: custom metadata with global metadata should pass
@ -100,7 +100,7 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
app.kubernetes.io/name: common-chart
global_label: test
helm.sh/chart: kah-common-chart-1.1.2
helm.sh/chart: common-chart-0.1.0
test_label: test

View file

@ -35,7 +35,7 @@ tests:
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart-config
value: RELEASE-NAME-common-chart-config
- it: without suffix should pass
set:
@ -49,7 +49,7 @@ tests:
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart
value: RELEASE-NAME-common-chart
- it: with custom suffix should pass
set:
@ -63,4 +63,4 @@ tests:
- documentIndex: *PersistentVolumeClaimDocument
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart-custom
value: RELEASE-NAME-common-chart-custom

View file

@ -16,8 +16,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
- it: custom metadata should pass
set:
@ -42,8 +42,8 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
helm.sh/chart: kah-common-chart-1.1.2
app.kubernetes.io/name: common-chart
helm.sh/chart: common-chart-0.1.0
test_label: test
- it: custom metadata with global metadata should pass
@ -75,7 +75,7 @@ tests:
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kah-common-chart
app.kubernetes.io/name: common-chart
global_label: test
helm.sh/chart: kah-common-chart-1.1.2
helm.sh/chart: common-chart-0.1.0
test_label: test

View file

@ -12,7 +12,7 @@ tests:
- documentIndex: *ServiceDocument
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart
value: RELEASE-NAME-common-chart
- it: custom name suffix should pass
set:
@ -26,4 +26,4 @@ tests:
- documentIndex: *ServiceDocument
equal:
path: metadata.name
value: RELEASE-NAME-kah-common-chart-http
value: RELEASE-NAME-common-chart-http

View file

@ -1,19 +0,0 @@
---
apiVersion: v2
description: A KaH-common powered chart template. This can be useful for small projects that don't have their own chart.
name: kah-common-chart
version: 1.1.3
maintainers:
- name: bjw-s
email: me@bjw-s.dev
dependencies:
- name: common
repository: https://bjw-s.github.io/helm-charts
version: 4.4.2
annotations:
artifacthub.io/changes: |-
- kind: changed
description: Upgraded `common` chart dependency to version 4.4.2
links:
- name: GitHub Issue
url: https://github.com/issue-url

View file

@ -1,45 +0,0 @@
suite: pod additional containers
templates:
- common.yaml
tests:
- it: with explicit name should pass
set:
additionalContainers:
additional1:
name: template-test
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[1].name
value: template-test
- it: with implicit name should pass
set:
additionalContainers:
additional1:
image: template-test
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[1].name
value: additional1
- it: with templated name should pass
set:
additionalContainers:
additional1:
name: "{{ .Release.Name }}-container"
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[1].name
value: RELEASE-NAME-container

View file

@ -1,45 +0,0 @@
suite: pod initContainers
templates:
- common.yaml
tests:
- it: with explicit name should pass
set:
initContainers:
init1:
name: template-test
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.initContainers[0].name
value: template-test
- it: with implicit name should pass
set:
initContainers:
init1:
image: template-test
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.initContainers[0].name
value: init1
- it: with templated name should pass
set:
initContainers:
init1:
name: "{{ .Release.Name }}-container"
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.initContainers[0].name
value: RELEASE-NAME-container