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

feat: Add stac-browser #168

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions helm-chart/eoapi/templates/services/nginx-doc-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ data:
<li><a href="/raster" target="_blank" rel="noopener noreferrer">/raster</a></li>
<li><a href="/vector" target="_blank" rel="noopener noreferrer">/vector</a></li>
<li><a href="/stac" target="_blank" rel="noopener noreferrer">/stac</a></li>
<li><a href="/browser/" target="_blank" rel="noopener noreferrer">/browser</a></li>
</ul>
</body>
</html>
Expand Down
59 changes: 59 additions & 0 deletions helm-chart/eoapi/templates/services/stac-browser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{{- if (and (.Values.browser.enabled) (not .Values.testing) (.Values.docServer.enabled))}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: browser-{{ .Release.Name }}
spec:
replicas: {{.Values.browser.replicaCount}}
selector:
matchLabels:
app: browser-{{ .Release.Name }}
template:
metadata:
labels:
app: browser-{{ .Release.Name }}
spec:
containers:
- name: browser
image: {{ .Values.browser.image.name }}:{{ .Values.browser.image.tag }}
ports:
- containerPort: 8080
env:
- name: SB_catalogUrl
value: "/stac"
- name: SB_prefixPath
value: "/browser"
---
apiVersion: v1
kind: Service
metadata:
name: browser-{{ .Release.Name }}
spec:
selector:
app: browser-{{ .Release.Name }}
ports:
- protocol: TCP
port: 8080
targetPort: 8080
---
# We need a separate ingress because browser does not play well with nginx rewrite_path directive
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: stac-browser-ingress
spec:
{{- if (and (.Values.ingress.className) (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion)) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
rules:
- http:
paths:
- pathType: Prefix
path: "/browser"
backend:
service:
name: browser-{{ $.Release.Name }}
port:
number: 8080

{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ data:
<li><a href="/raster" target="_blank" rel="noopener noreferrer">/raster</a></li>
<li><a href="/vector" target="_blank" rel="noopener noreferrer">/vector</a></li>
<li><a href="/stac" target="_blank" rel="noopener noreferrer">/stac</a></li>
<li><a href="/browser/" target="_blank" rel="noopener noreferrer">/browser</a></li>
</ul>
</body>
</html>
Expand Down
13 changes: 13 additions & 0 deletions helm-chart/eoapi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,5 +334,18 @@ vector:
# https://www.uvicorn.org/settings/#production
WEB_CONCURRENCY: "5"

######################
# STAC Browser
######################
# It is a good idea to deploy stac-browser outside of k8s, since it's SPA with static files.
# Please consider alternatives, such as cloud storage + CDN, for example
browser:
enabled: true
replicaCount: 1
image:
# we use a custom image that overrides pathPrefix value
name: ghcr.io/alekzvik/stac-browser-prefix
tag: 3.2.0

docServer:
enabled: true
2 changes: 1 addition & 1 deletion ingest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ else
fi

# Define namespaces
NAMESPACES=("default" "eoapi", "data-access")
NAMESPACES=("default" "eoapi" "data-access")
EOAPI_POD_RASTER=""
FOUND_NAMESPACE=""

Expand Down