Skip to content

Commit

Permalink
Merge branch '18-add-ingress-resource' into 'gesis'
Browse files Browse the repository at this point in the history
Configure Ingress for Harbor

See merge request methods-hub/interactive-environment!25
  • Loading branch information
rgaiacs committed Jan 3, 2025
2 parents 14e1087 + a201407 commit 26aec89
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ansible/gesis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
hosts: kubernetes_control_panel
gather_facts: false
roles:
- harbor
- role: harbor
vars:
harbor_domain: '{{ HARBOR_DOMAIN }}'
harbor_path: '{{ HARBOR_PATH }}'
- name: Configure JupyterHub workers
hosts: jupyterhub_single_user
gather_facts: false
Expand Down
2 changes: 2 additions & 0 deletions ansible/inventories/gesis-acceptance
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ svko-k8s-test01
GRAFANA_CAPACITY_STORAGE=2Gi
JUPYTERHUB_CAPACITY_STORAGE=2Gi
PROMETHEUS_CAPACITY_STORAGE=15Gi
HARBOR_DOMAIN=notebooks.gesis.org
HARBOR_PATH='/'

[kubernetes_workers]
svko-k8s-test02
Expand Down
25 changes: 25 additions & 0 deletions ansible/roles/harbor/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
release_name: "{{ harbor_name }}"
release_namespace: "{{ harbor_namespace }}"
create_namespace: true
history_max: 3
values:
harborAdminPassword: "{{ HARBOR_ADMIN_PASSWORD }}"
expose:
Expand All @@ -174,3 +175,27 @@
storageClass: "{{ harbor_storage_class_name }}"
trivy:
storageClass: "{{ harbor_storage_class_name }}"

# Based on https://kubernetes.github.io/ingress-nginx/user-guide/basic-usage/
- name: Create a ingress resources
kubernetes.core.k8s:
state: present
definition:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: 'ingress-{{ harbor_name }}'
spec:
rules:
- host: '{{ harbor_domain }}'
http:
paths:
- path: '{{ harbor_path }}'
pathType: Prefix
backend:
service:
name: '{{ harbor_name }}'
port:
number: 80
# Don't change the ingressClassName
ingressClassName: nginx
2 changes: 2 additions & 0 deletions ansible/roles/harbor/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ harbor_registry_storage: 10Gi
harbor_redis_storage: 10Gi
harbor_trivy_storage: 10Gi
harbor_database_storage: 10Gi
harbor_domain: harbor.localhost
harbor_path: '/'

0 comments on commit 26aec89

Please sign in to comment.