diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..118201c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2125666 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/.github/helm-docs.sh b/.github/helm-docs.sh index 690b4ac..7bbedf1 100755 --- a/.github/helm-docs.sh +++ b/.github/helm-docs.sh @@ -2,13 +2,14 @@ set -euxo pipefail # renovate: datasource=github-releases depName=norwoodj/helm-docs -HELM_DOCS_VERSION=1.11.3 +HELM_DOCS_VERSION=1.12.0 # install helm-docs curl --silent --show-error --fail --location --output /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz tar -xf /tmp/helm-docs.tar.gz helm-docs # validate docs +chmod +x ./helm-docs ./helm-docs echo "If this fails, you need to run `helm-docs .`. See https://github.com/norwoodj/helm-docs" git diff --exit-code diff --git a/.github/kubeconform.sh b/.github/kubeconform.sh index e6bb10b..ebcc0ff 100755 --- a/.github/kubeconform.sh +++ b/.github/kubeconform.sh @@ -4,14 +4,14 @@ set -euxo pipefail # renovate: datasource=github-releases depName=yannh/kubeconform KUBECONFORM_VERSION=0.6.4 -#CHART_DIRS="$(git diff --find-renames --name-only "$(git rev-parse --abbrev-ref HEAD)" remotes/origin/main -- charts | cut -d '/' -f 2 | uniq)" +#CHART_DIRS="$(git diff --find-renames --name-only "$(git rev-parse --abbrev-ref HEAD)" remotes/origin/main -- apps | cut -d '/' -f 2 | uniq)" CHART_DIRS=$(ls charts) # install kubeconform curl --silent --show-error --fail --location --output /tmp/kubeconform.tar.gz "https://github.com/yannh/kubeconform/releases/download/v${KUBECONFORM_VERSION}/kubeconform-linux-amd64.tar.gz" tar -xf /tmp/kubeconform.tar.gz kubeconform -# validate charts +# validate apps for CHART_DIR in ${CHART_DIRS}; do helm template --values charts/"${CHART_DIR}"/ci/test-values.yaml charts/"${CHART_DIR}" | ./kubeconform --strict --ignore-missing-schemas --kubernetes-version "${KUBERNETES_VERSION#v}" done diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..fb59090 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 # Use the ref you want to point at + hooks: + - id: trailing-whitespace + - repo: https://github.com/norwoodj/helm-docs.git + rev: v1.13.1 + hooks: + - id: helm-docs + args: + - --chart-search-root=charts + - repo: local + hooks: + - id: chart-lint + name: Run Chart Lint Test + language: system + entry: 'ct lint --all --validate-maintainers=false --config .github/ct.yaml' + - repo: https://github.com/drewbernetes/pre-commits.git + rev: v0.1.0 + hooks: + - id: trivy + args: + - fs + - . diff --git a/charts/e2e-basic/README.md b/charts/e2e-basic/README.md index ff28068..695cf01 100644 --- a/charts/e2e-basic/README.md +++ b/charts/e2e-basic/README.md @@ -1,10 +1,5 @@ # End-2-End-Testing - - - -![Version: 0.0.6](https://img.shields.io/badge/Version-0.0.6-informational?style=flat-square) ![AppVersion: 0.0.6](https://img.shields.io/badge/AppVersion-0.0.6-informational?style=flat-square) - -# Generic End-2-End testing +![Version: 0.0.6](https://img.shields.io/badge/Version-0.0.6-informational?style=flat-square) ![AppVersion: 0.0.6](https://img.shields.io/badge/AppVersion-0.0.6-informational?style=flat-square) # Generic End-2-End testing This setup will deploy a multi-replica deployment with a web frontend and a database backend. @@ -60,39 +55,35 @@ The PDB ensures a pod is always online to ensure no downtime during upgrades ## Automated Testing: Check out [E2E Tester](https://github.com/drew-viles/k8s-e2e-tester) for an automated tester which will fire tests against this chart. - - - - -## Installation - -### Add Helm repository - -```shell -helm repo add drew-viles https://drew-viles.github.io/helm-charts -helm repo update -``` - -## Install chart - -Using config from a file: - -```bash -helm upgrade --install End-2-End-Testing . --values ./values.yaml -``` - -## Updating the Chart -Make sure you've run and resolved any issues using the following as failures of these will cause the pipeline/actions to fail. -``` -yamllint charts/End-2-End-Testing/values.yaml --config-file .github/ct.yaml - -helm-docs . -``` - -## Configuration - -The following table lists the configurable parameters of the chart and the default values. - + + +### Add Helm repository + +```shell +helm repo add drew-viles https://drew-viles.github.io/helm-charts +helm repo update +``` + +## Install chart + +Using config from a file: + +```bash +helm upgrade --install End-2-End-Testing . --values ./values.yaml +``` + +## Updating the Chart +Make sure you've run and resolved any issues using the following as failures of these will cause the pipeline/actions to fail. +``` +ct lint charts/End-2-End-Testing/values.yaml --validate-maintainers=false --config .github/ct.yaml + +helm-docs . +``` + +## Configuration + +The following table lists the configurable parameters of the chart and the default values. + ## Values | Key | Type | Default | Description | @@ -117,4 +108,4 @@ The following table lists the configurable parameters of the chart and the defau | postgres.statefulset.env.postgresUser | string | `"e2e-user"` | | | postgres.statefulset.persistentData.className | string | `"fast-disks"` | | | postgres.statefulset.persistentData.enabled | bool | `true` | | -| postgres.statefulset.persistentData.size | string | `"10Gi"` | | \ No newline at end of file +| postgres.statefulset.persistentData.size | string | `"10Gi"` | | diff --git a/charts/e2e-basic/README.md.gotmpl b/charts/e2e-basic/README.md.gotmpl index 5327242..5b8d71f 100644 --- a/charts/e2e-basic/README.md.gotmpl +++ b/charts/e2e-basic/README.md.gotmpl @@ -1,13 +1,8 @@ -{{ template "chart.header" . }} -{{ template "chart.deprecationWarning" . }} - -{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} - -{{ template "chart.description" . }} - -{{ template "chart.homepageLine" . }} - -## Installation +{{- template "chart.header" . }} +{{- template "chart.deprecationWarning" . }} +{{- template "chart.versionBadge" . }}{{- template "chart.typeBadge" . }}{{- template "chart.appVersionBadge" . }} +{{- template "chart.description" . }} +{{- template "chart.homepageLine" . }} ### Add Helm repository @@ -27,7 +22,7 @@ helm upgrade --install {{ template "chart.name" . }} . --values ./values.yaml ## Updating the Chart Make sure you've run and resolved any issues using the following as failures of these will cause the pipeline/actions to fail. ``` -yamllint charts/{{ template "chart.name" . }}/values.yaml --config-file .github/ct.yaml +ct lint charts/{{ template "chart.name" . }}/values.yaml --validate-maintainers=false --config .github/ct.yaml helm-docs . ``` @@ -36,4 +31,4 @@ helm-docs . The following table lists the configurable parameters of the chart and the default values. -{{ template "chart.valuesSection" . }} \ No newline at end of file +{{ template "chart.valuesSection" . }} diff --git a/charts/jellyfin/README.md b/charts/jellyfin/README.md index 230e565..a2732ee 100644 --- a/charts/jellyfin/README.md +++ b/charts/jellyfin/README.md @@ -1,14 +1,32 @@ # jellyfin +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 10.18.3](https://img.shields.io/badge/AppVersion-10.18.3-informational?style=flat-square) A Helm chart for Kubernetes -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 10.18.3](https://img.shields.io/badge/AppVersion-10.18.3-informational?style=flat-square) +### Add Helm repository -A Helm chart for Kubernetes +```shell +helm repo add drew-viles https://drew-viles.github.io/helm-charts +helm repo update +``` -## Maintainers +## Install chart -| Name | Email | Url | -| ---- | ------ | --- | -| Drew | | | +Using config from a file: + +```bash +helm upgrade --install jellyfin . --values ./values.yaml +``` + +## Updating the Chart +Make sure you've run and resolved any issues using the following as failures of these will cause the pipeline/actions to fail. +``` +ct lint charts/jellyfin/values.yaml --validate-maintainers=false --config .github/ct.yaml + +helm-docs . +``` + +## Configuration + +The following table lists the configurable parameters of the chart and the default values. ## Values @@ -50,6 +68,3 @@ A Helm chart for Kubernetes | serviceAccount.name | string | `""` | | | storageClassName | string | `""` | | | tolerations | list | `[]` | | - ----------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) diff --git a/charts/jellyfin/README.md.gotmpl b/charts/jellyfin/README.md.gotmpl new file mode 100644 index 0000000..2608368 --- /dev/null +++ b/charts/jellyfin/README.md.gotmpl @@ -0,0 +1,34 @@ +{{- template "chart.header" . }} +{{- template "chart.deprecationWarning" . }} +{{- template "chart.versionBadge" . }}{{- template "chart.typeBadge" . }}{{- template "chart.appVersionBadge" . }} +{{- template "chart.description" . }} +{{- template "chart.homepageLine" . }} + +### Add Helm repository + +```shell +helm repo add drew-viles https://drew-viles.github.io/helm-charts +helm repo update +``` + +## Install chart + +Using config from a file: + +```bash +helm upgrade --install {{ template "chart.name" . }} . --values ./values.yaml +``` + +## Updating the Chart +Make sure you've run and resolved any issues using the following as failures of these will cause the pipeline/actions to fail. +``` +ct lint charts/{{ template "chart.name" . }}/values.yaml --validate-maintainers=false --config .github/ct.yaml + +helm-docs . +``` + +## Configuration + +The following table lists the configurable parameters of the chart and the default values. + +{{ template "chart.valuesSection" . }} diff --git a/charts/kube-virt/Chart.yaml b/charts/kube-virt/Chart.yaml index 14538f0..abdde81 100644 --- a/charts/kube-virt/Chart.yaml +++ b/charts/kube-virt/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: virt-operator type: application -version: 0.1.0 -appVersion: "1.1.0" +version: 0.1.1 +appVersion: "1.2.0" description: | # Virt Operator for Kube Virt diff --git a/charts/kube-virt/README.md b/charts/kube-virt/README.md index 2cbc138..e20c459 100644 --- a/charts/kube-virt/README.md +++ b/charts/kube-virt/README.md @@ -1,8 +1,5 @@ # virt-operator - -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.0](https://img.shields.io/badge/AppVersion-1.1.0-informational?style=flat-square) - -# Virt Operator for Kube Virt +![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.2.0](https://img.shields.io/badge/AppVersion-1.2.0-informational?style=flat-square) # Virt Operator for Kube Virt KubeVirt technology addresses the needs of development teams that have adopted or want to adopt Kubernetes but possess existing Virtual Machine-based workloads that cannot be easily containerized. More specifically, @@ -13,15 +10,32 @@ Benefits are broad and significant. Teams with a reliance on existing virtual ma to rapidly containerize applications. With virtualized workloads placed directly in development workflows, teams can decompose them over time while still leveraging remaining virtualized components as is comfortably desired. -## Maintainers +### Add Helm repository + +```shell +helm repo add drew-viles https://drew-viles.github.io/helm-charts +helm repo update +``` + +## Install chart -| Name | Email | Url | -| ---- | ------ | --- | -| Drew | | | +Using config from a file: -## Source Code +```bash +helm upgrade --install virt-operator . --values ./values.yaml +``` -* +## Updating the Chart +Make sure you've run and resolved any issues using the following as failures of these will cause the pipeline/actions to fail. +``` +ct lint charts/virt-operator/values.yaml --validate-maintainers=false --config .github/ct.yaml + +helm-docs . +``` + +## Configuration + +The following table lists the configurable parameters of the chart and the default values. ## Values @@ -36,9 +50,6 @@ teams can decompose them over time while still leveraging remaining virtualized | image.repository | string | `"quay.io/kubevirt/virt-operator"` | | | image.tag | string | `""` | | | kubevirt.useSoftwareEmulation | bool | `false` | | -| kubevirt.version | string | `"1.1.0"` | | +| kubevirt.version | string | `"1.2.0"` | | | nameOverride | string | `""` | | | replicaCount | int | `2` | | - ----------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) diff --git a/charts/kube-virt/README.md.gotmpl b/charts/kube-virt/README.md.gotmpl new file mode 100644 index 0000000..2608368 --- /dev/null +++ b/charts/kube-virt/README.md.gotmpl @@ -0,0 +1,34 @@ +{{- template "chart.header" . }} +{{- template "chart.deprecationWarning" . }} +{{- template "chart.versionBadge" . }}{{- template "chart.typeBadge" . }}{{- template "chart.appVersionBadge" . }} +{{- template "chart.description" . }} +{{- template "chart.homepageLine" . }} + +### Add Helm repository + +```shell +helm repo add drew-viles https://drew-viles.github.io/helm-charts +helm repo update +``` + +## Install chart + +Using config from a file: + +```bash +helm upgrade --install {{ template "chart.name" . }} . --values ./values.yaml +``` + +## Updating the Chart +Make sure you've run and resolved any issues using the following as failures of these will cause the pipeline/actions to fail. +``` +ct lint charts/{{ template "chart.name" . }}/values.yaml --validate-maintainers=false --config .github/ct.yaml + +helm-docs . +``` + +## Configuration + +The following table lists the configurable parameters of the chart and the default values. + +{{ template "chart.valuesSection" . }} diff --git a/charts/kube-virt/crds/kubevirts.yaml b/charts/kube-virt/crds/kubevirts.yaml index e613e04..424ad3f 100644 --- a/charts/kube-virt/crds/kubevirts.yaml +++ b/charts/kube-virt/crds/kubevirts.yaml @@ -624,6 +624,22 @@ spec: binding: additionalProperties: properties: + domainAttachmentType: + description: 'DomainAttachmentType is a standard domain + network attachment method kubevirt supports. Supported + values: "tap". The standard domain attachment can + be used instead or in addition to the sidecarImage. + version: 1alphav1' + type: string + migration: + description: 'Migration means the VM using the plugin + can be safely migrated version: 1alphav1' + properties: + method: + description: 'Method defines a pre-defined migration + methodology version: 1alphav1' + type: string + type: object networkAttachmentDefinition: description: 'NetworkAttachmentDefinition references to a NetworkAttachmentDefinition CR object. Format: @@ -883,6 +899,14 @@ spec: AutoattachSerialConsole is disabled. type: object type: object + vmRolloutStrategy: + description: VMRolloutStrategy defines how changes to a VM object + propagate to its VMI + enum: + - Stage + - LiveUpdate + nullable: true + type: string vmStateStorageClass: description: VMStateStorageClass is the name of the storage class to use for the PVCs created to preserve VM state, like TPM. @@ -3082,7 +3106,7 @@ spec: served: true storage: true subresources: - status: { } + status: {} - additionalPrinterColumns: - jsonPath: .metadata.creationTimestamp name: Age @@ -3692,6 +3716,22 @@ spec: binding: additionalProperties: properties: + domainAttachmentType: + description: 'DomainAttachmentType is a standard domain + network attachment method kubevirt supports. Supported + values: "tap". The standard domain attachment can + be used instead or in addition to the sidecarImage. + version: 1alphav1' + type: string + migration: + description: 'Migration means the VM using the plugin + can be safely migrated version: 1alphav1' + properties: + method: + description: 'Method defines a pre-defined migration + methodology version: 1alphav1' + type: string + type: object networkAttachmentDefinition: description: 'NetworkAttachmentDefinition references to a NetworkAttachmentDefinition CR object. Format: @@ -3951,6 +3991,14 @@ spec: AutoattachSerialConsole is disabled. type: object type: object + vmRolloutStrategy: + description: VMRolloutStrategy defines how changes to a VM object + propagate to its VMI + enum: + - Stage + - LiveUpdate + nullable: true + type: string vmStateStorageClass: description: VMStateStorageClass is the name of the storage class to use for the PVCs created to preserve VM state, like TPM. @@ -6150,4 +6198,4 @@ spec: served: true storage: false subresources: - status: { } \ No newline at end of file + status: {} \ No newline at end of file diff --git a/charts/kube-virt/templates/rbac.yaml b/charts/kube-virt/templates/rbac.yaml index 704f634..0468928 100644 --- a/charts/kube-virt/templates/rbac.yaml +++ b/charts/kube-virt/templates/rbac.yaml @@ -808,6 +808,13 @@ rules: - get - list - watch + - apiGroups: + - kubevirt.io + resources: + - kubevirts + verbs: + - get + - list - apiGroups: - subresources.kubevirt.io resources: @@ -1113,6 +1120,13 @@ rules: - get - list - watch + - apiGroups: + - kubevirt.io + resources: + - kubevirts + verbs: + - get + - list - apiGroups: - subresources.kubevirt.io resources: diff --git a/charts/kube-virt/values.yaml b/charts/kube-virt/values.yaml index b3b1c7d..0218859 100644 --- a/charts/kube-virt/values.yaml +++ b/charts/kube-virt/values.yaml @@ -1,5 +1,5 @@ kubevirt: - version: 1.1.0 + version: 1.2.0 useSoftwareEmulation: false replicaCount: 2 diff --git a/charts/samba/README.md b/charts/samba/README.md index eaa9b02..4ffb081 100644 --- a/charts/samba/README.md +++ b/charts/samba/README.md @@ -1,21 +1,36 @@ # samba - -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.0](https://img.shields.io/badge/AppVersion-1.1.0-informational?style=flat-square) - -Samba Helm chart requires a LoadBalancer service to function. +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.0](https://img.shields.io/badge/AppVersion-1.1.0-informational?style=flat-square) Samba Helm chart requires a LoadBalancer service to function. It creates a /shared path that can be accessed using a supplied username and password. The password should be stored in a secret and the username supplied via the values. It is currently not configurable too much but could be in future. -## Maintainers -| Name | Email | Url | -| ---- | ------ | --- | -| Drew | | | +### Add Helm repository + +```shell +helm repo add drew-viles https://drew-viles.github.io/helm-charts +helm repo update +``` + +## Install chart + +Using config from a file: -## Source Code +```bash +helm upgrade --install samba . --values ./values.yaml +``` -* +## Updating the Chart +Make sure you've run and resolved any issues using the following as failures of these will cause the pipeline/actions to fail. +``` +ct lint charts/samba/values.yaml --validate-maintainers=false --config .github/ct.yaml + +helm-docs . +``` + +## Configuration + +The following table lists the configurable parameters of the chart and the default values. ## Values @@ -46,6 +61,3 @@ It is currently not configurable too much but could be in future. | serviceAccount.name | string | `""` | | | targetNode | string | `""` | | | tolerations | list | `[]` | | - ----------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3) diff --git a/charts/samba/README.md.gotmpl b/charts/samba/README.md.gotmpl new file mode 100644 index 0000000..2608368 --- /dev/null +++ b/charts/samba/README.md.gotmpl @@ -0,0 +1,34 @@ +{{- template "chart.header" . }} +{{- template "chart.deprecationWarning" . }} +{{- template "chart.versionBadge" . }}{{- template "chart.typeBadge" . }}{{- template "chart.appVersionBadge" . }} +{{- template "chart.description" . }} +{{- template "chart.homepageLine" . }} + +### Add Helm repository + +```shell +helm repo add drew-viles https://drew-viles.github.io/helm-charts +helm repo update +``` + +## Install chart + +Using config from a file: + +```bash +helm upgrade --install {{ template "chart.name" . }} . --values ./values.yaml +``` + +## Updating the Chart +Make sure you've run and resolved any issues using the following as failures of these will cause the pipeline/actions to fail. +``` +ct lint charts/{{ template "chart.name" . }}/values.yaml --validate-maintainers=false --config .github/ct.yaml + +helm-docs . +``` + +## Configuration + +The following table lists the configurable parameters of the chart and the default values. + +{{ template "chart.valuesSection" . }}