Add configurable ingress, rename all files to .yaml for conformity.

This commit is contained in:
Shane Lindsay
2024-09-29 23:22:54 -07:00
parent c62e37d16f
commit 005d53cce7
9 changed files with 81 additions and 10 deletions
@@ -5,12 +5,12 @@ on:
branches: [ main ] branches: [ main ]
paths: paths:
- 'charts/**' - 'charts/**'
- '.github/workflows/helm-chart-ci-cd.yml' - '.github/workflows/helm-chart-ci-cd.yaml'
pull_request: pull_request:
branches: [ main ] branches: [ main ]
paths: paths:
- 'charts/**' - 'charts/**'
- '.github/workflows/helm-chart-ci-cd.yml' - '.github/workflows/helm-chart-ci-cd.yaml'
release: release:
types: [created] types: [created]
+25 -5
View File
@@ -50,6 +50,13 @@ The following table lists the configurable parameters of the Postiz chart and th
| `postgresql.auth.database` | PostgreSQL database | `postiz` | | `postgresql.auth.database` | PostgreSQL database | `postiz` |
| `redis.enabled` | Deploy Redis | `true` | | `redis.enabled` | Deploy Redis | `true` |
| `redis.auth.password` | Redis password | `postiz-redis-password` | | `redis.auth.password` | Redis password | `postiz-redis-password` |
| `ingress.enabled` | Enable ingress controller resource | `false` |
| `ingress.className` | IngressClass that will be be used | `""` |
| `ingress.annotations` | Ingress annotations | `{}` |
| `ingress.hosts` | Ingress hostnames | `[]` |
| `ingress.tls` | Ingress TLS configuration | `[]` |
| `ingress.path` | Path within the host | `/` |
| `ingress.pathType` | Ingress path type | `ImplementationSpecific` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
@@ -61,13 +68,26 @@ $ helm install postiz-app \
The above command sets the PostgreSQL password to `secretpassword`. The above command sets the PostgreSQL password to `secretpassword`.
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, Alternatively, you can use a YAML file to specify the values while installing the chart. Create a file called `custom-values.yaml` (or any name you prefer) and specify your values:
```bash ```yaml
$ helm install postiz-app -f values.yaml postiz/postiz postgresql:
auth:
password: secretpassword
ingress:
enabled: true
hosts:
- host: postiz.example.com
``` ```
> **Tip**: You can use the default [values.yaml](values.yaml) Then, you can install the chart using the `-f` flag:
```bash
$ helm install postiz-app -f custom-values.yaml postiz/postiz
```
> **Tip**: You can use the default [values.yaml](values.yaml) as a starting point for your custom configuration.
## Persistence ## Persistence
@@ -95,4 +115,4 @@ We welcome contributions to this chart. Please read our [Contributing Guide](CON
## License ## License
This chart is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details. This chart is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details.
+1 -1
View File
@@ -2,7 +2,7 @@ apiVersion: v2
name: postiz-app name: postiz-app
description: A Social Media Scheduling App description: A Social Media Scheduling App
type: application type: application
version: 1.0.1 version: 1.0.2
appVersion: "1.3.0" appVersion: "1.3.0"
keywords: keywords:
- social media - social media
@@ -0,0 +1,44 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "postiz.fullname" . }}
labels:
{{- include "postiz.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ include "postiz.fullname" $ }}
port:
number: {{ .port }}
{{- end }}
{{- end }}
{{- if .Values.ingress.extraRules }}
{{- toYaml .Values.ingress.extraRules | nindent 4 }}
{{- end }}
{{- end }}
+9 -2
View File
@@ -25,15 +25,22 @@ service:
port: 80 port: 80
ingress: ingress:
enabled: false enabled: false # Disabled by default
className: "" className: ""
annotations: {} annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts: hosts:
- host: chart-example.local - host: chart-example.local
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific pathType: Prefix
port: 80
tls: [] tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
extraRules: []
resources: {} resources: {}