Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emeis/alexandria service #21

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions charts/caluma/templates/alexandria-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "caluma.fullname" . }}-alexandria
labels:
{{- include "caluma.labels" . | nindent 4 }}
app.kubernetes.io/component: alexandria
spec:
replicas: {{ .Values.alexandria.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "caluma.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: alexandria
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "caluma.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: alexandria
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.alexandria.image.repository }}:{{ .Values.alexandria.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.alexandria.image.pullPolicy }}
env:
- name: DATABASE_HOST
{{- if and .Values.postgresql.enabled .Values.backend.postgresql.existingHost }}
{{ fail "postgresql.enabled and backend.postgresql.existingHost are mutually exclusive, please pick one" }}
{{- end }}
{{- if .Values.postgresql.enabled }}
value: "{{ template "caluma.fullname" . }}-postgresql"
{{- else if .Values.backend.postgresql.existingHost }}
value: {{ .Values.backend.postgresql.existingHost | quote }}
{{- else }}
{{ fail "neither postgresql.enabled or backend.postgresql.existingHost are set, please pick one" }}
{{- end }}
- name: DATABASE_USER
{{- if .Values.postgresql.enabled }}
value: "{{ .Values.postgresql.global.postgresql.auth.username }}"
{{- else }}
value: "{{ .Values.alexandria.postgresql.username }}"
{{- end }}
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
{{- if .Values.postgresql.enabled }}
name: "{{ template "caluma.fullname" . }}-postgresql"
key: password
{{- else }}
name: "{{ .Values.alexandria.postgresql.existingSecret }}"
key: "{{ .Values.alexandria.postgresql.existingSecretKey }}"
{{- end }}
{{- if .Values.alexandria.additionalEnvironment }}
{{ toYaml .Values.alexandria.additionalEnvironment | indent 12 }}
{{- end }}
ports:
- name: alexandria
containerPort: 8000
protocol: TCP
18 changes: 18 additions & 0 deletions charts/caluma/templates/alexandria-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "caluma.fullname" . }}-alexandria
labels:
{{ include "caluma.labels" . | indent 4 }}
app.kubernetes.io/component: alexandria
spec:
type: {{ .Values.alexandria.service.type }}
ports:
- port: 8000
targetPort: alexandria
protocol: TCP
name: alexandria
selector:
app.kubernetes.io/name: {{ include "caluma.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: alexandria
60 changes: 60 additions & 0 deletions charts/caluma/templates/emeis-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "caluma.fullname" . }}-emeis
labels:
{{- include "caluma.labels" . | nindent 4 }}
app.kubernetes.io/component: emeis
spec:
replicas: {{ .Values.emeis.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "caluma.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: emeis
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "caluma.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: emeis
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.emeis.image.repository }}:{{ .Values.emeis.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.emeis.image.pullPolicy }}
env:
- name: DATABASE_HOST
{{- if and .Values.postgresql.enabled .Values.backend.postgresql.existingHost }}
{{ fail "postgresql.enabled and backend.postgresql.existingHost are mutually exclusive, please pick one" }}
{{- end }}
{{- if .Values.postgresql.enabled }}
value: "{{ template "caluma.fullname" . }}-postgresql"
{{- else if .Values.backend.postgresql.existingHost }}
value: {{ .Values.backend.postgresql.existingHost | quote }}
{{- else }}
{{ fail "neither postgresql.enabled or backend.postgresql.existingHost are set, please pick one" }}
{{- end }}
- name: DATABASE_USER
{{- if .Values.postgresql.enabled }}
value: "{{ .Values.postgresql.global.postgresql.auth.username }}"
{{- else }}
value: "{{ .Values.emeis.postgresql.username }}"
{{- end }}
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
{{- if .Values.postgresql.enabled }}
name: "{{ template "caluma.fullname" . }}-postgresql"
key: password
{{- else }}
name: "{{ .Values.emeis.postgresql.existingSecret }}"
key: "{{ .Values.emeis.postgresql.existingSecretKey }}"
{{- end }}
{{- if .Values.emeis.additionalEnvironment }}
{{ toYaml .Values.emeis.additionalEnvironment | indent 12 }}
{{- end }}
ports:
- name: emeis
containerPort: 8000
protocol: TCP
18 changes: 18 additions & 0 deletions charts/caluma/templates/emeis-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "caluma.fullname" . }}-emeis
labels:
{{ include "caluma.labels" . | indent 4 }}
app.kubernetes.io/component: emeis
spec:
type: {{ .Values.emeis.service.type }}
ports:
- port: 8000
targetPort: emeis
protocol: TCP
name: emeis
selector:
app.kubernetes.io/name: {{ include "caluma.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: emeis
45 changes: 45 additions & 0 deletions charts/caluma/templates/ingress-alexandria.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "caluma.fullname" . -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-alexandria
labels:
{{ include "caluma.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
nginx.ingress.kubernetes.io/rewrite-target: "/$2"
{{- end }}
spec:
{{- 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:
- path: /alexandria/api
pathType: Prefix
backend:
service:
name: {{ $fullName }}-alexandria
port:
number: 8000
- path: /alexandria(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: {{ $fullName }}-alexandria
port:
number: 8000
{{- end }}
{{- end }}
45 changes: 45 additions & 0 deletions charts/caluma/templates/ingress-emeis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "caluma.fullname" . -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-emeis
labels:
{{ include "caluma.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
nginx.ingress.kubernetes.io/rewrite-target: "/$2"
{{- end }}
spec:
{{- 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:
- path: /emeis/api
pathType: Prefix
backend:
service:
name: {{ $fullName }}-emeis
port:
number: 8000
- path: /emeis(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: {{ $fullName }}-emeis
port:
number: 8000
{{- end }}
{{- end }}
81 changes: 75 additions & 6 deletions charts/caluma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,88 @@ backend:
## this can only be used if postgresql.enabled is set to false
existingHost: ""

alexandria:
additionalEnvironment:
- name: SECRET_KEY
value: demo
- name: ALLOWED_HOSTS
value: "*"
- name: ENV
value: production
- name: ALLOW_ANONYMOUS_WRITE
value: "true"
- name: LANGUAGES
value: "de,en"
- name: VISIBILITY_CLASSES
value: ""
- name: PERMISSION_CLASSES
value: ""
## Specify additional environment variables for the backend deployment just
## like you would define them directly on the container spec.
## ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
# - name: EXAMPLE
# value: example
image:
repository: ghcr.io/projectcaluma/alexandria
tag: 2.2.0
pullPolicy: IfNotPresent
replicaCount: 1
postgresql:
username: ""
existingSecret: ""
existingSecretKey: ""
service:
type: ClusterIP

emeis:
additionalEnvironment:
- name: SECRET_KEY
value: demo
- name: ALLOWED_HOSTS
value: "*"
- name: ENV
value: production
- name: ALLOW_ANONYMOUS_WRITE
value: "true"
- name: LANGUAGES
value: "de,en"
- name: VISIBILITY_CLASSES
value: ""
- name: PERMISSION_CLASSES
value: ""
## Specify additional environment variables for the backend deployment just
## like you would define them directly on the container spec.
## ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
# - name: EXAMPLE
# value: example
image:
repository: ghcr.io/projectcaluma/emeis
tag: 1.2.2
pullPolicy: IfNotPresent
replicaCount: 1
postgresql:
username: ""
existingSecret: ""
existingSecretKey: ""
service:
type: ClusterIP

ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
annotations:
#cert-manager.io/cluster-issuer: letsencrypt-prod
#nginx.ingress.kubernetes.io/backend-protocol: HTTP
#nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
#nginx.ingress.kubernetes.io/ssl-passthrough: "false"
#kubernetes.io/tls-acme: "true"

hosts:
- host: caluma.chart-example.local

tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
#- secretName: chart-example-tls
# hosts:
# - chart-example.local

resources: {}
## We usually recommend not to specify default resources and to leave this as a conscious
Expand Down
Loading