Compare commits
2 Commits
postgres-c
...
redis-repl
| Author | SHA1 | Date | |
|---|---|---|---|
| 96154b9be9 | |||
| 06a206e4b3 |
128
.gitea/workflows/release-charts-redis-replication.yml
Normal file
128
.gitea/workflows/release-charts-redis-replication.yml
Normal file
@@ -0,0 +1,128 @@
|
||||
name: release-charts-redis-replication
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "charts/redis-replication/**"
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
WORKFLOW_DIR: "charts/redis-replication"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-js
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Helm
|
||||
uses: azure/setup-helm@v4
|
||||
with:
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
version: v3.19.2
|
||||
|
||||
- name: Add Repositories
|
||||
run: |
|
||||
cd ${WORKFLOW_DIR}
|
||||
|
||||
echo ">> Adding repositories for chart dependencies ..."
|
||||
helm dependency list --max-col-width 120 2> /dev/null \
|
||||
| tail +2 | head -n -1 \
|
||||
| awk '{ print "helm repo add " $1 " " $3 }' \
|
||||
| while read cmd; do echo "$cmd" | sh; done || true
|
||||
|
||||
if helm repo list | tail +2 | read -r; then
|
||||
echo ">> Update repository cache ..."
|
||||
helm repo update
|
||||
fi
|
||||
|
||||
echo "----"
|
||||
|
||||
- name: Package Helm Chart
|
||||
run: |
|
||||
cd ${WORKFLOW_DIR}
|
||||
|
||||
echo ">> Building helm dependency ..."
|
||||
helm dependency build --skip-refresh --debug
|
||||
|
||||
echo "----"
|
||||
|
||||
echo "PACKAGE_PATH=$(helm package . | awk '{print $NF}')" >> $GITEA_ENV
|
||||
|
||||
- name: Publish Helm Chart to Harbor
|
||||
run: |
|
||||
echo ">> Logging into Harbor ..."
|
||||
helm registry login ${{ vars.REGISTRY_HOST }} -u ${{ vars.REGISTRY_USER }} -p ${{ secrets.REGISTRY_SECRET }} --debug
|
||||
|
||||
echo ""
|
||||
echo ">> Publishing chart to Harbor ..."
|
||||
helm push ${{ env.PACKAGE_PATH }} oci://${{ vars.REGISTRY_HOST }}/helm-charts --debug
|
||||
|
||||
echo "----"
|
||||
|
||||
- name: Publish Helm Chart to Gitea
|
||||
run: |
|
||||
echo ">> Installing Chart Museum plugin ..."
|
||||
helm plugin install https://github.com/chartmuseum/helm-push --debug
|
||||
|
||||
echo ""
|
||||
echo ">> Adding Gitea repository ..."
|
||||
helm repo add --username ${{ gitea.actor }} --password ${{ secrets.REPOSITORY_TOKEN }} helm-charts https://${{ vars.REPOSITORY_HOST }}/api/packages/alexlebens/helm --debug
|
||||
|
||||
echo ""
|
||||
echo ">> Pushing chart to gitea"
|
||||
helm cm-push ${{ env.PACKAGE_PATH }} helm-charts --debug
|
||||
|
||||
- name: Extract Chart Metadata
|
||||
run: |
|
||||
cd ${WORKFLOW_DIR}
|
||||
|
||||
echo ">> Adding Chart metadata to workflow ENV ..."
|
||||
echo ""
|
||||
echo ">> Chart Version: $(yq '.version' Chart.yaml)"
|
||||
echo ">> Chart Name: $(yq '.name' Chart.yaml)"
|
||||
|
||||
echo "----"
|
||||
|
||||
echo "CHART_VERSION=$(yq '.version' Chart.yaml)" >> $GITEA_ENV
|
||||
echo "CHART_NAME=$(yq '.name' Chart.yaml)" >> $GITEA_ENV
|
||||
|
||||
- name: Release Helm Chart
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
name: ${{ env.CHART_NAME }}-${{ env.CHART_VERSION }}
|
||||
tag_name: ${{ env.CHART_NAME }}-${{ env.CHART_VERSION }}
|
||||
files: |-
|
||||
${{ env.PACKAGE_PATH }}
|
||||
|
||||
- name: ntfy Success
|
||||
uses: niniyas/ntfy-action@master
|
||||
if: success()
|
||||
with:
|
||||
url: '${{ secrets.NTFY_URL }}'
|
||||
topic: '${{ secrets.NTFY_TOPIC }}'
|
||||
title: 'Release Success - ${{ env.CHART_NAME }}'
|
||||
priority: 3
|
||||
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_CRED }}"}'
|
||||
tags: action,successfully,completed
|
||||
details: 'Helm Chart ${{ env.CHART_NAME }}-${{ env.CHART_VERSION }} has been released!'
|
||||
icon: 'https://cdn.jsdelivr.net/gh/selfhst/icons/png/gitea.png'
|
||||
|
||||
- name: ntfy Failed
|
||||
uses: niniyas/ntfy-action@master
|
||||
if: failure()
|
||||
with:
|
||||
url: '${{ secrets.NTFY_URL }}'
|
||||
topic: '${{ secrets.NTFY_TOPIC }}'
|
||||
title: 'Release Failure - ${{ env.CHART_NAME }}'
|
||||
priority: 4
|
||||
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_CRED }}"}'
|
||||
tags: action,failed
|
||||
details: 'Helm Chart ${{ env.CHART_NAME }}-${{ env.CHART_VERSION }} has failed to be released.'
|
||||
icon: 'https://cdn.jsdelivr.net/gh/selfhst/icons/png/gitea.png'
|
||||
actions: '[{"action": "view", "label": "Open Gitea", "url": "https://gitea.alexlebens.dev/alexlebens/helm-charts/actions?workflow=release-charts-redis-replication.yml", "clear": true}]'
|
||||
image: true
|
||||
10
.github/workflows/release-charts.yml
vendored
10
.github/workflows/release-charts.yml
vendored
@@ -23,6 +23,16 @@ jobs:
|
||||
git config user.name "$GITHUB_ACTOR"
|
||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||
|
||||
- name: Add Repositories
|
||||
run: |
|
||||
echo ">> Adding repositories for chart dependencies ..."
|
||||
for dir in $(ls -d charts/*/); do
|
||||
helm dependency list $dir --max-col-width 120 2> /dev/null \
|
||||
| tail +2 | head -n -1 \
|
||||
| awk '{ print "helm repo add " $1 " " $3 }' \
|
||||
| while read cmd; do echo "$cmd" | sh; done || true
|
||||
done
|
||||
|
||||
- name: Run chart-releaser
|
||||
uses: helm/chart-releaser-action@v1.7.0
|
||||
env:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# generic-device-plugin
|
||||
|
||||
 
|
||||
 
|
||||
|
||||
Generic Device Plugin
|
||||
|
||||
@@ -28,7 +28,7 @@ Generic Device Plugin
|
||||
| config | object | `{"data":"devices:\n - name: serial\n groups:\n - paths:\n - path: /dev/ttyUSB*\n - paths:\n - path: /dev/ttyACM*\n - paths:\n - path: /dev/tty.usb*\n - paths:\n - path: /dev/cu.*\n - paths:\n - path: /dev/cuaU*\n - paths:\n - path: /dev/rfcomm*\n - name: video\n groups:\n - paths:\n - path: /dev/video0\n - name: fuse\n groups:\n - count: 10\n paths:\n - path: /dev/fuse\n - name: audio\n groups:\n - count: 10\n paths:\n - path: /dev/snd\n - name: capture\n groups:\n - paths:\n - path: /dev/snd/controlC0\n - path: /dev/snd/pcmC0D0c\n - paths:\n - path: /dev/snd/controlC1\n mountPath: /dev/snd/controlC0\n - path: /dev/snd/pcmC1D0c\n mountPath: /dev/snd/pcmC0D0c\n - paths:\n - path: /dev/snd/controlC2\n mountPath: /dev/snd/controlC0\n - path: /dev/snd/pcmC2D0c\n mountPath: /dev/snd/pcmC0D0c\n - paths:\n - path: /dev/snd/controlC3\n mountPath: /dev/snd/controlC0\n - path: /dev/snd/pcmC3D0c\n mountPath: /dev/snd/pcmC0D0c\n","enabled":true}` | Config map |
|
||||
| config.data | string | See [values.yaml](./values.yaml) | generic-device-plugin config file [[ref]](https://github.com/squat/generic-device-plugin#usage) |
|
||||
| deviceDomain | string | `"devic.es"` | Domain used by devices for identifcation |
|
||||
| image | object | `{"pullPolicy":"Always","repository":"ghcr.io/squat/generic-device-plugin","tag":"latest@sha256:d64b1c851b534de348bcd3189555a22d3966e6592fc79d2a78abfff4f6c1a2e1"}` | Default image |
|
||||
| image | object | `{"pullPolicy":"Always","repository":"ghcr.io/squat/generic-device-plugin","tag":"latest@sha256:aa0571c7f461fb99747ada00f2de69eb856dcbbc0e87965fffe37a15f7bc006f"}` | Default image |
|
||||
| name | string | `"generic-device-plugin"` | Name override of release |
|
||||
| resources | object | `{"requests":{"cpu":"50m","memory":"10Mi"}}` | Default resources |
|
||||
| service | object | `{"listenPort":8080}` | Service port |
|
||||
|
||||
15
charts/redis-replication/Chart.yaml
Normal file
15
charts/redis-replication/Chart.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v2
|
||||
name: redis-replication
|
||||
version: 0.1.0
|
||||
description: Redis Replication with Sentinel
|
||||
keywords:
|
||||
- redis-operator
|
||||
- redis
|
||||
- kubernetes
|
||||
sources:
|
||||
- https://github.com/OT-CONTAINER-KIT/redis-operator
|
||||
- https://github.com/OT-CONTAINER-KIT/redis-operator/tree/main/charts/redis-operator
|
||||
maintainers:
|
||||
- name: alexlebens
|
||||
icon: https://github.com/OT-CONTAINER-KIT/redis-operator/raw/main/static/redis-operator-logo.svg
|
||||
appVersion: v0.21.0
|
||||
39
charts/redis-replication/README.md
Normal file
39
charts/redis-replication/README.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# redis-replication
|
||||
|
||||
 
|
||||
|
||||
Redis Replication with Sentinel
|
||||
|
||||
## Maintainers
|
||||
|
||||
| Name | Email | Url |
|
||||
| ---- | ------ | --- |
|
||||
| alexlebens | | |
|
||||
|
||||
## Source Code
|
||||
|
||||
* <https://github.com/OT-CONTAINER-KIT/redis-operator>
|
||||
* <https://github.com/OT-CONTAINER-KIT/redis-operator/tree/main/charts/redis-operator>
|
||||
|
||||
## Values
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| additionalLabels | object | `{}` | Add additional labels |
|
||||
| existingSecret | object | `{"enabled":false,"key":"password","name":"secret-name"}` | Password |
|
||||
| namespaceOverride | string | `""` | Override the namespace of the chart |
|
||||
| redisReplication | object | `{"clusterSize":3,"image":{"pullPolicy":"IfNotPresent","repository":"quay.io/opstree/redis","tag":"v8.4.0"},"podSecurityContext":{"fsGroup":1000,"runAsUser":1000},"redisExporter":{"enabled":true,"image":{"repository":"quay.io/opstree/redis-exporter","tag":"v1.80.1"}},"resources":{"requests":{"cpu":"10m","memory":"128Mi"}},"volumeClaimTemplate":{"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"1Gi"}},"storageClassName":"ceph-block"}}}` | Redis Replication settings |
|
||||
| redisReplication.image | object | `{"pullPolicy":"IfNotPresent","repository":"quay.io/opstree/redis","tag":"v8.4.0"}` | Image |
|
||||
| redisReplication.podSecurityContext | object | `{"fsGroup":1000,"runAsUser":1000}` | Security |
|
||||
| redisReplication.redisExporter | object | `{"enabled":true,"image":{"repository":"quay.io/opstree/redis-exporter","tag":"v1.80.1"}}` | Metrics |
|
||||
| redisReplication.resources | object | `{"requests":{"cpu":"10m","memory":"128Mi"}}` | Resources |
|
||||
| redisReplication.volumeClaimTemplate | object | `{"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"1Gi"}},"storageClassName":"ceph-block"}}` | Storage |
|
||||
| redisSentinel | object | `{"clusterSize":3,"enabled":false,"image":{"pullPolicy":"IfNotPresent","repository":"quay.io/opstree/redis-sentinel","tag":"v8.4.0"},"podSecurityContext":{"fsGroup":1000,"runAsUser":1000},"resources":{"requests":{"cpu":"10m","memory":"128Mi"}}}` | Redis Sentinel settings |
|
||||
| redisSentinel.image | object | `{"pullPolicy":"IfNotPresent","repository":"quay.io/opstree/redis-sentinel","tag":"v8.4.0"}` | Image |
|
||||
| redisSentinel.podSecurityContext | object | `{"fsGroup":1000,"runAsUser":1000}` | Security |
|
||||
| redisSentinel.resources | object | `{"requests":{"cpu":"10m","memory":"128Mi"}}` | Resources |
|
||||
| replicationNameOverride | string | `""` | Override the name of the resources |
|
||||
| sentinelNameOverride | string | `""` | |
|
||||
|
||||
----------------------------------------------
|
||||
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
|
||||
65
charts/redis-replication/templates/_helpers.tpl
Normal file
65
charts/redis-replication/templates/_helpers.tpl
Normal file
@@ -0,0 +1,65 @@
|
||||
{{/*
|
||||
Expand the names
|
||||
*/}}
|
||||
{{- define "redis.replicationName" -}}
|
||||
{{- if .Values.replicationNameOverride }}
|
||||
{{- .Values.replicationNameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "redis-replication-%s" .Release.Name -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "redis.sentinelName" -}}
|
||||
{{- if .Values.sentinelNameOverride }}
|
||||
{{- .Values.sentinelNameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "redis-sentinel-%s" .Release.Name -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
|
||||
*/}}
|
||||
{{- define "redis.namespace" -}}
|
||||
{{- if .Values.namespaceOverride -}}
|
||||
{{- .Values.namespaceOverride -}}
|
||||
{{- else -}}
|
||||
{{- .Release.Namespace -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "redis.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "redis.labels" -}}
|
||||
helm.sh/chart: {{ include "redis.chart" $ }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.Version | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- with .Values.additionalLabels }}
|
||||
{{ toYaml . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "redis.replicationSelectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "redis.replicationName" $ }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/part-of: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "redis.sentinelSelectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "redis.sentinelName" $ }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/part-of: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
39
charts/redis-replication/templates/redis-replication.yaml
Normal file
39
charts/redis-replication/templates/redis-replication.yaml
Normal file
@@ -0,0 +1,39 @@
|
||||
apiVersion: redis.redis.opstreelabs.in/v1beta2
|
||||
kind: RedisReplication
|
||||
metadata:
|
||||
name: {{ include "redis.replicationName" . }}
|
||||
namespace: {{ include "redis.namespace" . }}
|
||||
labels:
|
||||
{{- include "redis.labels" . | nindent 4 }}
|
||||
{{- include "redis.replicationSelectorLabels" . | nindent 4 }}
|
||||
spec:
|
||||
clusterSize: {{ .Values.redisReplication.clusterSize }}
|
||||
|
||||
podSecurityContext:
|
||||
{{- with .Values.redisReplication.podSecurityContext }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{ end }}
|
||||
|
||||
kubernetesConfig:
|
||||
image: "{{ .Values.redisReplication.image.repository }}:{{ .Values.redisReplication.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.redisReplication.image.pullPolicy }}
|
||||
resources:
|
||||
{{- with .Values.redisReplication.resources }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Values.existingSecret.enabled }}
|
||||
redisSecret:
|
||||
name: {{ .Values.existingSecret.name }}
|
||||
key: {{ .Values.existingSecret.key }}
|
||||
{{ end }}
|
||||
|
||||
storage:
|
||||
volumeClaimTemplate:
|
||||
{{- with .Values.redisReplication.volumeClaimTemplate }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{ end }}
|
||||
|
||||
redisExporter:
|
||||
enabled: {{ .Values.redisReplication.redisExporter.enabled }}
|
||||
image: "{{ .Values.redisReplication.redisExporter.image.repository }}:{{ .Values.redisReplication.redisExporter.image.tag }}"
|
||||
41
charts/redis-replication/templates/redis-sentinel.yaml
Normal file
41
charts/redis-replication/templates/redis-sentinel.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
{{- if .Values.redisSentinel.enabled }}
|
||||
---
|
||||
apiVersion: redis.redis.opstreelabs.in/v1beta2
|
||||
kind: RedisSentinel
|
||||
metadata:
|
||||
name: {{ include "redis.sentinelName" . }}
|
||||
namespace: {{ include "redis.namespace" . }}
|
||||
labels:
|
||||
{{- include "redis.labels" . | nindent 4 }}
|
||||
{{- include "redis.sentinelSelectorLabels" . | nindent 4 }}
|
||||
spec:
|
||||
clusterSize: {{ .Values.redisSentinel.clusterSize }}
|
||||
|
||||
podSecurityContext:
|
||||
{{- with .Values.redisSentinel.podSecurityContext }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{ end }}
|
||||
|
||||
redisSentinelConfig:
|
||||
redisReplicationName: {{ include "redis.replicationName" . }}
|
||||
{{ if .Values.existingSecret.enabled }}
|
||||
redisReplicationPassword:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.existingSecret.name }}
|
||||
key: {{ .Values.existingSecret.key }}
|
||||
{{ end }}
|
||||
|
||||
kubernetesConfig:
|
||||
image: "{{ .Values.redisSentinel.image.repository }}:{{ .Values.redisSentinel.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.redisSentinel.image.pullPolicy }}
|
||||
resources:
|
||||
{{- with .Values.redisSentinel.resources }}
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Values.existingSecret.enabled }}
|
||||
redisSecret:
|
||||
name: {{ .Values.existingSecret.name }}
|
||||
key: {{ .Values.existingSecret.key }}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
74
charts/redis-replication/values.yaml
Normal file
74
charts/redis-replication/values.yaml
Normal file
@@ -0,0 +1,74 @@
|
||||
# -- Override the name of the resources
|
||||
replicationNameOverride: ""
|
||||
sentinelNameOverride: ""
|
||||
|
||||
# -- Override the namespace of the chart
|
||||
namespaceOverride: ""
|
||||
|
||||
# -- Password
|
||||
existingSecret:
|
||||
enabled: false
|
||||
name: secret-name
|
||||
key: password
|
||||
|
||||
# -- Add additional labels
|
||||
additionalLabels: {}
|
||||
|
||||
# -- Redis Replication settings
|
||||
redisReplication:
|
||||
clusterSize: 3
|
||||
|
||||
# -- Security
|
||||
podSecurityContext:
|
||||
runAsUser: 1000
|
||||
fsGroup: 1000
|
||||
|
||||
# -- Image
|
||||
image:
|
||||
repository: quay.io/opstree/redis
|
||||
tag: v8.4.0
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
# -- Resources
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 128Mi
|
||||
|
||||
# -- Storage
|
||||
volumeClaimTemplate:
|
||||
spec:
|
||||
storageClassName: ceph-block
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
|
||||
# -- Metrics
|
||||
redisExporter:
|
||||
enabled: true
|
||||
image:
|
||||
repository: quay.io/opstree/redis-exporter
|
||||
tag: v1.80.1
|
||||
|
||||
# -- Redis Sentinel settings
|
||||
redisSentinel:
|
||||
enabled: false
|
||||
clusterSize: 3
|
||||
|
||||
# -- Security
|
||||
podSecurityContext:
|
||||
runAsUser: 1000
|
||||
fsGroup: 1000
|
||||
|
||||
# -- Image
|
||||
image:
|
||||
repository: quay.io/opstree/redis-sentinel
|
||||
tag: v8.4.0
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
# -- Resources
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 128Mi
|
||||
Reference in New Issue
Block a user