about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2015-11-20T00·59+0100
committerVincent Ambo <tazjin@gmail.com>2015-11-20T00·59+0100
commitdf93cead2801ac6fa28d21ef46751bcc4f95dc2b (patch)
treef6f996f82d5282e971507906f1cb5b9e0f1b2828
parent1342e8fb1d86c9f1349dff2c587be5b4f67b6b86 (diff)
[k8s] Add Kubernetes service & RC files
-rw-r--r--k8s/tazblog-db-rc.yaml26
-rw-r--r--k8s/tazblog-db-service.yaml12
-rw-r--r--k8s/tazblog-rc.yaml39
-rw-r--r--k8s/tazblog-svc.yaml17
4 files changed, 94 insertions, 0 deletions
diff --git a/k8s/tazblog-db-rc.yaml b/k8s/tazblog-db-rc.yaml
new file mode 100644
index 000000000000..26d730c4df27
--- /dev/null
+++ b/k8s/tazblog-db-rc.yaml
@@ -0,0 +1,26 @@
+apiVersion: v1
+kind: ReplicationController
+metadata:
+  name: tazblog-db
+spec:
+  selector:
+    app: tazblog-db
+  template:
+    metadata:
+      labels:
+        app: tazblog-db
+    spec:
+      containers:
+        - image: tazjin/tazblog-haskell:master
+          name: tazblog-db
+          command: ["tazblog-db"]
+          ports:
+            - containerPort: 8070
+          volumeMounts:
+            - name: tazblog-state
+              mountPath: /var/tazblog
+      volumes:
+        - name: tazblog-state
+          gcePersistentDisk:
+            pdName: tazblog-state
+            fsType: ext4
diff --git a/k8s/tazblog-db-service.yaml b/k8s/tazblog-db-service.yaml
new file mode 100644
index 000000000000..6d5d42946914
--- /dev/null
+++ b/k8s/tazblog-db-service.yaml
@@ -0,0 +1,12 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: tazblog-db
+  labels:
+    app: tazblog-db
+spec:
+  selector:
+    app: tazblog-db
+  ports:
+    - port: 8070
+      name: tazblog-db
diff --git a/k8s/tazblog-rc.yaml b/k8s/tazblog-rc.yaml
new file mode 100644
index 000000000000..ed291392a716
--- /dev/null
+++ b/k8s/tazblog-rc.yaml
@@ -0,0 +1,39 @@
+apiVersion: v1
+kind: ReplicationController
+metadata:
+  name: tazblog
+spec:
+  selector:
+    app: tazblog
+  template:
+    metadata:
+      labels:
+        app: tazblog
+    spec:
+      containers:
+        - image: tazjin/tazblog-haskell:master
+          imagePullPolicy: Always
+          name: tazblog
+          command: ["tazblog", "--dbHost", "tazblog-db.default.svc.cluster.local"]
+          ports:
+            - containerPort: 8000
+        - image: tazjin/varnish
+          imagePullPolicy: Always
+          name: tazblog-varnish
+          ports:
+            - containerPort: 6081
+            - containerPort: 6082
+        - image: tazjin/hitch:master
+          imagePullPolicy: Always
+          name: tazblog-hitch
+          command: ["hitch", "--user=hitch", "/etc/hitch/ssl/tazblog-tls"]
+          ports:
+            - containerPort: 8443
+          volumeMounts:
+            - name: tazblog-tls
+              readOnly: true
+              mountPath: /etc/hitch/ssl
+      volumes:
+        - name: tazblog-tls
+          secret:
+            secretName: tazblog-tls
diff --git a/k8s/tazblog-svc.yaml b/k8s/tazblog-svc.yaml
new file mode 100644
index 000000000000..6a2d9a422381
--- /dev/null
+++ b/k8s/tazblog-svc.yaml
@@ -0,0 +1,17 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: tazblog
+  labels:
+    app: tazblog
+spec:
+  type: LoadBalancer
+  selector:
+    app: tazblog
+  ports:
+    - port: 80
+      targetPort: 6081
+      name: tazblog-http
+    - port: 443
+      targetPort: 8443
+      name: tazblog-https