Skip to content

Commit 84098b6

Browse files
Jorgen-5Jorgen-5
andauthored
Nais manifests for prod (#287)
* Nais manifests for everything except for klass mail. Also changed solr deploy to have input for the cluster to deploy to * Add klass mail --------- Co-authored-by: Jorgen-5 <rlj@ssb.no>
1 parent 69847f4 commit 84098b6

File tree

6 files changed

+259
-3
lines changed

6 files changed

+259
-3
lines changed

.github/workflows/klass-solr-deploy.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ name: Klass-solr deploy
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
cluster:
7+
description: "Which cluster to deploy to?"
8+
required: true
9+
default: "test"
10+
type: choice
11+
options:
12+
- test
13+
- prod
514

615
jobs:
716
deploy:
@@ -19,7 +28,7 @@ jobs:
1928
- name: Deploy to Nais
2029
uses: nais/deploy/actions/deploy@v2
2130
env:
22-
CLUSTER: test
23-
RESOURCE: .nais/test/klass-solr.yaml
31+
CLUSTER: ${{ github.event.inputs.cluster }}
32+
RESOURCE: .nais/${{ github.event.inputs.cluster }}/klass-solr.yaml
2433
WORKLOAD_IMAGE: europe-north1-docker.pkg.dev/${{ secrets.NAIS_MANAGEMENT_PROJECT_ID }}/dapla-metadata/klass-solr:5.5.2
25-
VAR: image=europe-north1-docker.pkg.dev/${{ secrets.NAIS_MANAGEMENT_PROJECT_ID }}/dapla-metadata/klass-solr:5.5.2
34+
VAR: image=europe-north1-docker.pkg.dev/${{ secrets.NAIS_MANAGEMENT_PROJECT_ID }}/dapla-metadata/klass-solr:5.5.2

.nais/prod/klass-api.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Deploy config for the prod cluster
2+
apiVersion: nais.io/v1alpha1
3+
kind: Application
4+
metadata:
5+
name: klass
6+
namespace: dapla-metadata
7+
labels:
8+
team: dapla-metadata
9+
spec:
10+
image: "{{ image }}" # Injected from the GitHub Action
11+
port: 8080
12+
13+
ingresses:
14+
- https://klass.intern.ssb.no
15+
16+
replicas:
17+
min: 1
18+
max: 1
19+
resources:
20+
requests:
21+
cpu: 400m
22+
memory: 1024Mi
23+
limits:
24+
memory: 2048Mi
25+
gcp:
26+
sqlInstances:
27+
- type: POSTGRES_17
28+
tier: db-custom-1-3840
29+
databases:
30+
- name: klass
31+
env:
32+
- name: SPRING_PROFILES_ACTIVE
33+
value: api, postgres, solr-remote, skip-indexing
34+
- name: SPRING_DATA_SOLR_HOST
35+
value: http://klass-solr/solr
36+
- name: KLASS_ENV_CLIENT_KLASS_MAIL_URL
37+
value: http://klass-mail
38+
39+
accessPolicy:
40+
outbound:
41+
rules:
42+
- application: klass-solr
43+
- application: klass-mail
44+
45+
prometheus:
46+
enabled: true
47+
path: /prometheus
48+
port: "8090"
49+
50+
liveness:
51+
path: /actuator/health/liveness
52+
port: 8080
53+
initialDelay: 60
54+
readiness:
55+
path: /actuator/health/readiness
56+
port: 8080
57+
initialDelay: 60
58+
startup:
59+
path: /actuator/health/liveness
60+
port: 8080
61+
initialDelay: 60

.nais/prod/klass-forvaltning.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
apiVersion: nais.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: klass-forvaltning
5+
namespace: dapla-metadata
6+
labels:
7+
team: dapla-metadata
8+
spec:
9+
image: "{{ image }}" # Injected from the GitHub Action
10+
port: 8081
11+
ingresses:
12+
- https://klass-forvaltning.intern.ssb.no
13+
- https://i.ssb.no/klass/admin
14+
accessPolicy:
15+
outbound:
16+
external:
17+
- host: auth.ssb.no
18+
rules:
19+
- application: klass-solr
20+
- application: klass-mail
21+
login:
22+
provider: openid
23+
enforce:
24+
enabled: true
25+
excludePaths:
26+
- /manage
27+
- /klass/admin/schemas/version.xsd
28+
replicas:
29+
min: 1
30+
max: 1
31+
resources:
32+
requests:
33+
cpu: 400m
34+
memory: 1024Mi
35+
limits:
36+
memory: 2048Mi
37+
env:
38+
- name: SPRING_PROFILES_ACTIVE
39+
value: frontend, postgres, small-import, skip-indexing, ad-offline, remote-solr
40+
- name: KLASS_SECURITY_OAUTH2_LOGOUT_PATH
41+
value: /oauth2/logout
42+
- name: SPRING_DATA_SOLR_HOST
43+
value: http://klass-solr/solr/
44+
- name: KLASS_ENV_SERVER
45+
value: klass-forvaltning.intern.ssb.no
46+
- name: KLASS_ENV_CLIENT_KLASS_MAIL_URL
47+
value: http://klass-mail
48+
envFrom:
49+
- secret: google-sql-klass
50+
- secret: klass-forvaltning-application-properties
51+
filesFrom:
52+
- mountPath: /var/run/secrets/nais.io/sqlcertificate
53+
secret: sqeletor-klass-827ec8ec
54+
prometheus:
55+
enabled: true
56+
path: /actuator/prometheus
57+
port: "8091"
58+
liveness:
59+
path: /actuator/health
60+
initialDelay: 60
61+
port: 8091
62+
readiness:
63+
path: /actuator/health
64+
initialDelay: 60
65+
port: 8091
66+
failureThreshold: 10
67+
periodSeconds: 10
68+
startup:
69+
path: /actuator/health
70+
initialDelay: 60
71+
port: 8091
72+
failureThreshold: 10
73+
periodSeconds: 10
74+
terminationGracePeriodSeconds: 120

.nais/prod/klass-mail.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Deploy config for the test cluster
2+
apiVersion: nais.io/v1alpha1
3+
kind: Application
4+
metadata:
5+
name: klass-mail
6+
namespace: dapla-metadata
7+
labels:
8+
team: dapla-metadata
9+
spec:
10+
image: "{{ image }}" # Injected from the GitHub Action
11+
port: 8082
12+
13+
replicas:
14+
min: 1
15+
max: 1
16+
resources:
17+
requests:
18+
cpu: 10m
19+
env:
20+
- name: MESSAGING_POSTMAN_PUBSUB_TOPIC_INCOMING
21+
value: projects/sup-t-2r/topics/sup-prod-postman-incoming-topic
22+
23+
accessPolicy:
24+
inbound:
25+
rules:
26+
- application: klass
27+
- application: klass-forvaltning
28+
29+
prometheus:
30+
enabled: true
31+
path: /prometheus
32+
port: "8091"
33+
34+
liveness:
35+
path: /actuator/health/liveness
36+
port: 8091
37+
initialDelay: 60
38+
readiness:
39+
path: /actuator/health/readiness
40+
port: 8091
41+
initialDelay: 60
42+
startup:
43+
path: /actuator/health/liveness
44+
port: 8091
45+
initialDelay: 60

.nais/prod/klass-solr-pvc.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: klass-solr-pvc
5+
namespace: dapla-metadata
6+
labels:
7+
app: klass-solr
8+
team: dapla-metadata
9+
spec:
10+
accessModes:
11+
- ReadWriteOnce
12+
resources:
13+
requests:
14+
storage: 2Gi
15+
storageClassName: standard-rwo

.nais/prod/klass-solr.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Deploy config for the prod cluster
2+
apiVersion: nais.io/v1alpha1
3+
kind: Application
4+
metadata:
5+
name: klass-solr
6+
namespace: dapla-metadata
7+
labels:
8+
team: dapla-metadata
9+
annotations:
10+
nais.io/read-only-file-system: "false"
11+
nais.io/run-as-user: "8983"
12+
nais.io/run-as-group: "8983"
13+
spec:
14+
image: "{{ image }}"
15+
port: 8983
16+
17+
filesFrom:
18+
- persistentVolumeClaim: klass-solr-pvc
19+
mountPath: /opt/solr/server/solr/mycores/Klass/data
20+
21+
replicas:
22+
min: 1
23+
max: 1
24+
resources:
25+
requests:
26+
cpu: 400m
27+
memory: 1024Mi
28+
limits:
29+
memory: 2048Mi
30+
31+
accessPolicy:
32+
inbound:
33+
rules:
34+
- application: klass
35+
- application: klass-forvaltning
36+
37+
38+
liveness:
39+
path: /solr/admin/cores?action=STATUS
40+
port: 8983
41+
initialDelay: 60
42+
43+
readiness:
44+
path: /solr/admin/cores?action=STATUS
45+
port: 8983
46+
initialDelay: 60
47+
48+
startup:
49+
path: /solr/admin/cores?action=STATUS
50+
port: 8983
51+
initialDelay: 60
52+

0 commit comments

Comments
 (0)