Compare commits
7 Commits
gh-pages
...
postgres-c
Author | SHA1 | Date | |
---|---|---|---|
41282e79e8 | |||
ffcaf51b66 | |||
30d69f695c | |||
c5feb14abc | |||
5665d7a99f | |||
5158f9f66c | |||
e9bed237bf |
45
.github/workflows/lint-test.yaml
vendored
Normal file
45
.github/workflows/lint-test.yaml
vendored
Normal 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
27
.github/workflows/release.yml
vendored
Normal 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 }}"
|
14
README.md
14
README.md
@@ -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.
|
||||||
|
@@ -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
|
||||||
|
@@ -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
|
||||||
|
@@ -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
|
||||||
|
13
charts/postgres-cluster/Chart.yaml
Normal file
13
charts/postgres-cluster/Chart.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: postgres-cluster
|
||||||
|
version: 0.0.1
|
||||||
|
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
|
17
charts/postgres-cluster/README.md
Normal file
17
charts/postgres-cluster/README.md
Normal 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).
|
81
charts/postgres-cluster/templates/postgresql-cluster.yaml
Normal file
81
charts/postgres-cluster/templates/postgresql-cluster.yaml
Normal 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.postgresql.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 }}
|
17
charts/postgres-cluster/templates/scheduled-backup.yaml
Normal file
17
charts/postgres-cluster/templates/scheduled-backup.yaml
Normal 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"
|
37
charts/postgres-cluster/values.yaml
Normal file
37
charts/postgres-cluster/values.yaml
Normal 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: 128Mi
|
||||||
|
cpu: 100m
|
||||||
|
limits:
|
||||||
|
memory: 2Gi
|
||||||
|
cpu: 1500m
|
||||||
|
hugepages-2Mi: 512Mi
|
||||||
|
storage:
|
||||||
|
data:
|
||||||
|
storageClass: ceph-block
|
||||||
|
size: 10Gi
|
||||||
|
wal:
|
||||||
|
storageClass: ceph-block
|
||||||
|
size: 2Gi
|
||||||
|
boostrap:
|
||||||
|
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
|
Reference in New Issue
Block a user