Skip to content

Commit a2efbbd

Browse files
committed
Intermediate commit. In support of Issue #9, adding some basic plumbing around gcp deployments
1 parent 3088dee commit a2efbbd

File tree

7 files changed

+65
-12
lines changed

7 files changed

+65
-12
lines changed

ops-scripts/gcp/base.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
NAMESPACE=sentrius
3+
CLUSTER=sentrius-autopilot-cluster-1
4+
REGION=us-east1

ops-scripts/gcp/depoloy-helm.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
4+
5+
6+
source ${SCRIPT_DIR}/base.sh
7+
source ${SCRIPT_DIR}/../../.gcp.env
8+
9+
helm upgrade --install sentrius ./sentrius-gcp-chart --namespace ${NAMESPACE} \
10+
--set sentrius.image.repository=us-central1-docker.pkg.dev/sentrius-project/sentrius-repo/sentrius \
11+
--set sentrius.image.tag=${SENTRIUS_VERSION} \
12+
--set ssh.image.repository=us-central1-docker.pkg.dev/sentrius-project/sentrius-repo/sentrius-ssh \
13+
--set ssh.image.tag=${SENTRIUS_SSH_VERSION} \
14+
--set keycloak.image.repository=us-central1-docker.pkg.dev/sentrius-project/sentrius-repo/sentrius-keycloak \
15+
--set keycloak.image.tag=${SENTRIUS_KEYCLOAK_VERSION} \
16+
--set sentriusagent.image.repository=us-central1-docker.pkg.dev/sentrius-project/sentrius-repo/sentrius-agent \
17+
--set sentriusagent.image.tag=${SENTRIUS_AGENT_VERSION} || { echo "Failed to deploy Sentrius with Helm"; exit 1; }

ops-scripts/gcp/restart.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
4+
5+
6+
source ${SCRIPT_DIR}/base.sh
7+
source ${SCRIPT_DIR}/../../.gcp.env
8+
9+
kubectl scale deployment --all --replicas=1 -n sentrius
10+
11+
12+
helm upgrade --install sentrius ./sentrius-gcp-chart --namespace ${NAMESPACE} \
13+
--set sentrius.image.repository=us-central1-docker.pkg.dev/sentrius-project/sentrius-repo/sentrius \
14+
--set sentrius.image.tag=${SENTRIUS_VERSION} \
15+
--set ssh.image.repository=us-central1-docker.pkg.dev/sentrius-project/sentrius-repo/sentrius-ssh \
16+
--set ssh.image.tag=${SENTRIUS_SSH_VERSION} \
17+
--set keycloak.image.repository=us-central1-docker.pkg.dev/sentrius-project/sentrius-repo/sentrius-keycloak \
18+
--set keycloak.image.tag=${SENTRIUS_KEYCLOAK_VERSION} \
19+
--set sentriusagent.image.repository=us-central1-docker.pkg.dev/sentrius-project/sentrius-repo/sentrius-agent \
20+
--set sentriusagent.image.tag=${SENTRIUS_AGENT_VERSION} || { echo "Failed to deploy Sentrius with Helm"; exit 1; }

ops-scripts/gcp/spindown.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
4+
5+
6+
source ${SCRIPT_DIR}/base.sh
7+
8+
9+
gcloud container clusters resize ${CLUSTER} \
10+
--region ${REGION} \
11+
--num-nodes 0
12+

sentrius-gcp-chart/templates/keycloak-service.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ metadata:
66
app: keycloak
77
release: {{ .Release.Name }}
88
spec:
9-
type: NodePort
9+
type: LoadBalancer
1010
ports:
1111
- name: http
12-
port: 30081
13-
targetPort: 30081
14-
nodePort: 30081 # NodePort range: 30000-32767
12+
port: 80
13+
targetPort: {{ .Values.keycloak.port }} # Replace with the internal port Keycloak listens to
1514
selector:
1615
app: keycloak
17-
release: {{ .Release.Name }}
18-
16+
release: {{ .Release.Name }}

sentrius-gcp-chart/templates/service.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
name: {{ .Release.Name }}-sentrius
5-
spec:
6-
type: NodePort
7-
selector:
5+
labels:
86
app: sentrius
7+
spec:
8+
type: LoadBalancer
99
ports:
10-
- protocol: TCP
11-
port: 80 # Port exposed to the outside world
10+
- name: http
11+
port: 80
1212
targetPort: {{ .Values.sentrius.port }} # Port used inside the container
13-
nodePort: {{ .Values.service.nodePort | default 30080 }} # NodePort range: 30000-32767
13+
selector:
14+
app: sentrius

sentrius-gcp-chart/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ keycloak:
206206
host: keycloak.default.svc.cluster.local
207207
adminUser: admin
208208
adminPassword: admin
209+
port: 8080
209210
db:
210211
image: postgres:15
211212
user: keycloak

0 commit comments

Comments
 (0)