Skip to content

Commit

Permalink
feat: add deployment scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Feb 21, 2022
1 parent 3d9601e commit 2eeaa98
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 0 deletions.
1 change: 1 addition & 0 deletions deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.secret.*
12 changes: 12 additions & 0 deletions deploy/010-ImageStream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
name: doppelgaenger-input
spec: {}
---
kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
name: doppelgaenger-websocket
spec: {}
18 changes: 18 additions & 0 deletions deploy/020-BuildConfig-input.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
name: doppelgaenger-input
spec:
output:
to:
kind: ImageStreamTag
name: doppelgaenger-input:latest
source:
git:
ref: main
uri: https://github.com/drogue-iot/drogue-doppelgaenger
contextDir: doppelgaenger-input
strategy:
dockerStrategy: {}
triggers:
- type: ConfigChange
18 changes: 18 additions & 0 deletions deploy/020-BuildConfig-websocket.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
name: doppelgaenger-websocket
spec:
output:
to:
kind: ImageStreamTag
name: doppelgaenger-websocket:latest
source:
git:
ref: main
uri: https://github.com/drogue-iot/drogue-doppelgaenger
contextDir: doppelgaenger-websocket
strategy:
dockerStrategy: {}
triggers:
- type: ConfigChange
61 changes: 61 additions & 0 deletions deploy/030-Deployment-input.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: doppelgaenger-input
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"doppelgaenger-input:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"app\")].image"}]'
labels:
app.kubernetes.io/name: doppelgaenger-input
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: doppelgaenger-input
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: doppelgaenger-input
spec:
enableServiceLinks: false
containers:
- name: app
image: doppelgaenger-input
imagePullPolicy: Always
env:
- name: RUST_LOG
value: info
- name: KAFKA__BOOTSTRAP_SERVERS
# value: drogue-iot-kafka-bootstrap-drogue-dev.apps.wonderful.iot-playground.org:443
value: drogue-iot-kafka-bootstrap.drogue-dev.svc:9092
- name: KAFKA__PROPERTIES__SECURITY_PROTOCOL
value: SASL_PLAINTEXT
- name: KAFKA__PROPERTIES__SASL_MECHANISM
value: SCRAM-SHA-512
- name: KAFKA__PROPERTIES__SASL_USERNAME
valueFrom:
secretKeyRef:
name: doppelgaegner-config
key: kafka.username
- name: KAFKA__PROPERTIES__SASL_PASSWORD
valueFrom:
secretKeyRef:
name: doppelgaegner-config
key: kafka.password
- name: KAFKA__TOPIC
value: events-burrboard
- name: KAFKA__PROPERTIES__GROUP_ID
value: drogue-twin
- name: PASSWORD
valueFrom:
secretKeyRef:
name: twindb-mongodb
key: mongodb-passwords
- name: MONGODB__URL
value: mongodb://twin:$(PASSWORD)@twindb-mongodb-headless:27017/twin-db
- name: MONGODB__DATABASE
value: twin-db
51 changes: 51 additions & 0 deletions deploy/030-Deployment-websocket.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: doppelgaenger-websocket
annotations:
image.openshift.io/triggers: '[{"from":{"kind":"ImageStreamTag","name":"doppelgaenger-websocket:latest"},"fieldPath":"spec.template.spec.containers[?(@.name==\"app\")].image"}]'
labels:
app.kubernetes.io/name: doppelgaenger-websocket
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: doppelgaenger-websocket
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: doppelgaenger-websocket
spec:
enableServiceLinks: false
containers:
- name: app
image: doppelgaenger-websocket
imagePullPolicy: Always
env:
- name: PASSWORD
valueFrom:
secretKeyRef:
name: twindb-mongodb
key: mongodb-passwords
- name: MONGODB__URL
value: mongodb://twin:$(PASSWORD)@twindb-mongodb-headless:27017/
- name: DATABASE
value: twin-db
- name: DROGUE_APP
value: burrboard
ports:
- containerPort: 8082
name: web
livenessProbe:
httpGet:
port: 8082
path: /health
readinessProbe:
httpGet:
port: 8082
path: /health
12 changes: 12 additions & 0 deletions deploy/050-Service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: Service
apiVersion: v1
metadata:
name: doppelgaenger-websocket
spec:
type: ClusterIP
ports:
- name: web
port: 8082
targetPort: web
selector:
app.kubernetes.io/name: doppelgaenger-websocket
12 changes: 12 additions & 0 deletions deploy/060-Route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: dashboard
spec:
to:
kind: Service
name: doppelgaenger-websocket
port:
targetPort: web
tls:
termination: edge
8 changes: 8 additions & 0 deletions deploy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

# Installation

## MongoDB

```shell
helm -n namespace upgrade --install twindb bitnami/mongodb --values values.yaml
```
18 changes: 18 additions & 0 deletions deploy/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
architecture: "replicaset"
auth:
rootUser: admin
usernames:
- twin
databases:
- twin-db

podSecurityContext:
enabled: false
containerSecurityContext:
enabled: false

arbiter:
podSecurityContext:
enabled: false
containerSecurityContext:
enabled: false

0 comments on commit 2eeaa98

Please sign in to comment.