Skip to content

Commit

Permalink
chore: simplify helm values (#56)
Browse files Browse the repository at this point in the history
* chore(chart): ingressClass -> publicAccess.ingress.class

* chore(chart): disable s3 by default

* chore(chart): move s3 settings to publicAccess block

* fix(chart): secretName variable path
  • Loading branch information
agrrh authored Sep 14, 2024
1 parent b1b56eb commit bd534f5
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 41 deletions.
12 changes: 6 additions & 6 deletions charts/pagetron/templates/common.ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ metadata:
app: pagetron
component: common
annotations:
{{- if eq $.Values.ingressClass "nginx" }}
{{- if eq $.Values.publicAccess.ingress.class "nginx" }}
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
{{- else if eq $.Values.ingressClass "traefik" }}
{{- else if eq $.Values.publicAccess.ingress.class "traefik" }}
traefik.ingress.kubernetes.io/router.middlewares: "{{ $.Release.Namespace }}-backend-strip-prefix@kubernetescrd"
{{- end }}

spec:
ingressClassName: {{ $.Values.ingressClass }}
ingressClassName: {{ $.Values.publicAccess.ingress.class }}
rules:
- host: {{ $.Values.publicUrl | trimPrefix "https://" | trimPrefix "http://" | quote }}
http:
paths:
{{- if eq $.Values.ingressClass "nginx" }}
{{- if eq $.Values.publicAccess.ingress.class "nginx" }}
- path: /api/(.*)
pathType: ImplementationSpecific
backend:
Expand All @@ -40,7 +40,7 @@ spec:
name: pagetron-frontend
port:
number: 80
{{- else if eq $.Values.ingressClass "traefik" }}
{{- else if eq $.Values.publicAccess.ingress.class "traefik" }}
- path: /
pathType: Prefix
backend:
Expand All @@ -57,7 +57,7 @@ spec:
number: 80
{{- end }}

{{- if eq $.Values.ingressClass "traefik" }}
{{- if eq $.Values.publicAccess.ingress.class "traefik" }}
---

apiVersion: traefik.containo.us/v1alpha1
Expand Down
10 changes: 5 additions & 5 deletions charts/pagetron/templates/publisher.cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,26 @@ spec:
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ .s3.secretName | quote }}
name: {{ $.Values.publicAccess.s3.secretName | quote }}
key: AWS_ACCESS_KEY_ID
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ .s3.secretName | quote }}
name: {{ $.Values.publicAccess.s3.secretName | quote }}
key: AWS_SECRET_ACCESS_KEY
- name: AWS_DEFAULT_REGION
valueFrom:
secretKeyRef:
name: {{ .s3.secretName | quote }}
name: {{ $.Values.publicAccess.s3.secretName | quote }}
key: AWS_DEFAULT_REGION
- name: AWS_ENDPOINT_URL_S3
valueFrom:
secretKeyRef:
name: {{ .s3.secretName | quote }}
name: {{ $.Values.publicAccess.s3.secretName | quote }}
key: AWS_ENDPOINT_URL_S3

- name: S3_BUCKET_NAME
value: {{ .s3.bucketName | quote }}
value: {{ $.Values.publicAccess.s3.bucketName | quote }}

command: ["/bin/ash"]
args:
Expand Down
11 changes: 6 additions & 5 deletions charts/pagetron/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ targets:
publicAccess:
ingress:
enabled: true

class: traefik

s3:
enabled: true

secretName: s3-publish-credentials
bucketName: pagetron-status-page

# May be a good idea to use nip.io and minikube, e.g.:
# publicUrl: http://pagetron.192-168-42-1.nip.io
# (know your minikube address with `minikube ip` command)
# ingressClass: nginx
publicUrl: https://pagetron-dev.agrrh.com
ingressClass: traefik

timezone: Europe/Moscow

Expand All @@ -30,6 +34,3 @@ frontend:

publisher:
schedule: "*/1 * * * *"

buildImage:
tag: 0.2.0-dev-1726335786
48 changes: 23 additions & 25 deletions charts/pagetron/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,31 @@ targets:
publicAccess:
ingress:
enabled: true

class: nginx
# class: traefik

s3:
enabled: true
enabled: false

publicUrl: "https://pagetron.example.org"
secretName: s3-publish-credentials
bucketName: my-bucket

# Supported classes:
# - nginx
# - traefik
ingressClass: nginx
# Secret example for AWS
# data:
# AWS_ACCESS_KEY_ID: ""
# AWS_SECRET_ACCESS_KEY: ""
# AWS_DEFAULT_REGION: ""
# AWS_ENDPOINT_URL_S3: ""

# Secret example for Yandex Cloud
# data:
# AWS_ACCESS_KEY_ID: ""
# AWS_SECRET_ACCESS_KEY: ""
# AWS_DEFAULT_REGION: "ru-central1"
# AWS_ENDPOINT_URL_S3: "https://storage.yandexcloud.net/"

publicUrl: "https://pagetron.example.org"

# May be changed to use external Prometheus
prometheusUrl: "http://prometheus:9090/"
Expand Down Expand Up @@ -119,25 +135,7 @@ backend:
tolerations: []

publisher:
schedule: "*/5 * * * *"

s3:
secretName: s3-publish-credentials
bucketName: pagetron-status-page

# Secret example for AWS
# data:
# AWS_ACCESS_KEY_ID: ""
# AWS_SECRET_ACCESS_KEY: ""
# AWS_DEFAULT_REGION: ""
# AWS_ENDPOINT_URL_S3: ""

# Secret example for Yandex Cloud
# data:
# AWS_ACCESS_KEY_ID: ""
# AWS_SECRET_ACCESS_KEY: ""
# AWS_DEFAULT_REGION: "ru-central1"
# AWS_ENDPOINT_URL_S3: "https://storage.yandexcloud.net/"
schedule: "*/15 * * * *"

buildImage:
repository: agrrh/pagetron-frontend-builder
Expand Down

0 comments on commit bd534f5

Please sign in to comment.