Skip to content

Commit

Permalink
wip: catalog-db
Browse files Browse the repository at this point in the history
  • Loading branch information
nleconte-csgroup committed Mar 11, 2024
1 parent 679db39 commit 88c7054
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/rs-server-catalog-db/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
7 changes: 7 additions & 0 deletions charts/rs-server-catalog-db/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
appVersion: {{CHART_VERSION}}
description: RS SERVER CATALOG DB
name: rs-server-catalog-db
version: {{CHART_VERSION}}
maintainers:
- name: CS GROUP
4 changes: 4 additions & 0 deletions charts/rs-server-catalog-db/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ .Chart.Name }}
======

This is a chart for the installation of {{ .Release.Name }} in version {{ .Chart.Version}}
101 changes: 101 additions & 0 deletions charts/rs-server-catalog-db/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: {{ .Release.Name }}
namespace: {{ .Values.namespace }}
generation: 1
labels:
app: {{ .Release.Name }}
annotations:
deployment.kubernetes.io/revision: '1'
spec:
selector:
matchLabels:
app: {{ .Release.Name }}
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 100%
maxUnavailable: 50%
template:
metadata:
name: {{ .Release.Name }}
labels:
app: {{ .Release.Name }}
type: {{ .Values.namespace }}
spec:
terminationGracePeriodSeconds: 30
containers:
- name: {{ .Release.Name }}
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.PullPolicy }}
resources:
requests:
memory: {{ .Values.resources.request.ram }}
cpu: {{ .Values.resources.request.cpu }}
limits:
memory: {{ .Values.resources.limit.ram }}
cpu: {{ .Values.resources.limit.cpu }}
ports:
- name: web
protocol: TCP
containerPort: 5432
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: pgstac-pgdata
env:
- name: POSTGRES_PORT
value: {{ .Values.postgres.port | quote }}
- name: POSTGRES_DB
value: {{ .Values.postgres.db }}
- name: POSTGRES_HOST
value: {{ .Values.postgres.host }}
- name: PGDATABASE
value: {{ .Values.postgres.db }}
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-postgres
key: user
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-postgres
key: pass
- name: PGUSER
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-postgres
key: user
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-postgres
key: pass
securityContext:
privileged: false
#livenessProbe:
# httpGet:
# path: {{ .Values.probe.liveness.path }}
# port: {{ .Values.probe.liveness.port }}
# initialDelaySeconds: {{ .Values.probe.liveness.initialDelaySeconds }}
# periodSeconds: {{ .Values.probe.liveness.periodSeconds }}
# timeoutSeconds: {{ .Values.probe.liveness.timeoutSeconds }}
#readinessProbe:
# httpGet:
# path: {{ .Values.probe.readiness.path }}
# port: {{ .Values.probe.readiness.port }}
# initialDelaySeconds: {{ .Values.probe.readiness.initialDelaySeconds }}
# periodSeconds: {{ .Values.probe.readiness.periodSeconds }}
# timeoutSeconds: {{ .Values.probe.readiness.timeoutSeconds }}
#imagePullSecrets:
#- name: {{ .Values.image.imagePullSecrets }}
restartPolicy: Always
securityContext: {}
volumes:
- name: pgstac-pgdata
persistentVolumeClaim:
claimName: {{ .Release.Name }}-pvc
readOnly: false
revisionHistoryLimit: 10
9 changes: 9 additions & 0 deletions charts/rs-server-catalog-db/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-postgres
namespace: {{ .Values.namespace }}
type: Opaque
data:
user: {{ .Values.postgres.secret.user | b64enc | quote }}
pass: {{ .Values.postgres.secret.pass | b64enc | quote }}
14 changes: 14 additions & 0 deletions charts/rs-server-catalog-db/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
kind: Service
apiVersion: v1
metadata:
name: {{ .Release.Name }}-svc
labels:
app: {{ .Release.Name }}-svc
spec:
selector:
app: {{ .Release.Name }}
ports:
- name: {{ .Release.Name }}-service
protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.port }}
11 changes: 11 additions & 0 deletions charts/rs-server-catalog-db/templates/volume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}-pvc
spec:
accessModes:
- {{ .Values.volume.accessModes }}
resources:
requests:
storage: {{ .Values.volume.size }}
storageClassName: {{ .Values.volume.storageClassName }}
47 changes: 47 additions & 0 deletions charts/rs-server-catalog-db/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
namespace: database

service:
port: 5432

#probe:
# liveness:
# path: /health/_mgmt/ping
# port: 8000
# initialDelaySeconds: 30
# periodSeconds: 30
# timeoutSeconds: 5
# readiness:
# path: /health/_mgmt/ping
# port: 8000
# initialDelaySeconds: 30
# periodSeconds: 30
# timeoutSeconds: 5

postgres:
port: "5432"
db: catalog
host: catalog-db.database.svc.cluster.local
secret:
user: postgres
pass: password

image:
registry: ghcr.io
repository: stac-utils
name: pgstac
tag: v0.7.10
PullPolicy: IfNotPresent
#imagePullSecrets: regcred

resources:
request:
ram: "256Mi"
cpu: "100m"
limit:
ram: "1000Mi"
cpu: "500m"

volume:
size: "20Gi"
accessModes: ReadWriteOnce
storageClassName: csi-cinder-sc-retain

0 comments on commit 88c7054

Please sign in to comment.