Compare commits

...

9 Commits

Author SHA1 Message Date
466b67581f raise default memory request 2024-02-12 19:33:50 -07:00
031b1dec3a fix linting 2024-02-10 11:34:47 -07:00
41282e79e8 add postgres-cluster 2024-02-10 11:12:38 -07:00
ffcaf51b66 add envFrom 2024-02-10 04:08:58 -07:00
30d69f695c change readme 2024-02-10 03:32:06 -07:00
c5feb14abc change names 2024-02-10 03:17:12 -07:00
5665d7a99f add lint 2024-02-10 03:13:00 -07:00
5158f9f66c update release workflow 2024-02-10 03:11:14 -07:00
e9bed237bf add example workflow 2024-02-10 03:00:58 -07:00
11 changed files with 256 additions and 2 deletions

45
.github/workflows/lint-test.yaml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: lint-and-test-charts
on: pull_request
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.13.3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
check-latest: true
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.0
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.8.0
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}

27
.github/workflows/release.yml vendored Normal file
View File

@@ -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@v3
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 }}"

View File

@@ -1,9 +1,21 @@
# Welcome
Welcome to the documentation for the [alexlebens's Helm charts](https://github.com/alexlebens/helm-charts).
## Getting started ## Getting started
[Helm](https://helm.sh) must be installed to use the charts in this repository. [Helm](https://helm.sh) must be installed to use the charts in this repository.
Refer to Helm's [documentation](https://helm.sh/docs/) to get started. Refer to Helm's [documentation](https://helm.sh/docs/) to get started.
## Installation
```sh
helm repo add alexlebens http://alexlebens.github.io/helm-charts/
```
You can then run `helm search repo alexlebens` to search the charts.
## License ## License
This project is licensed under the terms of the Apache 2.0 License license. This project is licensed under the terms of the Apache 2.0 License license.

View File

@@ -1,6 +1,6 @@
apiVersion: v2 apiVersion: v2
name: homepage name: homepage
version: 0.0.1 version: 0.0.2
description: Chart for benphelps homepage description: Chart for benphelps homepage
keywords: keywords:
- dashboard - dashboard

View File

@@ -40,6 +40,10 @@ spec:
- name: {{ $k }} - name: {{ $k }}
value: {{ $v | quote }} value: {{ $v | quote }}
{{- end }} {{- end }}
{{- with .Values.deployment.envFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts: volumeMounts:
- name: homepage-config - name: homepage-config
subPath: bookmarks.yaml subPath: bookmarks.yaml

View File

@@ -6,6 +6,7 @@ deployment:
tag: v0.8.7 tag: v0.8.7
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
env: env:
envFrom:
resources: resources:
requests: requests:
memory: 50Mi memory: 50Mi

View File

@@ -0,0 +1,13 @@
apiVersion: v2
name: postgres-cluster
version: 0.0.3
description: Chart for cloudnative-pg cluster
keywords:
- database
- postgres
sources:
- https://github.com/cloudnative-pg/cloudnative-pg
maintainers:
- name: alexlebens
icon: https://avatars.githubusercontent.com/u/100373852?s=48&v=4
appVersion: v1.22.1

View File

@@ -0,0 +1,17 @@
## Introduction
[CloudNative PG](https://github.com/cloudnative-pg/cloudnative-pg)
CloudNativePG is the Kubernetes operator that covers the full lifecycle of a highly available PostgreSQL database cluster with a primary/standby architecture, using native streaming replication.
This chart bootstraps a [CNPG](https://github.com/cloudnative-pg/cloudnative-pg) cluster on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
## Prerequisites
- Kubernetes
- Helm
- CloudNative PG Operator
## Parameters
See the [values files](values.yaml).

View File

@@ -0,0 +1,81 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: "postgresql-{{ .Release.Name }}-cluster"
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: postgresql
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: database
app.kubernetes.io/part-of: {{ .Release.Name }}
app.kubernetes.io/managed-by: helm
spec:
instances: {{ .Values.cluster.instances }}
replicationSlots:
highAvailability:
enabled: true
affinity:
enablePodAntiAffinity: true
topologyKey: kubernetes.io/hostname
postgresql:
parameters:
{{- toYaml .Values.cluster.parameters | nindent 6 }}
resources:
{{- toYaml .Values.cluster.resources | nindent 4 }}
storage:
storageClass: {{ .Values.cluster.storage.data.storageClass }}
size: {{ .Values.cluster.storage.data.size }}
walStorage:
storageClass: {{ .Values.cluster.storage.wal.storageClass }}
size: {{ .Values.cluster.storage.wal.size }}
monitoring:
enablePodMonitor: true
{{- if .Values.bootstrap.initdbEnabled }}
bootstrap:
initdb:
{{- toYaml .Values.bootstrap.initdb | nindent 6 }}
{{- end }}
{{- if .Values.backup.recoveryEnabled }}
bootstrap:
recovery:
source: "postgresql-{{ .Release.Name }}-cluster-recovery-index-{{ .Values.backup.recoveryIndex }}"
externalClusters:
- name: "postgresql-{{ .Release.Name }}-cluster-recovery-index-{{ .Values.backup.recoveryIndex }}"
barmanObjectStore:
endpointURL: {{ .Values.backup.endpointURL }}
destinationPath: "s3://{{ .Values.backup.bucket }}/{{ .Values.cluster.name }}/postgresql/{{ .Release.Name }}-cluster"
s3Credentials:
accessKeyId:
name: "postgresql-{{ .Release.Name }}-cluster-backup-secret"
key: ACCESS_KEY_ID
secretAccessKey:
name: "postgresql-{{ .Release.Name }}-cluster-backup-secret"
key: ACCESS_SECRET_KEY
data:
compression: {{ .Values.backup.compression }}
wal:
compression: {{ .Values.backup.compression }}
{{- end }}
{{- if .Values.backup.backupEnabled }}
backup:
retentionPolicy: "{{ .Values.backup.retentionPolicy }}"
barmanObjectStore:
destinationPath: "s3://{{ .Values.backup.bucket }}/{{ .Values.cluster.name }}/postgresql/{{ .Release.Name }}-cluster"
endpointURL: {{ .Values.backup.endpointURL }}
serverName: "postgresql-{{ .Release.Name }}-cluster-backup-index-{{ .Values.backup.backupIndex }}"
s3Credentials:
accessKeyId:
name: "postgresql-{{ .Release.Name }}-cluster-backup-secret"
key: ACCESS_KEY_ID
secretAccessKey:
name: "postgresql-{{ .Release.Name }}-cluster-backup-secret"
key: ACCESS_SECRET_KEY
data:
compression: {{ .Values.backup.compression }}
wal:
compression: {{ .Values.backup.compression }}
{{- end }}

View File

@@ -0,0 +1,17 @@
apiVersion: postgresql.cnpg.io/v1
kind: ScheduledBackup
metadata:
name: "postgresql-{{ .Release.Name }}-cluster-backup"
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: postgresql
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: database
app.kubernetes.io/part-of: {{ .Release.Name }}
app.kubernetes.io/managed-by: helm
spec:
schedule: {{ .Values.backup.schedule }}
backupOwnerReference: self
cluster:
name: "postgresql-{{ .Release.Name }}-cluster"

View File

@@ -0,0 +1,37 @@
cluster:
name: cl01tl
instances: 2
parameters:
shared_buffers: 128MB
max_slot_wal_keep_size: 2000MB
hot_standby_feedback: "on"
resources:
requests:
memory: 512Mi
cpu: 100m
limits:
memory: 2Gi
cpu: 1500m
hugepages-2Mi: 512Mi
storage:
data:
storageClass: ceph-block
size: 10Gi
wal:
storageClass: ceph-block
size: 2Gi
bootstrap:
initdbEnabled: false
initdb:
database: app
owner: app
backup:
backupEnabled: true
recoveryEnabled: false
schedule: "0 0 0 * * *"
retentionPolicy: 14d
backupIndex: 1
recoveryIndex: 1
endpointURL: https://nyc3.digitaloceanspaces.com
bucket: net-infra
compression: snappy