imfreedom/k8s-cluster

First run at setting up reviewbot

5 months ago, Gary Kramlich
fdef5049aec1
Parents fc71e853c3aa
Children 3d808ed3bfef
First run at setting up reviewbot
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/50-reviews.imfreedom.org/rabbitmq/kustomization.yaml Sun Apr 10 04:21:04 2022 -0500
@@ -0,0 +1,14 @@
+---
+namespace: roost
+commonLabels:
+ app: reviews
+ role: amqp
+resources:
+ - manifest.yaml
+secretGenerator:
+ - name: reviews-amqp
+ envs:
+ - secrets/env
+ options:
+ disableNameSuffixHash: true
+---
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/50-reviews.imfreedom.org/rabbitmq/manifest.yaml Sun Apr 10 04:21:04 2022 -0500
@@ -0,0 +1,98 @@
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: reviews-amqp
+spec:
+ ports:
+ - port: 5672
+ protocol: TCP
+ name: amqp
+---
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+ name: reviews-amqp
+spec:
+ podSelector:
+ matchLabels:
+ app: reviews
+ role: amqp
+ ingress:
+ - from:
+ - podSelector:
+ matchExpressions:
+ - key: app
+ operator: In
+ values:
+ - reviews
+ - key: role
+ operator: In
+ values:
+ - reviewboard
+ ports:
+ - port: amqp
+ protocol: TCP
+ - from:
+ - podSelector:
+ matchExpressions:
+ - key: app
+ operator: In
+ values:
+ - reviews
+ - key: role
+ operator: In
+ values:
+ - reviewbot
+ ports:
+ - port: amqp
+ protocol: TCP
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: reviews-amqp
+spec:
+ serviceName: reviews-amqp
+ replicas: 1
+ revisionHistoryLimit: 1
+ template:
+ spec:
+ containers:
+ - name: rabbitmq
+ image: docker.io/rabbitmq:3-management
+ imagePullPolicy: Always
+ ports:
+ - name: amqp
+ containerPort: 5672
+ resources:
+ limits:
+ cpu: 200m
+ memory: 256Mi
+ requests:
+ env:
+ - name: RABBITMQ_DEFAULT_USER
+ valueFrom:
+ secretKeyRef:
+ name: reviews-amqp
+ key: username
+ - name: RABBITMQ_DEFAULT_PASS
+ valueFrom:
+ secretKeyRef:
+ name: reviews-amqp
+ key: password
+ volumeMounts:
+ - mountPath: /var/lib/rabbitmq
+ name: reviews-amqp
+ readOnly: false
+ subPath: rabbitmq
+ volumeClaimTemplates:
+ - metadata:
+ name: reviews-amqp
+ spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 1Gi
+---
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/50-reviews.imfreedom.org/reviewbot/kustomization.yaml Sun Apr 10 04:21:04 2022 -0500
@@ -0,0 +1,5 @@
+---
+namespace: roost
+resources:
+ - manifest.yaml
+---
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/50-reviews.imfreedom.org/reviewbot/manifest.yaml Sun Apr 10 04:21:04 2022 -0500
@@ -0,0 +1,38 @@
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: reviews-reviewbot-go
+spec:
+ replicas: 1
+ revisionHistoryLimit: 1
+ selector:
+ matchLabels:
+ app: reviews
+ role: reviewbot
+ pack: go
+ template:
+ metadata:
+ labels:
+ app: reviews
+ role: reviewbot
+ pack: go
+ spec:
+ containers:
+ - name: reviewbot
+ image: docker.io/beanbag/reviewbot-go:3.0
+ imagePullPolicy: Always
+ env:
+ - name: BROKER_URL
+ valueFrom:
+ secretKeyRef:
+ name: reviews-amqp
+ key: brokerurl
+ resources:
+ limits:
+ cpu: 250m
+ memory: 256Mi
+ requests:
+ cpu: 100m
+ memory: 128Mi
+---