Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
Signed-off-by: Tiago Bueno <[email protected]>
  • Loading branch information
tlbueno committed May 18, 2024
0 parents commit a44e43b
Show file tree
Hide file tree
Showing 12 changed files with 284 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -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"

35 changes: 35 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release Charts

on:
workflow_dispatch:
push:
branches:
- main

jobs:
release:
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
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 "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v4
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
23 changes: 23 additions & 0 deletions .helmignore
Original file line number Diff line number Diff line change
@@ -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/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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:

```sh
helm repo add tlbueno 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` to see the charts.

To install the a chart:

```sh
helm install my-<chart-name> tlbueno/<chart-name>
```

To uninstall the chart:

```sh
helm delete my-<chart-name>
```
24 changes: 24 additions & 0 deletions charts/broker-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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: "7.11.x"
60 changes: 60 additions & 0 deletions charts/broker-operator/README.md
Original file line number Diff line number Diff line change
@@ -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: ""
```
9 changes: 9 additions & 0 deletions charts/broker-operator/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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 }}

7 changes: 7 additions & 0 deletions charts/broker-operator/templates/Namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.namespace }}
labels:
broker-operator/managed-by: {{ .Values.subscription.name }}

10 changes: 10 additions & 0 deletions charts/broker-operator/templates/OperatorGroup.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

15 changes: 15 additions & 0 deletions charts/broker-operator/templates/Subscription.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

34 changes: 34 additions & 0 deletions charts/broker-operator/values.yaml
Original file line number Diff line number Diff line change
@@ -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: ""

0 comments on commit a44e43b

Please sign in to comment.