Skip to content

Commit 2101e80

Browse files
author
Rub21
committed
Add helm templates for taginfo
1 parent 48ac2b9 commit 2101e80

File tree

5 files changed

+129
-4
lines changed

5 files changed

+129
-4
lines changed

chartpress.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ charts:
3535
nominatim:
3636
valuesPath: nominatim.image
3737
overpass-api:
38-
valuesPath: overpassApi.image
38+
valuesPath: overpassApi.image
39+
taginfo:
40+
valuesPath: taginfo.image

images/taginfo/start.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ set_taginfo_config() {
1717
jq '.sources.db.bindir = "'$UPDATE_DIR'/build/src"' |
1818
jq '.paths.data_dir = "'$DATA_DIR'"' \
1919
>$WORKDIR/taginfo-config.json
20-
2120
# Update instance values in taginfo-config.json
2221
[[ ! -z ${INSTANCE_URL+z} ]] && jq --arg a "${INSTANCE_URL}" '.instance.url = $a' $WORKDIR/taginfo-config.json >tmp.json && mv tmp.json $WORKDIR/taginfo-config.json
2322
[[ ! -z $INSTANCE_NAME+z} ]] && jq --arg a "${INSTANCE_NAME}" '.instance.name = $a' $WORKDIR/taginfo-config.json >tmp.json && mv tmp.json $WORKDIR/taginfo-config.json
2423
[[ ! -z $INSTANCE_DESCRIPTION+z} ]] && jq --arg a "${INSTANCE_DESCRIPTION}" '.instance.description = $a' $WORKDIR/taginfo-config.json >tmp.json && mv tmp.json $WORKDIR/taginfo-config.json
2524
[[ ! -z $INSTANCE_ICON+z} ]] && jq --arg a "${INSTANCE_ICON}" '.instance.icon = $a' $WORKDIR/taginfo-config.json >tmp.json && mv tmp.json $WORKDIR/taginfo-config.json
2625
[[ ! -z $INSTANCE_CONTACT+z} ]] && jq --arg a "${INSTANCE_CONTACT}" '.instance.contact = $a' $WORKDIR/taginfo-config.json >tmp.json && mv tmp.json $WORKDIR/taginfo-config.json
27-
2826
# languages wiki databases will be downloaded from OSM
2927
[[ ! -z $DOWNLOAD_DB+z} ]] && jq --arg a "${DOWNLOAD_DB}" '.sources.download = $a' $WORKDIR/taginfo-config.json >tmp.json && mv tmp.json $WORKDIR/taginfo-config.json
3028
}

osm-seed/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v1
22
description: "Helm Chart to deploy the OpenStreetMap software"
33
name: osm-seed
4-
version: 0.1.0-n475.h5801ba4
4+
version: 0.1.0-n517.h48ac2b9
55

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{{- if .Values.taginfo.enabled -}}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ template "osm-seed.fullname" . }}-taginfo
6+
labels:
7+
app: {{ template "osm-seed.name" . }}
8+
component: web-deployment
9+
environment: {{ .Values.environment }}
10+
release: {{ .Release.Name }}
11+
spec:
12+
replicas: {{ .Values.taginfo.replicaCount }}
13+
selector:
14+
matchLabels:
15+
app: {{ template "osm-seed.name" . }}
16+
release: {{ .Release.Name }}
17+
run: {{ .Release.Name }}-taginfo
18+
template:
19+
metadata:
20+
labels:
21+
app: {{ template "osm-seed.name" . }}
22+
release: {{ .Release.Name }}
23+
run: {{ .Release.Name }}-taginfo
24+
spec:
25+
containers:
26+
- name: {{ .Chart.Name }}-taginfo
27+
image: "{{ .Values.taginfo.image.name }}:{{ .Values.taginfo.image.tag }}"
28+
ports:
29+
- name: http
30+
containerPort: 80
31+
protocol: TCP
32+
livenessProbe:
33+
httpGet:
34+
path: /
35+
port: 80
36+
initialDelaySeconds: 600 # 10 min, because the compile process takes time.
37+
timeoutSeconds: 30
38+
{{- if .Values.taginfo.resources.enabled }}
39+
resources:
40+
requests:
41+
memory: {{ .Values.taginfo.resources.requests.memory }}
42+
cpu: {{ .Values.taginfo.resources.requests.cpu }}
43+
limits:
44+
memory: {{ .Values.taginfo.resources.limits.memory }}
45+
cpu: {{ .Values.taginfo.resources.limits.cpu }}
46+
{{- end }}
47+
env:
48+
- name: URL_PLANET_FILE_STATE
49+
value: {{ .Values.taginfo.env.URL_PLANET_FILE_STATE }}
50+
- name: URL_PLANET_FILE
51+
value: {{ .Values.taginfo.env.URL_PLANET_FILE }}
52+
- name: URL_HISTORY_PLANET_FILE_STATE
53+
value: {{ .Values.taginfo.env.URL_HISTORY_PLANET_FILE_STATE }}
54+
- name: URL_HISTORY_PLANET_FILE
55+
value: {{ .Values.taginfo.env.URL_HISTORY_PLANET_FILE }}
56+
- name: INSTANCE_URL
57+
value: dns
58+
- name: INSTANCE_NAME
59+
value: {{ .Values.taginfo.env.INSTANCE_NAME }}
60+
- name: INSTANCE_DESCRIPTION
61+
value: {{ .Values.taginfo.env.INSTANCE_DESCRIPTION }}
62+
- name: INSTANCE_ICON
63+
value: {{ .Values.taginfo.env.INSTANCE_ICON }}
64+
- name: INSTANCE_CONTACT
65+
value: {{ .Values.taginfo.env.INSTANCE_CONTACT }}
66+
- name: TAGINFO_PROJECT_REPO
67+
value: {{ .Values.taginfo.env.TAGINFO_PROJECT_REPO }}
68+
- name: DOWNLOAD_DB
69+
value: {{ .Values.taginfo.env.DOWNLOAD_DB }}
70+
- name: CREATE_DB
71+
value: {{ .Values.taginfo.env.CREATE_DB }}
72+
{{- if .Values.taginfo.nodeSelector.enabled }}
73+
nodeSelector:
74+
{{ .Values.taginfo.nodeSelector.label_key }} : {{ .Values.taginfo.nodeSelector.label_value }}
75+
{{- end }}
76+
{{- end }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{{- if .Values.taginfo.enabled -}}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: {{ template "osm-seed.fullname" . }}-taginfo
6+
labels:
7+
app: {{ template "osm-seed.name" . }}
8+
component: taginfo-service
9+
environment: {{ .Values.environment }}
10+
release: {{ .Release.Name }}
11+
{{- if eq .Values.cloudProvider "aws" }}
12+
annotations:
13+
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300"
14+
{{- if .Values.AWS_SSL_ARN }}
15+
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: {{ .Values.AWS_SSL_ARN }}
16+
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
17+
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
18+
{{- end }}
19+
{{- end }}
20+
spec:
21+
# In case cloudProvider=aws
22+
{{- if eq .Values.cloudProvider "aws" }}
23+
type: LoadBalancer
24+
{{- end }}
25+
# In case cloudProvider=gcp
26+
{{- if eq .Values.cloudProvider "gcp" }}
27+
type: LoadBalancer
28+
loadBalancerIP : {{ .Values.taginfo.staticIp }}
29+
{{- end }}
30+
# In case cloudProvider=minikube
31+
{{- if eq .Values.cloudProvider "minikube" }}
32+
type: NodePort
33+
{{- end }}
34+
ports:
35+
- port: 80
36+
targetPort: http
37+
protocol: TCP
38+
name: http
39+
{{- if .Values.AWS_SSL_ARN }} #FIXME: make generic
40+
- port: 443
41+
targetPort: http
42+
protocol: TCP
43+
name: https
44+
{{- end }}
45+
selector:
46+
app: {{ template "osm-seed.name" . }}
47+
release: {{ .Release.Name }}
48+
run: {{ .Release.Name }}-taginfo
49+
{{- end }}

0 commit comments

Comments
 (0)