Skip to content

Instantly share code, notes, and snippets.

@martezr
Created April 17, 2023 19:49
Show Gist options
  • Save martezr/86107f2592446eaf0018860df418fc09 to your computer and use it in GitHub Desktop.
Save martezr/86107f2592446eaf0018860df418fc09 to your computer and use it in GitHub Desktop.
---
apiVersion: v1
kind: Service
metadata:
name: mysql-service
labels:
app: mysql-service
spec:
ports:
- port: 3306
protocol: TCP
selector:
app: mysql
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-deployment
labels:
app: mysql
spec:
replicas: 1
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
containers:
- name: mysql
image: mysql:5.7
env:
- name: MYSQL_ROOT_PASSWORD
value: "morphpass1"
- name: MYSQL_DATABASE
value: "morpheus"
- name: MYSQL_INITDB_SKIP_TZINFO
value: "true"
ports:
- containerPort: 3306
args: ["--character-set-server=utf8", "--collation-server=utf8_general_ci"]
---
apiVersion: v1
kind: Service
metadata:
name: rabbitmq-service
labels:
app: rabbitmq-service
spec:
ports:
- port: 5672
protocol: TCP
selector:
app: rabbitmq
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: rabbitmq-deployment
labels:
app: rabbitmq
spec:
replicas: 1
selector:
matchLabels:
app: rabbitmq
template:
metadata:
labels:
app: rabbitmq
spec:
containers:
- name: rabbitmq
image: rabbitmq:3.9
ports:
- containerPort: 5672
volumeMounts:
- mountPath: /etc/rabbitmq/rabbitmq.conf
subPath: rabbitmq.conf
name: rabbitmq-config-volume
volumes:
- name: rabbitmq-config-volume
configMap:
name: rabbitmq-config-cfgmap
---
apiVersion: v1
kind: ConfigMap
metadata:
name: rabbitmq-config-cfgmap
data:
rabbitmq.conf: |
##
## Default User / VHost
## ====================
##
## On first start RabbitMQ will create a vhost and a user. These
## config items control what gets created.
## Relevant doc guide: https://rabbitmq.com/access-control.html
##
default_vhost = /
default_user = morpheus
default_pass = morphpass1
default_permissions.configure = .*
default_permissions.read = .*
default_permissions.write = .*
## Tags for default user
##
## For more details about tags, see the documentation for the
## Management Plugin at https://rabbitmq.com/management.html.
##
default_user_tags.administrator = true
---
apiVersion: v1
kind: Service
metadata:
name: elasticsearch-service
labels:
app: elasticsearch-service
spec:
ports:
- port: 9200
protocol: TCP
selector:
app: elasticsearch
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: elasticsearch-deployment
labels:
app: elasticsearch
spec:
replicas: 1
selector:
matchLabels:
app: elasticsearch
template:
metadata:
labels:
app: elasticsearch
spec:
containers:
- name: elasticsearch
image: elasticsearch:7.17.0
ports:
- containerPort: 9200
env:
- name: ES_JAVA_OPTS
value: "-Xms1024m -Xmx1024m"
- name: discovery.type
value: "single-node"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: morpheus-deployment
labels:
app: morpheus
spec:
replicas: 1
selector:
matchLabels:
app: morpheus
template:
metadata:
labels:
app: morpheus
spec:
containers:
- name: morpheus
image: morpheus-ui:5.4.10
ports:
- containerPort: 443
- containerPort: 80
env:
- name: MORPHEUS_APPLIANCE_URL
value: "https://localhost"
- name: MORPHEUS_ELASTICSEARCH_ES_HOSTS
value: "{'elasticsearch-service' => 9200}"
- name: MORPHEUS_MYSQL_HOST
value: "{'mysql-service' => 3306}"
- name: MORPHEUS_MYSQL_MORPHEUS_DB_USER
value: "root"
- name: MORPHEUS_MYSQL_MORPHEUS_DB
value: "morpheus"
- name: MORPHEUS_MYSQL_MORPHEUS_PASSWORD
value: "morphpass1"
- name: MORPHEUS_RABBITMQ_HOST
value: "rabbitmq-service"
- name: MORPHEUS_RABBITMQ_VHOST
value: "/"
- name: MORPHEUS_RABBITMQ_QUEUE_USER
value: "morpheus"
- name: MORPHEUS_RABBITMQ_QUEUE_USER_PASSWORD
value: "morphpass1"
- name: MORPHEUS_UI_MAX_MEMORY_MB
value: "3584"
securityContext:
allowPrivilegeEscalation: true
startupProbe:
httpGet:
path: /
port: 443
scheme: HTTPS
periodSeconds: 10
failureThreshold: 10
initContainers:
- name: init-myservice
image: busybox:1.28
command: ['sh', '-c', "sleep 60"]
---
apiVersion: v1
kind: Service
metadata:
name: morpheus-service
labels:
app: morpheus-service
spec:
ports:
- port: 443
protocol: TCP
selector:
app: morpheus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment