diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..69969a7 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,16 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + assignees: + - "tlbueno" + reviewers: + - "tlbueno" + diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..750cab6 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,27 @@ +name: Release Charts + +on: + push: + branches: + - main + +jobs: + release: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.6.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/.helmignore b/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bf88b35 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Tiago Bueno + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1ba3947 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# helm-charts + +An collections of helm chart + +### Usage + +[Helm](https://helm.sh) must be installed to use the charts. Please refer to +Helm's [documentation](https://helm.sh/docs) to get started. + +Once Helm has been set up correctly, add the repo as follows: + + helm repo add tlbueno-repo https://tlbueno.github.io/helm-charts + +If you had already added this repo earlier, run `helm repo update` to retrieve +the latest versions of the packages. You can then run `helm search repo +tlbueno-repo` to see the charts. + +To install the a chart: + + helm install my- tlbueno-repo/ + +To uninstall the chart: + + helm delete my- \ No newline at end of file diff --git a/charts/broker-operator/Chart.yaml b/charts/broker-operator/Chart.yaml new file mode 100644 index 0000000..d30c037 --- /dev/null +++ b/charts/broker-operator/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: broker-operator +description: A Helm chart for AMQ Broker Operator + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +#appVersion: "1.16.0" diff --git a/charts/broker-operator/README.md b/charts/broker-operator/README.md new file mode 100644 index 0000000..9793319 --- /dev/null +++ b/charts/broker-operator/README.md @@ -0,0 +1,60 @@ +# broker-operator + +An helm chart to install the AMQ Broker Operator using Operator Lifecycle Manager (OLM) + +The chart will: +- create a namespace with label named broker-operator/managed-by filled with the subscription name +- deploy an operator group with a selector label named broker-operator/managed-by filled with the subscription name +- deploy the subscription + +### How to use + +Check [README.md](../../README.md) for repo installation details + +To install the chart use the command: +```sh +helm install broker-operator tlbueno-repo/broker-operator +``` + +You may override the default values below by creating a yaml file with one or more entries and use it in helm command, ie: +```sh +helm install broker-operator -f ./my-values.yaml tlbueno-repo/broker-operator +``` + +Default values: +```yaml +# Default values for broker-operator. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# namespace where the operator will be installed +namespace: broker-operator-olm + +operatorGroup: + # operator group name + name: broker-operator + +subscription: + # subscription name + name: broker-operator-olm-sub + + # channel name + channel: 7.11.x + + # operator package name + operatorName: amq-broker-rhel8 + + # catalog name from which the operator will be installed + source: redhat-operators-catalog + + # catalog namespace + sourceNamespace: olm + + # install plan approval type + installPlanApproval: Automatic + + # the initial version of the operator to be installed + # if empty it will not be used in the subscription + startingCSV: "" +``` + diff --git a/charts/broker-operator/templates/NOTES.txt b/charts/broker-operator/templates/NOTES.txt new file mode 100644 index 0000000..7f9a777 --- /dev/null +++ b/charts/broker-operator/templates/NOTES.txt @@ -0,0 +1,9 @@ +Thank you for installing {{ .Chart.Name }}. + +Your release is named {{ .Release.Name }}. + +To learn more about the release, try: + + $ helm status {{ .Release.Name }} + $ helm get all {{ .Release.Name }} + diff --git a/charts/broker-operator/templates/Namespace.yaml b/charts/broker-operator/templates/Namespace.yaml new file mode 100644 index 0000000..cd63e77 --- /dev/null +++ b/charts/broker-operator/templates/Namespace.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.namespace }} + labels: + broker-operator/managed-by: {{ .Values.subscription.name }} + diff --git a/charts/broker-operator/templates/OperatorGroup.yaml b/charts/broker-operator/templates/OperatorGroup.yaml new file mode 100644 index 0000000..ad9a46d --- /dev/null +++ b/charts/broker-operator/templates/OperatorGroup.yaml @@ -0,0 +1,10 @@ +apiVersion: operators.coreos.com/v1alpha2 +kind: OperatorGroup +metadata: + name: {{ .Values.operatorGroup.name }} + namespace: {{ .Values.namespace }} +spec: + selector: + matchLabels: + broker-operator/managed-by: {{ .Values.subscription.name }} + diff --git a/charts/broker-operator/templates/Subscription.yaml b/charts/broker-operator/templates/Subscription.yaml new file mode 100644 index 0000000..954ca21 --- /dev/null +++ b/charts/broker-operator/templates/Subscription.yaml @@ -0,0 +1,15 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: {{ .Values.subscription.name }} + namespace: {{ .Values.namespace }} +spec: + channel: {{ .Values.subscription.channel }} + name: {{ .Values.subscription.operatorName }} + source: {{ .Values.subscription.source }} + sourceNamespace: {{ .Values.subscription.sourceNamespace }} + installPlanApproval: {{ .Values.subscription.installPlanApproval }} + {{- if .Values.subscription.startingCSV }} + startingCSV: {{ .Values.subscription.startingCSV }} + {{- end }} + diff --git a/charts/broker-operator/values.yaml b/charts/broker-operator/values.yaml new file mode 100644 index 0000000..eb9f14f --- /dev/null +++ b/charts/broker-operator/values.yaml @@ -0,0 +1,34 @@ +# Default values for broker-operator. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# namespace where the operator will be installed +namespace: broker-operator-olm + +operatorGroup: + # operator group name + name: broker-operator + +subscription: + # subscription name + name: broker-operator-olm-sub + + # channel name + channel: 7.11.x + + # operator package name + operatorName: amq-broker-rhel8 + + # catalog name from which the operator will be installed + source: redhat-operators-catalog + + # catalog namespace + sourceNamespace: olm + + # install plan approval type + installPlanApproval: Automatic + + # the initial version of the operator to be installed + # if empty it will not be used in the subscription + startingCSV: "" +