Merge pull request #6 from DTadrzak/rabbitmq

Basic version of rabbitmq.
This commit is contained in:
Brandon B. Jozsa 2016-11-18 10:59:45 -05:00 committed by GitHub
commit aa54b83c22
6 changed files with 123 additions and 0 deletions

23
rabbitmq/.helmignore Normal file
View File

@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

4
rabbitmq/Chart.yaml Executable file
View File

@ -0,0 +1,4 @@
apiVersion: v1
description: A Helm chart for Kubernetes
name: rabbitmq
version: 0.1.0

View File

@ -0,0 +1,39 @@
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: rabbitmq
spec:
replicas: 1
template:
metadata:
labels:
name: rabbitmq
spec:
nodeSelector:
{{.Values.global.label.control_node}}: enabled
volumes:
- name: rabbitmq-emptydir
emptyDir: {}
- name: start-rabbitmq
configMap:
name: start-rabbitmq
containers:
- name: rabbitmq
image: rabbitmq:3-management
command:
- bash
- /tmp/start_rabbitmq.sh
livenessProbe:
tcpSocket:
port: {{.Values.global.rabbitmq_port_public}}
initialDelaySeconds: 60
timeoutSeconds: 5
ports:
- name: rabbitmq
containerPort: {{.Values.global.rabbitmq_port_public}}
volumeMounts:
- name: rabbitmq-emptydir
mountPath: /var/lib/rabbitmq
- mountPath: /tmp/start_rabbitmq.sh
name: start-rabbitmq
subPath: start_rabbitmq.sh

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: rabbitmq
spec:
ports:
- port: {{.Values.global.rabbitmq_port_public}}
selector:
app: rabbitmq

View File

@ -0,0 +1,31 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: start-rabbitmq
labels:
system: openstack
type: configuration
component: messaging
data:
start_rabbitmq.sh: |
chown -R rabbitmq:rabbitmq /var/lib/rabbitmq
/etc/init.d/rabbitmq-server start
rabbitmq-plugins enable rabbitmq_tracing
rabbitmqctl trace_on
rabbitmqctl add_user {{ .Values.global.rabbitmq_default_user }} {{ .Values.global.rabbitmq_default_pass }} || true
rabbitmqctl set_permissions {{ .Values.global.rabbitmq_default_user }} ".*" ".*" ".*" || true
rabbitmqctl add_user {{ .Values.global.rabbitmq_admin_user }} {{ .Values.global.rabbitmq_admin_pass }}|| true
rabbitmqctl set_permissions {{ .Values.global.rabbitmq_admin_user }} ".*" ".*" ".*" || true
rabbitmqctl set_user_tags {{ .Values.global.rabbitmq_admin_user }} administrator || true
rabbitmqctl change_password guest {{ .Values.global.rabbitmq_default_pass }} || true
rabbitmqctl set_user_tags guest monitoring || true
/etc/init.d/rabbitmq-server stop
exec rabbitmq-server

17
rabbitmq/values.yaml Normal file
View File

@ -0,0 +1,17 @@
# Default values for rabbitmq.
# This is a YAML-formatted file.
# Declare name/value pairs to be passed into your templates.
# name: value
global:
rabbitmq_default_user: openstack
rabbitmq_admin_user: rabbitmq
rabbitmq_port_public: '5672'
rabbitmq_port_management: '15672'
rabbitmq_default_pass: password
rabbitmq_admin_pass: password
label:
control_node: "openstack-control-plane"
# TODO(DTadrzak): delete me
local:
image: "quay.io/stackanetes/stackanetes-rabbitmq:newton"