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

[Part of #177] Feature: refector nginx deployment #195

2 changes: 1 addition & 1 deletion charts/geonode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,4 @@ Helm Chart for Geonode. Supported versions: Geonode: 4.3.0, Geoserver: 2.24.3-v1
| rabbitmq.requests.memory | string | `"1Gi"` | requested memory as in resource.requests.memory (https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
35 changes: 19 additions & 16 deletions charts/geonode/templates/nginx/nginx-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,6 @@ data:
alias /mnt/volumes/statics/static/img/favicon.ico;
}

# GeoServer
location /geoserver {
client_max_body_size {{ .Values.nginx.maxClientBodySize }};

{{- if .Values.nginx.external_cors.enabled }}
proxy_set_header Access-Control-Allow-Origin {{ .Values.nginx.external_cors.domain }};
{{ end }}
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://{{ include "geoserver_pod_name" . }}:{{ .Values.geoserver.port }};
}

# GeoNode
location /static/ {
Expand Down Expand Up @@ -119,7 +106,23 @@ data:
proxy_http_version 1.1;
}

{{ if .Values.pycsw.enabled }}

{{if (eq .Values.geonode.ingress.enabled false) }}
# GeoServer
location /geoserver {
client_max_body_size {{ .Values.nginx.maxClientBodySize }};

{{- if .Values.nginx.external_cors.enabled }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may consider removing CORS config at nginx completely, just in favor of configuring CORS via django-cors-headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexGacon any opinion on that from your side?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be a solution, even if it implies having custom code on the geonode side if required (but since we now support GeoNode projects, it sounds possible)

proxy_set_header Access-Control-Allow-Origin {{ .Values.nginx.external_cors.domain }};
{{ end }}
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://{{ include "geoserver_pod_name" . }}:{{ .Values.geoserver.port }};
}

{{ if .Values.pycsw.enabled }}
# external PYCSW forward
location {{ .Values.pycsw.endpoint }} {
client_max_body_size {{ .Values.nginx.maxClientBodySize }};
Expand All @@ -142,8 +145,8 @@ data:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
{{ end }}

{{ end }}
{{ end }}
location / {
client_max_body_size {{ .Values.nginx.maxClientBodySize }};

Expand Down
20 changes: 18 additions & 2 deletions charts/geonode/templates/nginx/nginx-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,29 @@ spec:
- host: {{ .Values.geonode.general.externalDomain }}
http:
paths:
- pathType: Prefix
path: "/"
- path: "/"
pathType: Prefix
backend:
service:
name: "{{ include "nginx_pod_name" . }}"
port:
number: 80
- path: "/geoserver"
pathType: Prefix
backend:
service:
name: "{{ include "geoserver_pod_name" . }}"
port:
number: {{ .Values.geoserver.port }}
{{ if .Values.pycsw.enabled }}
- path: {{ .Values.pycsw.endpoint }}
pathType: Prefix
backend:
service:
name: "{{ include "pycsw_pod_name" . }}"
port:
number: 8000
{{ end }}

---

Expand Down
8 changes: 3 additions & 5 deletions charts/geonode/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,10 @@ geoserver:
admin_password: geoserver
# -- additional elements to include in the secret provided to GeoServer, if not using an existing secret
extraSecrets: |
# key_1: value_1

# key_1: value_1
# -- additional elements to include in the config map provided to GeoServer
extraConfigMap: |
# file_1: conf content

# file_1: conf content
# -- Define this for extra GeoServer environment variables
# Format:
# extraPodEnv: |
Expand Down Expand Up @@ -564,7 +562,7 @@ pycsw:
# ogc_schemas_base=
# federatedcatalogues=
# pretty_print=
gzip_compresslevel=1
gzip_compresslevel=0
# domainquerytype=
# domaincounts=
# spatial_ranking=
Expand Down
Loading