From 68768a3e7c628fa8dc013f9f2b276604dc2344ed Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Tue, 28 Jun 2022 20:51:57 +0200 Subject: [PATCH] karin --- kube/karin-secret.yaml | 6 ++++ kube/karin.yaml | 34 +++++++++++++++++++++++ kube/mongo-secret.yaml | 7 +++++ kube/mongo.yaml | 62 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 kube/karin-secret.yaml create mode 100644 kube/karin.yaml create mode 100644 kube/mongo-secret.yaml create mode 100644 kube/mongo.yaml diff --git a/kube/karin-secret.yaml b/kube/karin-secret.yaml new file mode 100644 index 0000000..d52b22c --- /dev/null +++ b/kube/karin-secret.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +data: + DISCORD_TOKEN: QQ== +kind: Secret +metadata: + name: karin \ No newline at end of file diff --git a/kube/karin.yaml b/kube/karin.yaml new file mode 100644 index 0000000..922d301 --- /dev/null +++ b/kube/karin.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: karin +spec: + selector: + matchLabels: + app: karin + replicas: 1 + template: + metadata: + labels: + app: karin + spec: + containers: + - name: court-bot + image: discord-court-bot:1.0 + envFrom: + - configMapRef: + name: karin + - secretRef: + name: karin +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: karin +data: + RUST_LOG: court_bot=DEBUG + GUILD_ID: "459006129670979584" + MONGO_URI: mongodb://localhost:27017 + DB_NAME: karin + MONGO_INITDB_ROOT_USERNAME: root + SET_GLOBAL: '' \ No newline at end of file diff --git a/kube/mongo-secret.yaml b/kube/mongo-secret.yaml new file mode 100644 index 0000000..f36457c --- /dev/null +++ b/kube/mongo-secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +data: + MONGO_INITDB_ROOT_USERNAME: cm9vdA== + MONGO_INITDB_ROOT_PASSWORD: QQ== +kind: Secret +metadata: + name: mongodb \ No newline at end of file diff --git a/kube/mongo.yaml b/kube/mongo.yaml new file mode 100644 index 0000000..136952c --- /dev/null +++ b/kube/mongo.yaml @@ -0,0 +1,62 @@ + +apiVersion: v1 +kind: Service +metadata: + name: mongodb-service + labels: + name: mongo +spec: + ports: + - port: 27017 + targetPort: 27017 + clusterIP: None + selector: + role: mongo +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: mongod +spec: + serviceName: mongodb-service + replicas: 1 + selector: + matchLabels: + role: mongo + template: + metadata: + labels: + role: mongo + environment: test + replicaset: MainRepSet + spec: + terminationGracePeriodSeconds: 10 + containers: + - name: mongod-container + image: mongo + command: + - "mongod" + - "--bind_ip" + - "0.0.0.0" + resources: + requests: + cpu: 0.2 + memory: 200Mi + limits: + cpu: 0.3 + memory: 300Mi + ports: + - containerPort: 27017 + volumeMounts: + - name: mongodb-persistent-storage-claim + mountPath: /data/db + volumeClaimTemplates: + - metadata: + name: mongodb-persistent-storage-claim + annotations: + volume.beta.kubernetes.io/storage-class: "standard" + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: 100Mi \ No newline at end of file