Skip to content

Commit

Permalink
Persist restarts (#176)
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Sanford <[email protected]>
  • Loading branch information
jessesanford authored Mar 18, 2024
1 parent 11ac1d5 commit 54cd46a
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 5 deletions.
11 changes: 11 additions & 0 deletions examples/ref-implementation/backstage/manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,17 @@ spec:
requests:
cpu: 100m
memory: 300Mi
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: "500Mi"
---
apiVersion: generators.external-secrets.io/v1alpha1
kind: Password
Expand Down
19 changes: 17 additions & 2 deletions examples/ref-implementation/keycloak/manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ spec:
env:
- name: KEYCLOAK_ADMIN
value: cnoe-admin
- name: KEYCLOAK_LOGLEVEL
value: ALL
- name: QUARKUS_TRANSACTION_MANAGER_ENABLE_RECOVERY
value: 'true'
envFrom:
- secretRef:
name: keycloak-config
Expand Down Expand Up @@ -73,8 +77,7 @@ data:
db=postgres
# The username of the database user.
db-username=keycloak
db-url-host=postgresql.keycloak.svc.cluster.local
db-url=jdbc:postgresql://postgresql.keycloak.svc.cluster.local:5432/postgres
# The proxy address forwarding mode if the server is behind a reverse proxy.
proxy=edge
Expand Down Expand Up @@ -147,3 +150,15 @@ spec:
requests:
cpu: 100m
memory: 300Mi
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: "500Mi"

Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ spec:
engineVersion: v2
data:
KEYCLOAK_ADMIN_PASSWORD: "{{.KEYCLOAK_ADMIN_PASSWORD}}"
KC_DB_PASSWORD: "{{.KC_DB_PASSWORD}}"
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: "{{.KC_DB_PASSWORD}}"
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: "{{.KC_DB_PASSWORD}}"
Expand Down
8 changes: 8 additions & 0 deletions hack/gitea/generate-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,13 @@ helm repo update
helm template my-gitea gitea-charts/gitea -f ${GITEA_DIR}/values.yaml --version ${CHART_VERSION} >> ${INSTALL_YAML}
sed -i '3d' ${INSTALL_YAML}

# helm template for pvc uses Release.namespace which doesn't get set
# when running the helm "template" command
# See: https://gitea.com/gitea/helm-chart/issues/630
# and: https://gitea.com/gitea/helm-chart/src/commit/3b2b700441e91a19a535e05de3a9eab2fef0b117/templates/gitea/pvc.yaml#L6
# and: https://github.com/helm/helm/issues/3553#issuecomment-1186518158
# and: https://github.com/splunk/splunk-connect-for-kubernetes/pull/790
sed -i 's/namespace: default/namespace: gitea/g' ${INSTALL_YAML}

cat ${GITEA_DIR}/ingress.yaml.tmpl >> ${INSTALL_YAML}
cat ${GITEA_DIR}/gitea-creds.yaml >> ${INSTALL_YAML}
3 changes: 2 additions & 1 deletion hack/gitea/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ postgresql-ha:
enabled: false

persistence:
enabled: false
enabled: true
size: 5Gi

test:
enabled: false
Expand Down
19 changes: 18 additions & 1 deletion pkg/controllers/localbuild/resources/gitea/k8s/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,22 @@ stringData:
echo '==== END GITEA CONFIGURATION ===='
---
# Source: gitea/templates/gitea/pvc.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: gitea-shared-storage
namespace: gitea
annotations:
helm.sh/resource-policy: keep
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 5Gi
---
# Source: gitea/templates/gitea/http-svc.yaml
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -551,7 +567,8 @@ spec:
- name: temp
emptyDir: {}
- name: data
emptyDir: {}
persistentVolumeClaim:
claimName: gitea-shared-storage
{{- if .UsePathRouting }}
---
apiVersion: networking.k8s.io/v1
Expand Down

0 comments on commit 54cd46a

Please sign in to comment.