Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

743 rabbitmq cluster #867

Merged
merged 37 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ff11e24
add the plugin for peer discovery #743.
Jan 10, 2019
76c52f5
this does establish a cluster.
Jan 11, 2019
126dbf6
place config in configmap; place in seperate directory; copy into /et…
Jan 11, 2019
e88e4cb
this plugin, connecting to kube api, needs a service account with suc…
Jan 15, 2019
ff5e2bc
shorten selectors/service to SERVICE_NAME.
Jan 15, 2019
66ba946
typo.
Jan 15, 2019
3ee2d4f
erlang cookies need to be the same on all nodes.
Jan 15, 2019
393bcb9
\ No newline at end of file
Jan 15, 2019
32d30d1
you need clusterip to talk to talk between statefulset pods.
Jan 15, 2019
405aafa
this hostname works.
Jan 17, 2019
4662d07
add back rabbitmq_delayed_message_exchange now that the /etc/rabbitmq…
Jan 17, 2019
a72a87b
add explict path info for tokens and certs.
Jan 17, 2019
513bcd8
dynamically configure nodename. move setup to script, called on spec.
Jan 24, 2019
6596385
Merge branch 'master' into 743-rabbitq-cluster
Jan 24, 2019
3d3da3c
hard code nodename to rabbitmq@localhost for single node only.
Jan 24, 2019
f9ece24
add back podAntiAffinity.
Jan 24, 2019
3dbce6e
correct image to service_image.
Jan 25, 2019
45068d9
add oc-build-deploy templates for rabbitmq-cluster.
Feb 7, 2019
b52813f
move from configmap to inside docker.
Feb 7, 2019
e6d57d4
typo.
Feb 7, 2019
11517a0
relocate rabbitmq service into rabbitmq image.
Feb 19, 2019
53d2220
migrate things from rabbitmq to rabbitmq-cluster.
Feb 19, 2019
fa8c324
rename rabbitmq service to broker. re-wire makefile.
Feb 19, 2019
35c0b45
add rabbitmq template yaml.
Feb 19, 2019
8cea2bc
remove route from service template.
Feb 19, 2019
a6833df
use consistent extensions.
Feb 19, 2019
66b128d
Merge branch 'master' into 743-rabbitq-cluster
Schnitzel Feb 20, 2019
aa1c39d
Merge branch '743-rabbitq-cluster' of github.com:amazeeio/lagoon into…
Feb 20, 2019
06ec2e7
remove references to secrets.
Feb 20, 2019
e86769b
add a default erlang cookie.
Feb 20, 2019
213adb6
rabbitmq start up does this for us.
Feb 20, 2019
fd9e2e2
these are not needed now that there are images.
Feb 20, 2019
760a5bc
use broker/rabbitmq image when local, otherwise use clustered.
Feb 21, 2019
ab3fff1
broker = non-clustered.
Feb 21, 2019
5c4565c
actually call the broker also broker, and update all defaults. Custom…
Schnitzel Feb 21, 2019
9125a51
also use the servicename for serviceaccounts, roles
Schnitzel Feb 21, 2019
7481939
update test services to include broker.
Feb 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ images := oc \
varnish-drupal \
redis \
redis-persistent \
rabbitmq \
rabbitmq-cluster \
mongo \
elasticsearch \
kibana \
Expand Down Expand Up @@ -161,6 +163,8 @@ build/varnish: build/commons images/varnish/Dockerfile
build/varnish-drupal: build/varnish images/varnish-drupal/Dockerfile
build/redis: build/commons images/redis/Dockerfile
build/redis-persistent: build/redis images/redis-persistent/Dockerfile
build/rabbitmq: build/commons images/rabbitmq/Dockerfile
build/rabbitmq-cluster: build/rabbitmq images/rabbitmq-cluster/Dockerfile
build/mongo: build/commons images/mongo/Dockerfile
build/elasticsearch: build/commons images/elasticsearch/Dockerfile
build/logstash: build/commons images/logstash/Dockerfile
Expand Down Expand Up @@ -328,7 +332,7 @@ services := api \
rest2tasks \
webhook-handler \
webhooks2tasks \
rabbitmq \
broker \
logs-forwarder \
logs-db \
logs-db-ui \
Expand Down Expand Up @@ -453,7 +457,7 @@ tests-list:
#### Definition of tests

# Define a list of which Lagoon Services are needed for running any deployment testing
deployment-test-services-main = rabbitmq openshiftremove openshiftbuilddeploy openshiftbuilddeploymonitor logs2slack logs2rocketchat api ssh auth-server local-git local-api-data-watcher-pusher tests
deployment-test-services-main = broker openshiftremove openshiftbuilddeploy openshiftbuilddeploymonitor logs2slack logs2rocketchat api ssh auth-server local-git local-api-data-watcher-pusher tests

# All Tests that use REST endpoints
rest-tests = rest node features nginx elasticsearch
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ services:
lagoon.type: custom
lagoon.template: services/webhook-handler/.lagoon.app.yml
lagoon.image: amazeeiolagoon/webhook-handler:${SAFE_BRANCH:-master}
rabbitmq:
image: ${IMAGE_REPO:-lagoon}/rabbitmq
broker:
image: ${IMAGE_REPO:-lagoon}/broker
ports:
- '15672:15672'
- '5672:5672'
labels:
lagoon.type: custom
lagoon.template: services/rabbitmq/.lagoon.app.yml
lagoon.image: amazeeiolagoon/rabbitmq:${SAFE_BRANCH:-master}
lagoon.type: rabbitmq-cluster
lagoon.template: services/broker/.lagoon.app.yml
lagoon.image: amazeeiolagoon/broker:${SAFE_BRANCH:-master}
openshiftremove:
image: ${IMAGE_REPO:-lagoon}/openshiftremove
command: yarn run dev
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
apiVersion: v1
kind: Template
metadata:
creationTimestamp: null
name: lagoon-openshift-template-node
parameters:
- name: SERVICE_NAME
description: Name of this service
required: true
- name: SAFE_BRANCH
description: Which branch this belongs to, special chars replaced with dashes
required: true
- name: SAFE_PROJECT
description: Which project this belongs to, special chars replaced with dashes
required: true
- name: BRANCH
description: Which branch this belongs to, original value
required: true
- name: PROJECT
description: Which project this belongs to, original value
required: true
- name: LAGOON_GIT_SHA
description: git hash sha of the current deployment
required: true
- name: SERVICE_ROUTER_URL
description: URL of the Router for this service
value: ""
- name: OPENSHIFT_PROJECT
description: Name of the Project that this service is in
required: true
- name: REGISTRY
description: Registry where Images are pushed to
required: true
- name: DEPLOYMENT_STRATEGY
description: Strategy of Deploymentconfig
value: "Rolling"
- name: SERVICE_IMAGE
description: Pullable image of service
required: true
- name: CRONJOBS
description: Oneliner of Cronjobs
value: ""
objects:
- apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
service: ${SERVICE_NAME}
branch: ${SAFE_BRANCH}
project: ${SAFE_PROJECT}
name: ${SERVICE_NAME}
spec:
clusterIP: None
ports:
- name: 15672-tcp
port: 15672
protocol: TCP
targetPort: 15672
- name: 5672-tcp
port: 5672
protocol: TCP
targetPort: 5672
selector:
service: ${SERVICE_NAME}
status:
loadBalancer: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
---
apiVersion: v1
kind: Template
metadata:
creationTimestamp: null
name: lagoon-openshift-template-node
parameters:
- name: SERVICE_NAME
description: Name of this service
required: true
- name: SAFE_BRANCH
description: Which branch this belongs to, special chars replaced with dashes
required: true
- name: SAFE_PROJECT
description: Which project this belongs to, special chars replaced with dashes
required: true
- name: BRANCH
description: Which branch this belongs to, original value
required: true
- name: PROJECT
description: Which project this belongs to, original value
required: true
- name: LAGOON_GIT_SHA
description: git hash sha of the current deployment
required: true
- name: SERVICE_ROUTER_URL
description: URL of the Router for this service
value: ""
- name: OPENSHIFT_PROJECT
description: Name of the Project that this service is in
required: true
- name: REGISTRY
description: Registry where Images are pushed to
required: true
- name: DEPLOYMENT_STRATEGY
description: Strategy of Deploymentconfig
value: "Rolling"
- name: SERVICE_IMAGE
description: Pullable image of service
required: true
- name: CRONJOBS
description: Oneliner of Cronjobs
value: ""
objects:
- apiVersion: v1
kind: ServiceAccount
metadata:
name: ${SERVICE_NAME}-sa
- apiVersion: v1
kind: RoleBinding
metadata:
name: ${SERVICE_NAME}-view
roleRef:
kind: Role
name: view
subjects:
- kind: ServiceAccount
name: ${SERVICE_NAME}-sa
- apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: ${SERVICE_NAME}
spec:
serviceName: ${SERVICE_NAME}
replicas: 3
selector:
matchLabels:
service: ${SERVICE_NAME}
template:
metadata:
labels:
branch: ${SAFE_BRANCH}
project: ${SAFE_PROJECT}
service: ${SERVICE_NAME}
spec:
serviceAccountName: ${SERVICE_NAME}-sa
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: service
operator: In
values:
- ${SERVICE_NAME}
topologyKey: kubernetes.io/hostname
containers:
- name: ${SERVICE_NAME}
command:
- sh
args:
- /cluster-rabbit.sh
image: ${SERVICE_IMAGE}
imagePullPolicy: Always
ports:
- containerPort: 4369
protocol: TCP
- containerPort: 15672
protocol: TCP
- containerPort: 5672
protocol: TCP
readinessProbe:
tcpSocket:
port: 5672
initialDelaySeconds: 15
timeoutSeconds: 1
volumeMounts:
- name: ${SERVICE_NAME}
mountPath: /var/lib/rabbitmq
env:
- name: RABBITMQ_USE_LONGNAME
value: "true"
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: SERVICE_NAME
value: ${SERVICE_NAME}
- name: CRONJOBS
value: ${CRONJOBS}
volumeClaimTemplates:
- metadata:
name: ${SERVICE_NAME}
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi
updateStrategy:
type: RollingUpdate
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ parameters:
description: Oneliner of Cronjobs
value: ""
objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ${SERVICE_NAME}-volume
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
- apiVersion: v1
kind: DeploymentConfig
metadata:
Expand Down Expand Up @@ -90,20 +80,12 @@ objects:
- configMapRef:
name: lagoon-env
env:
- name: RABBITMQ_DEFAULT_USER
valueFrom:
secretKeyRef:
name: rabbitmq-username
key: RABBITMQ_USERNAME
- name: RABBITMQ_DEFAULT_PASS
valueFrom:
secretKeyRef:
name: rabbitmq-password
key: RABBITMQ_PASSWORD
- name: SERVICE_NAME
value: ${SERVICE_NAME}
- name: CRONJOBS
value: ${CRONJOBS}
- name: RABBITMQ_NODENAME
value: rabbitmq@localhost
resources:
requests:
cpu: 10m
Expand All @@ -119,42 +101,3 @@ objects:
triggers:
- type: ConfigChange
status: {}
- apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
service: ${SERVICE_NAME}
branch: ${SAFE_BRANCH}
project: ${SAFE_PROJECT}
name: ${SERVICE_NAME}
spec:
ports:
- name: 15672-tcp
port: 15672
protocol: TCP
targetPort: 15672
- name: 5672-tcp
port: 5672
protocol: TCP
targetPort: 5672
selector:
service: ${SERVICE_NAME}
status:
loadBalancer: {}
- apiVersion: v1
kind: Route
metadata:
creationTimestamp: null
labels:
service: ${SERVICE_NAME}
branch: ${SAFE_BRANCH}
project: ${SAFE_PROJECT}
name: ${SERVICE_NAME}
spec:
host: ${SERVICE_ROUTER_URL}
port:
targetPort: 15672-tcp
to:
kind: Service
name: ${SERVICE_NAME}
53 changes: 53 additions & 0 deletions images/oc-build-deploy-dind/openshift-templates/rabbitmq/pvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: v1
kind: Template
metadata:
creationTimestamp: null
name: lagoon-openshift-template-node
parameters:
- name: SERVICE_NAME
description: Name of this service
required: true
- name: SAFE_BRANCH
description: Which branch this belongs to, special chars replaced with dashes
required: true
- name: SAFE_PROJECT
description: Which project this belongs to, special chars replaced with dashes
required: true
- name: BRANCH
description: Which branch this belongs to, original value
required: true
- name: PROJECT
description: Which project this belongs to, original value
required: true
- name: LAGOON_GIT_SHA
description: git hash sha of the current deployment
required: true
- name: SERVICE_ROUTER_URL
description: URL of the Router for this service
value: ""
- name: OPENSHIFT_PROJECT
description: Name of the Project that this service is in
required: true
- name: REGISTRY
description: Registry where Images are pushed to
required: true
- name: DEPLOYMENT_STRATEGY
description: Strategy of Deploymentconfig
value: "Rolling"
- name: SERVICE_IMAGE
description: Pullable image of service
required: true
- name: CRONJOBS
description: Oneliner of Cronjobs
value: ""
objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ${SERVICE_NAME}-volume
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
Loading