Skip to content

Commit

Permalink
fix deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinOehlerkingCap committed Aug 1, 2024
1 parent c131c4c commit c9b497a
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ansible/group_vars/all/shd-client.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
---
PORT: 4100
SHD_CLIENT_IMAGE: quay.io/schulcloudverbund/shd-client
SHD_CLIENT_PREFIX: dashboard2.
2 changes: 2 additions & 0 deletions ansible/group_vars/develop/shd-client.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
---
PORT: 4100
SHD_CLIENT_IMAGE: ghcr.io/hpi-schul-cloud/shd-client
SHD_CLIENT_PREFIX: shd2-
6 changes: 6 additions & 0 deletions ansible/roles/shd-client-core/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: deployment.yml.j2

- name: Ingress
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: ingress.yml.j2
2 changes: 1 addition & 1 deletion ansible/roles/shd-client-core/templates/configmap.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ data:
# general
NODE_ENV: "production"
TZ: "Europe/Berlin"
API_URL: {{ API_URL }}
API_URL: "https://{{ DOMAIN }}/api"
40 changes: 40 additions & 0 deletions ansible/roles/shd-client-core/templates/ingress.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#jinja2: trim_blocks: "True", lstrip_blocks: "True"
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ NAMESPACE }}-shd-client-ingress
namespace: {{ NAMESPACE }}
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "{{ TLS_ENABLED|default("false") }}"
# type of authentication
nginx.ingress.kubernetes.io/auth-type: basic
# name of the secret that contains the user/password definitions
nginx.ingress.kubernetes.io/auth-secret: shd-basic-auth-secret
# message to display with an appropriate context why the authentication is required
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required'
{% if CLUSTER_ISSUER is defined %}
cert-manager.io/cluster-issuer: {{ CLUSTER_ISSUER }}
{% endif %}

spec:
ingressClassName: {{ INGRESS_CLASS }}
{% if CLUSTER_ISSUER is defined or (TLS_ENABLED is defined and TLS_ENABLED|bool) %}
tls:
- hosts:
- {{ SHD_CLIENT_PREFIX }}{{ DOMAIN }}
{% if CLUSTER_ISSUER is defined %}
secretName: {{ SHD_CLIENT_PREFIX }}{{ DOMAIN }}-tls
{% endif %}
{% endif %}
rules:
- host: {{ SHD_CLIENT_PREFIX }}{{ DOMAIN }}
http:
paths:
### SHD
- path: /
pathType: Prefix
backend:
service:
name: shd-client-svc
port:
number: {{ PORT }}
2 changes: 1 addition & 1 deletion ansible/roles/shd-client-core/templates/svc.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
spec:
type: ClusterIP
ports:
- port: 4100
- port: {{ PORT }}
targetPort: 4100
protocol: TCP
name: shd-client
Expand Down

0 comments on commit c9b497a

Please sign in to comment.