Skip to content

Commit

Permalink
aws and azure
Browse files Browse the repository at this point in the history
  • Loading branch information
kelindar committed Dec 16, 2018
1 parent 69a17ac commit 8e698bd
Show file tree
Hide file tree
Showing 12 changed files with 149 additions and 35 deletions.
12 changes: 12 additions & 0 deletions deploy/k8s/aws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Deploying Emitter with Kubernetes on AWS

This directory contains Kubernetes configuration files which can be used to deploy an [production-grade cluster of emitter](https://emitter.io) on Amazon Web Services (EKS).

In order to get emitter running, you'll need to have `kubectl` [tool installed](https://kubernetes.io/docs/tasks/tools/install-kubectl/) and an [Amazon Web Services](https://aws.amazon.com) account.

```
kubectl apply -f storage_ssd.yaml
kubectl apply -f service_dns.yaml
kubectl apply -f service_loadbalancer.yaml
kubectl apply -f broker.yaml
```
45 changes: 10 additions & 35 deletions deploy/k8s/broker_host.yaml → deploy/k8s/aws/broker.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,11 @@
#**********************************************************************************
# Copyright (c) 2009-2018 Misakai Ltd.
# This program is free software: you can redistribute it and/or modify it under the
# terms of the GNU Affero General Public License as published by the Free Software
# Foundation, either version 3 of the License, or(at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see<http://www.gnu.org/licenses/>.
#***********************************************************************************
---
apiVersion: v1
kind: Service
metadata:
name: broker
labels:
app: broker
spec:
clusterIP: None
ports:
- port: 4000
targetPort: 4000
selector:
app: broker
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: broker
spec:
selector:
matchLabels:
app: broker # has to match .spec.template.metadata.labels
serviceName: "broker"
replicas: 3
template:
Expand All @@ -39,6 +14,7 @@ spec:
app: broker
role: broker
spec:
terminationGracePeriodSeconds: 30
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -49,13 +25,12 @@ spec:
values:
- broker
topologyKey: kubernetes.io/hostname
terminationGracePeriodSeconds: 10
containers:
- env:
- name: EMITTER_LICENSE
value: "" # <- Provide license
value: "..." # <- Provide license
- name: EMITTER_CLUSTER_SEED
value: "broker"
value: "broker" # or "broker-0.broker.default.svc.cluster.local"
- name: EMITTER_CLUSTER_ADVERTISE
value: "private:4000"
- name: EMITTER_STORAGE_PROVIDER
Expand All @@ -69,9 +44,9 @@ spec:
volumeMounts:
- name: broker-volume
mountPath: /data
hostNetwork: true
restartPolicy: Always
terminationGracePeriodSeconds: 30
updateStrategy:
type: RollingUpdate
volumeClaimTemplates:
- metadata:
name: broker-volume
Expand All @@ -81,4 +56,4 @@ spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 50Gi
storage: 50Gi
13 changes: 13 additions & 0 deletions deploy/k8s/aws/service_dns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: broker
labels:
app: broker
spec:
clusterIP: None # Headless would give us a DNS name
selector:
app: broker
ports: # No port is actually required for this
- port: 4000
targetPort: 4000
15 changes: 15 additions & 0 deletions deploy/k8s/aws/service_loadbalancer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: broker-loadbalancer
spec:
type: LoadBalancer
selector:
app: broker
ports:
- port: 80
targetPort: 8080
name: http
- port: 443
targetPort: 443
name: https
File renamed without changes.
12 changes: 12 additions & 0 deletions deploy/k8s/azure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Deploying Emitter with Kubernetes on Azure

This directory contains Kubernetes configuration files which can be used to deploy an [production-grade cluster of emitter](https://emitter.io) on Microsoft Azure (AKS).

In order to get emitter running, you'll need to have `kubectl` [tool installed](https://kubernetes.io/docs/tasks/tools/install-kubectl/) and an [Microsoft Azure](https://azure.microsoft.com) account.

```
kubectl apply -f storage_ssd.yaml
kubectl apply -f service_dns.yaml
kubectl apply -f service_loadbalancer.yaml
kubectl apply -f broker.yaml
```
59 changes: 59 additions & 0 deletions deploy/k8s/azure/broker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: broker
spec:
selector:
matchLabels:
app: broker # has to match .spec.template.metadata.labels
serviceName: "broker"
replicas: 3
template:
metadata:
labels:
app: broker
role: broker
spec:
terminationGracePeriodSeconds: 30
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- broker
topologyKey: kubernetes.io/hostname
containers:
- env:
- name: EMITTER_LICENSE
value: "..." # <- Provide license
- name: EMITTER_CLUSTER_SEED
value: "broker" # or "broker-0.broker.default.svc.cluster.local"
- name: EMITTER_CLUSTER_ADVERTISE
value: "private:4000"
- name: EMITTER_STORAGE_PROVIDER
value: "ssd"
name: broker
image: emitter/server:latest
ports:
- containerPort: 8080
- containerPort: 443
- containerPort: 4000
volumeMounts:
- name: broker-volume
mountPath: /data
restartPolicy: Always
updateStrategy:
type: RollingUpdate
volumeClaimTemplates:
- metadata:
name: broker-volume
annotations:
volume.beta.kubernetes.io/storage-class: "fast"
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 50Gi
13 changes: 13 additions & 0 deletions deploy/k8s/azure/service_dns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: broker
labels:
app: broker
spec:
clusterIP: None # Headless would give us a DNS name
selector:
app: broker
ports: # No port is actually required for this
- port: 4000
targetPort: 4000
15 changes: 15 additions & 0 deletions deploy/k8s/azure/service_loadbalancer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: broker-loadbalancer
spec:
type: LoadBalancer
selector:
app: broker
ports:
- port: 80
targetPort: 8080
name: http
- port: 443
targetPort: 443
name: https
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8e698bd

Please sign in to comment.