diff --git a/.env b/.env new file mode 100644 index 0000000..9029331 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +AREX_VERSION=0.2.9 \ No newline at end of file diff --git a/README.md b/README.md index b073c3f..342e4df 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,15 @@ cd deployments docker compose up -d ``` +### .env config +1. There are many configurations of Docker versions in the configuration file, which are hard-coded, such as 0.2.9. Now they have been extracted and set as variables, stored in .env file. +2. Users can directly modify the content of the .env file to change the version. +3. Users can also modify the old version number to roll back to a previous version. +``` +cat .env +AREX_VERSION=0.2.9 +``` + ## AREX Docker-Compose Uninstall ``` @@ -20,6 +29,7 @@ rm -rf ./arex-data rm -rf ./arex-logs ``` + ## License Copyright (C) 2023 ArexTest diff --git a/arex-chart/Chart.yaml b/arex-chart/Chart.yaml new file mode 100644 index 0000000..3653340 --- /dev/null +++ b/arex-chart/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +# engine: gotpl +home: http://www.arextest.com +maintainers: +- email: robin.haibingwang@gmail.com + name: robin +appVersion: "0.2.8" +description: Helm chart of AREX. +name: arex +sources: +- https://github.com/arextest +version: 0.1.0 diff --git a/arex-chart/templates/_helpers.tpl b/arex-chart/templates/_helpers.tpl new file mode 100644 index 0000000..a2a70a8 --- /dev/null +++ b/arex-chart/templates/_helpers.tpl @@ -0,0 +1,83 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "arex.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "arex.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "arex.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "arex.front.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s-%s" .Release.Name $name .Values.front.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "arex.storage.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s-%s" .Release.Name $name .Values.storage.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "arex.report.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s-%s" .Release.Name $name .Values.report.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "arex.schedule.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s-%s" .Release.Name $name .Values.schedule.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "arex.node.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s-%s" .Release.Name $name .Values.node.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "arex.mongodb.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s-%s" .Release.Name $name .Values.mongodb.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "arex.redis.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s-%s" .Release.Name $name .Values.redis.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "arex.mongoConnection" -}} +{{- if .Values.mongodb.enabled -}} +{{- printf "mongodb://arex:iLoveArex@%s.%s.svc.cluster.local:%v/arex_storage_db" (include "arex.mongodb.fullname" .) .Release.Namespace .Values.mongodb.service.servicePort -}} +{{- else -}} +{{- .Values.mongoInfo -}} +{{- end -}} +{{- end -}} + +{{- define "arex.redisConnection" -}} +{{- if .Values.redis.enabled -}} +{{- printf "redis://%s.%s.svc.cluster.local:%v/" (include "arex.redis.fullname" .) .Release.Namespace .Values.redis.service.servicePort -}} +{{- else -}} +{{- .Values.redisInfo -}} +{{- end -}} +{{- end -}} diff --git a/arex-chart/templates/arex-front-deployment.yaml b/arex-chart/templates/arex-front-deployment.yaml new file mode 100644 index 0000000..7a714a9 --- /dev/null +++ b/arex-chart/templates/arex-front-deployment.yaml @@ -0,0 +1,62 @@ +{{- if .Values.front.enabled -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: {{ template "arex.name" . }}-{{ .Values.front.name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.front.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "arex.front.fullname" . }} +spec: + replicas: {{ .Values.front.replicaCount }} + selector: + matchLabels: + app: {{ template "arex.name" . }}-{{ .Values.front.name }} + template: + metadata: + {{- if .Values.front.podAnnotations }} + annotations: +{{ toYaml .Values.front.podAnnotations | indent 8 }} + {{- end }} + labels: + app: {{ template "arex.name" . }}-{{ .Values.front.name }} + component: "{{ .Values.front.name }}" + release: {{ .Release.Name }} + spec: + containers: + - name: {{ template "arex.name" . }}-{{ .Values.front.name }} + image: "{{ .Values.registerPre }}{{ .Values.front.image.repository }}:{{ .Values.front.image.tag }}" + imagePullPolicy: "{{ .Values.front.image.pullPolicy }}" + args: + {{- range $key, $value := .Values.front.extraArgs }} + - --{{ $key }}={{ $value }} + {{- end }} + env: + - name: SERVICE_REPORT_URL + value: http://{{ template "arex.report.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.report.service.servicePort }} + - name: SERVICE_SCHEDULE_URL + value: http://{{ template "arex.schedule.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.schedule.service.servicePort }} + - name: SERVICE_NODE_URL + value: http://{{ template "arex.node.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.node.service.servicePort }} + - name: SERVICE_STORAGE_URL + value: http://{{ template "arex.storage.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.storage.service.servicePort }} + ports: + - containerPort: {{ .Values.front.service.servicePort }} + resources: +{{ toYaml .Values.front.resources | indent 12 }} + {{- if .Values.front.nodeSelector }} + nodeSelector: +{{ toYaml .Values.front.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.front.tolerations }} + tolerations: +{{ toYaml .Values.front.tolerations | indent 8 }} + {{- end }} + {{- if .Values.front.affinity }} + affinity: +{{ toYaml .Values.front.affinity | indent 8 }} + {{- end }} +{{- end }} + diff --git a/arex-chart/templates/arex-front-ingress.yaml b/arex-chart/templates/arex-front-ingress.yaml new file mode 100644 index 0000000..75a5eb4 --- /dev/null +++ b/arex-chart/templates/arex-front-ingress.yaml @@ -0,0 +1,29 @@ +{{- if and .Values.front.enabled .Values.front.ingress.enabled -}} +{{- $serviceName := include "arex.front.fullname" . }} +{{- $servicePort := .Values.front.service.servicePort -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: +{{- if .Values.front.ingress.annotations }} + annotations: +{{ toYaml .Values.front.ingress.annotations | indent 4}} +{{- end }} + name: {{ template "arex.front.fullname" . }} +spec: + defaultBackend: + service: + name: {{ $serviceName }} + port: + number: {{ $servicePort }} + # rules: + # - host: local.arextest.com + # http: + # paths: + # - path: / + # pathType: Prefix + # backend: + # service: + # name: {{ $serviceName }} + # port: + # number: {{ $servicePort }} +{{- end -}} diff --git a/arex-chart/templates/arex-front-service.yaml b/arex-chart/templates/arex-front-service.yaml new file mode 100644 index 0000000..357797f --- /dev/null +++ b/arex-chart/templates/arex-front-service.yaml @@ -0,0 +1,47 @@ +{{- if .Values.front.enabled -}} +apiVersion: v1 +kind: Service +metadata: +{{- if .Values.front.service.annotations }} + annotations: +{{ toYaml .Values.front.service.annotations | indent 4}} +{{- end }} + labels: + app: {{ template "arex.name" . }}-{{ .Values.front.name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.front.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +{{- if .Values.front.service.labels }} +{{ toYaml .Values.front.service.labels | indent 4}} +{{- end }} + name: {{ template "arex.front.fullname" . }} +spec: +{{- if .Values.front.service.clusterIP }} + clusterIP: {{ .Values.front.service.clusterIP }} +{{- end }} +{{- if .Values.front.service.externalIPs }} + externalIPs: +{{ toYaml .Values.front.service.externalIPs | indent 4 }} +{{- end }} +{{- if .Values.front.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.front.service.loadBalancerIP }} +{{- end }} +{{- if .Values.front.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range $cidr := .Values.front.service.loadBalancerSourceRanges }} + - {{ $cidr }} + {{- end }} +{{- end }} + ports: + - name: http + port: {{ .Values.front.service.servicePort }} + protocol: TCP + targetPort: {{ .Values.front.service.servicePort }} + selector: + app: {{ template "arex.name" . }}-{{ .Values.front.name }} + component: "{{ .Values.front.name }}" + release: {{ .Release.Name }} + type: "{{ .Values.front.service.type }}" +{{- end }} + diff --git a/arex-chart/templates/arex-front-serviceaccount.yaml b/arex-chart/templates/arex-front-serviceaccount.yaml new file mode 100644 index 0000000..270d5a8 --- /dev/null +++ b/arex-chart/templates/arex-front-serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.rbac.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app: {{ template "arex.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.front.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "arex.front.fullname" . }} +{{- end }} + diff --git a/arex-chart/templates/arex-mongodb-deployment.yaml b/arex-chart/templates/arex-mongodb-deployment.yaml new file mode 100644 index 0000000..41c5764 --- /dev/null +++ b/arex-chart/templates/arex-mongodb-deployment.yaml @@ -0,0 +1,82 @@ +{{- if .Values.mongodb.enabled -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: {{ template "arex.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.mongodb.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "arex.mongodb.fullname" . }} +spec: + replicas: {{ .Values.mongodb.replicaCount }} + selector: + matchLabels: + app: {{ template "arex.name" . }} + template: + metadata: + {{- if .Values.mongodb.podAnnotations }} + annotations: +{{ toYaml .Values.mongodb.podAnnotations | indent 8 }} + {{- end }} + labels: + app: {{ template "arex.name" . }} + component: "{{ .Values.mongodb.name }}" + release: {{ .Release.Name }} + spec: + containers: + - name: {{ template "arex.name" . }}-{{ .Values.mongodb.name }} + image: "{{ .Values.mongodb.image.repository }}:{{ .Values.mongodb.image.tag }}" + imagePullPolicy: "{{ .Values.mongodb.image.pullPolicy }}" + args: + {{- range $key, $value := .Values.mongodb.extraArgs }} + - --{{ $key }}={{ $value }} + {{- end }} + env: + - name: MONGO_INITDB_ROOT_USERNAME + value: citizix + - name: MONGO_INITDB_ROOT_PASSWORD + value: S3cret + - name: MONGO_INITDB_DATABASE + value: rootdb + - name: MONGO_USERNAME + value: arex + - name: MONGO_PASSWORD + value: iLoveArex + ports: + - containerPort: 27017 + volumeMounts: + - name: mongodb-config + mountPath: /etc/mongo.conf + - name: mongo-data + mountPath: /data/db + - name: settings + mountPath: /docker-entrypoint-initdb.d/mongo-init.js + subPath: mongo-allone-init.js + resources: +{{ toYaml .Values.mongodb.resources | indent 12 }} + {{- if .Values.mongodb.nodeSelector }} + nodeSelector: +{{ toYaml .Values.mongodb.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.mongodb.tolerations }} + tolerations: +{{ toYaml .Values.mongodb.tolerations | indent 8 }} + {{- end }} + {{- if .Values.mongodb.affinity }} + affinity: +{{ toYaml .Values.mongodb.affinity | indent 8 }} + {{- end }} + volumes: + - name: mongo-data + persistentVolumeClaim: + claimName: arex-mongodb-pvc + - name: settings + configMap: + name: arex-mongodb-init + - name: mongodb-config + configMap: + name: mongodb-conf +{{- end }} + diff --git a/arex-chart/templates/arex-mongodb-service.yaml b/arex-chart/templates/arex-mongodb-service.yaml new file mode 100644 index 0000000..0db62fd --- /dev/null +++ b/arex-chart/templates/arex-mongodb-service.yaml @@ -0,0 +1,47 @@ +{{- if .Values.mongodb.enabled -}} +apiVersion: v1 +kind: Service +metadata: +{{- if .Values.mongodb.service.annotations }} + annotations: +{{ toYaml .Values.mongodb.service.annotations | indent 4}} +{{- end }} + labels: + app: {{ template "arex.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.mongodb.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +{{- if .Values.mongodb.service.labels }} +{{ toYaml .Values.mongodb.service.labels | indent 4}} +{{- end }} + name: {{ template "arex.mongodb.fullname" . }} +spec: +{{- if .Values.mongodb.service.clusterIP }} + clusterIP: {{ .Values.mongodb.service.clusterIP }} +{{- end }} +{{- if .Values.mongodb.service.externalIPs }} + externalIPs: +{{ toYaml .Values.mongodb.service.externalIPs | indent 4 }} +{{- end }} +{{- if .Values.mongodb.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.mongodb.service.loadBalancerIP }} +{{- end }} +{{- if .Values.mongodb.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range $cidr := .Values.mongodb.service.loadBalancerSourceRanges }} + - {{ $cidr }} + {{- end }} +{{- end }} + ports: + - name: mongo-port + port: {{ .Values.mongodb.service.servicePort }} + protocol: TCP + targetPort: {{ .Values.mongodb.service.servicePort }} + selector: + app: {{ template "arex.name" . }} + component: "{{ .Values.mongodb.name }}" + release: {{ .Release.Name }} + type: "{{ .Values.mongodb.service.type }}" +{{- end }} + diff --git a/arex-chart/templates/arex-node-deployment.yaml b/arex-chart/templates/arex-node-deployment.yaml new file mode 100644 index 0000000..e53e8dd --- /dev/null +++ b/arex-chart/templates/arex-node-deployment.yaml @@ -0,0 +1,53 @@ +{{- if .Values.node.enabled -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: {{ template "arex.name" . }}-{{ .Values.node.name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.node.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "arex.node.fullname" . }} +spec: + replicas: {{ .Values.node.replicaCount }} + selector: + matchLabels: + app: {{ template "arex.name" . }}-{{ .Values.node.name }} + template: + metadata: + {{- if .Values.node.podAnnotations }} + annotations: +{{ toYaml .Values.node.podAnnotations | indent 8 }} + {{- end }} + labels: + app: {{ template "arex.name" . }}-{{ .Values.node.name }} + component: "{{ .Values.node.name }}" + release: {{ .Release.Name }} + spec: + containers: + - name: {{ template "arex.name" . }}-{{ .Values.node.name }} + image: "{{ .Values.registerPre }}{{ .Values.node.image.repository }}:{{ .Values.node.image.tag }}" + imagePullPolicy: "{{ .Values.node.image.pullPolicy }}" + args: + {{- range $key, $value := .Values.node.extraArgs }} + - --{{ $key }}={{ $value }} + {{- end }} + ports: + - containerPort: {{ .Values.node.service.servicePort }} + resources: +{{ toYaml .Values.node.resources | indent 12 }} + {{- if .Values.node.nodeSelector }} + nodeSelector: +{{ toYaml .Values.node.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.node.tolerations }} + tolerations: +{{ toYaml .Values.node.tolerations | indent 8 }} + {{- end }} + {{- if .Values.node.affinity }} + affinity: +{{ toYaml .Values.node.affinity | indent 8 }} + {{- end }} +{{- end }} + diff --git a/arex-chart/templates/arex-pvc-mongo.yml b/arex-chart/templates/arex-pvc-mongo.yml new file mode 100644 index 0000000..27bc886 --- /dev/null +++ b/arex-chart/templates/arex-pvc-mongo.yml @@ -0,0 +1,28 @@ +{{- if .Values.mongodb.enabled -}} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: arex-pv-mongo-volume + labels: + type: local +spec: + storageClassName: local-storage + capacity: + storage: {{ .Values.mongodb.storage }} + accessModes: + - ReadWriteMany + hostPath: + path: "/mnt/data" +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: arex-mongodb-pvc +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .Values.mongodb.storage }} + storageClassName: local-storage +{{- end -}} \ No newline at end of file diff --git a/arex-chart/templates/arex-pvc-redis.yaml b/arex-chart/templates/arex-pvc-redis.yaml new file mode 100644 index 0000000..29ebfed --- /dev/null +++ b/arex-chart/templates/arex-pvc-redis.yaml @@ -0,0 +1,28 @@ +{{- if .Values.redis.enabled -}} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: arex-pv-redis-volume + labels: + type: local +spec: + storageClassName: local-storage + capacity: + storage: {{ .Values.redis.storage }} + accessModes: + - ReadWriteMany + hostPath: + path: "/mnt/data" +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: arex-redis-pvc +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .Values.redis.storage }} + storageClassName: local-storage +{{- end}} \ No newline at end of file diff --git a/arex-chart/templates/arex-redis-deployment.yaml b/arex-chart/templates/arex-redis-deployment.yaml new file mode 100644 index 0000000..7e648f9 --- /dev/null +++ b/arex-chart/templates/arex-redis-deployment.yaml @@ -0,0 +1,60 @@ +{{- if .Values.redis.enabled -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: {{ template "arex.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.redis.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "arex.redis.fullname" . }} +spec: + replicas: {{ .Values.redis.replicaCount }} + selector: + matchLabels: + app: {{ template "arex.name" . }} + template: + metadata: + {{- if .Values.redis.podAnnotations }} + annotations: +{{ toYaml .Values.redis.podAnnotations | indent 8 }} + {{- end }} + labels: + app: {{ template "arex.name" . }} + component: "{{ .Values.redis.name }}" + release: {{ .Release.Name }} + spec: + containers: + - name: {{ template "arex.name" . }}-{{ .Values.redis.name }} + image: "{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}" + imagePullPolicy: "{{ .Values.redis.image.pullPolicy }}" + args: + {{- range $key, $value := .Values.redis.extraArgs }} + - --{{ $key }}={{ $value }} + {{- end }} + ports: + - containerPort: 6379 + volumeMounts: + - name: redis-data + mountPath: /data + resources: +{{ toYaml .Values.redis.resources | indent 12 }} + {{- if .Values.redis.nodeSelector }} + nodeSelector: +{{ toYaml .Values.redis.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.redis.tolerations }} + tolerations: +{{ toYaml .Values.redis.tolerations | indent 8 }} + {{- end }} + {{- if .Values.redis.affinity }} + affinity: +{{ toYaml .Values.redis.affinity | indent 8 }} + {{- end }} + volumes: + - name: redis-data + persistentVolumeClaim: + claimName: arex-redis-pvc +{{- end }} + diff --git a/arex-chart/templates/arex-redis-service.yaml b/arex-chart/templates/arex-redis-service.yaml new file mode 100644 index 0000000..a1cdec7 --- /dev/null +++ b/arex-chart/templates/arex-redis-service.yaml @@ -0,0 +1,47 @@ +{{- if .Values.redis.enabled -}} +apiVersion: v1 +kind: Service +metadata: +{{- if .Values.redis.service.annotations }} + annotations: +{{ toYaml .Values.redis.service.annotations | indent 4}} +{{- end }} + labels: + app: {{ template "arex.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.redis.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +{{- if .Values.redis.service.labels }} +{{ toYaml .Values.redis.service.labels | indent 4}} +{{- end }} + name: {{ template "arex.redis.fullname" . }} +spec: +{{- if .Values.redis.service.clusterIP }} + clusterIP: {{ .Values.redis.service.clusterIP }} +{{- end }} +{{- if .Values.redis.service.externalIPs }} + externalIPs: +{{ toYaml .Values.redis.service.externalIPs | indent 4 }} +{{- end }} +{{- if .Values.redis.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.redis.service.loadBalancerIP }} +{{- end }} +{{- if .Values.redis.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range $cidr := .Values.redis.service.loadBalancerSourceRanges }} + - {{ $cidr }} + {{- end }} +{{- end }} + ports: + - name: redis-port + port: {{ .Values.redis.service.servicePort }} + protocol: TCP + targetPort: {{ .Values.redis.service.servicePort }} + selector: + app: {{ template "arex.name" . }} + component: "{{ .Values.redis.name }}" + release: {{ .Release.Name }} + type: "{{ .Values.redis.service.type }}" +{{- end }} + diff --git a/arex-chart/templates/arex-report-deployment.yaml b/arex-chart/templates/arex-report-deployment.yaml new file mode 100644 index 0000000..3f36b0a --- /dev/null +++ b/arex-chart/templates/arex-report-deployment.yaml @@ -0,0 +1,59 @@ +{{- if .Values.report.enabled -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: {{ template "arex.name" . }}-{{ .Values.report.name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.report.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "arex.report.fullname" . }} +spec: + replicas: {{ .Values.report.replicaCount }} + selector: + matchLabels: + app: {{ template "arex.name" . }}-{{ .Values.report.name }} + template: + metadata: + {{- if .Values.report.podAnnotations }} + annotations: +{{ toYaml .Values.report.podAnnotations | indent 8 }} + {{- end }} + labels: + app: {{ template "arex.name" . }}-{{ .Values.report.name }} + component: "{{ .Values.report.name }}" + release: {{ .Release.Name }} + spec: + containers: + - name: {{ template "arex.name" . }}-{{ .Values.report.name }} + image: "{{ .Values.registerPre }}{{ .Values.report.image.repository }}:{{ .Values.report.image.tag }}" + imagePullPolicy: "{{ .Values.report.image.pullPolicy }}" + args: + {{- range $key, $value := .Values.report.extraArgs }} + - --{{ $key }}={{ $value }} + {{- end }} + env: + - name: JAVA_OPTS + value: -Darex.report.mongo.uri={{ include "arex.mongoConnection" .}} + -Darex.redis.uri={{ include "arex.redisConnection" .}} + -Darex.storage.service.url=http://{{ template "arex.storage.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.storage.service.servicePort }} + -Darex.ui.url=http://{{ template "arex.front.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.front.service.servicePort }} + ports: + - containerPort: {{ .Values.report.service.servicePort }} + resources: +{{ toYaml .Values.report.resources | indent 12 }} + {{- if .Values.report.nodeSelector }} + nodeSelector: +{{ toYaml .Values.report.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.report.tolerations }} + tolerations: +{{ toYaml .Values.report.tolerations | indent 8 }} + {{- end }} + {{- if .Values.report.affinity }} + affinity: +{{ toYaml .Values.report.affinity | indent 8 }} + {{- end }} +{{- end }} + diff --git a/arex-chart/templates/arex-report-service.yaml b/arex-chart/templates/arex-report-service.yaml new file mode 100644 index 0000000..d4d6b7e --- /dev/null +++ b/arex-chart/templates/arex-report-service.yaml @@ -0,0 +1,47 @@ +{{- if .Values.report.enabled -}} +apiVersion: v1 +kind: Service +metadata: +{{- if .Values.report.service.annotations }} + annotations: +{{ toYaml .Values.report.service.annotations | indent 4}} +{{- end }} + labels: + app: {{ template "arex.name" . }}-{{ .Values.report.name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.report.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +{{- if .Values.report.service.labels }} +{{ toYaml .Values.report.service.labels | indent 4}} +{{- end }} + name: {{ template "arex.report.fullname" . }} +spec: +{{- if .Values.report.service.clusterIP }} + clusterIP: {{ .Values.report.service.clusterIP }} +{{- end }} +{{- if .Values.report.service.externalIPs }} + externalIPs: +{{ toYaml .Values.report.service.externalIPs | indent 4 }} +{{- end }} +{{- if .Values.report.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.report.service.loadBalancerIP }} +{{- end }} +{{- if .Values.report.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range $cidr := .Values.report.service.loadBalancerSourceRanges }} + - {{ $cidr }} + {{- end }} +{{- end }} + ports: + - name: http + port: {{ .Values.report.service.servicePort }} + protocol: TCP + targetPort: {{ .Values.report.service.servicePort }} + selector: + app: {{ template "arex.name" . }}-{{ .Values.report.name }} + component: "{{ .Values.report.name }}" + release: {{ .Release.Name }} + type: "{{ .Values.report.service.type }}" +{{- end }} + diff --git a/arex-chart/templates/arex-report-serviceaccount.yaml b/arex-chart/templates/arex-report-serviceaccount.yaml new file mode 100644 index 0000000..a38410f --- /dev/null +++ b/arex-chart/templates/arex-report-serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.rbac.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app: {{ template "arex.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.report.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "arex.report.fullname" . }} +{{- end }} + diff --git a/arex-chart/templates/arex-schedule-deployment.yaml b/arex-chart/templates/arex-schedule-deployment.yaml new file mode 100644 index 0000000..8067049 --- /dev/null +++ b/arex-chart/templates/arex-schedule-deployment.yaml @@ -0,0 +1,59 @@ +{{- if .Values.schedule.enabled -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: {{ template "arex.name" . }}-{{ .Values.schedule.name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.schedule.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "arex.schedule.fullname" . }} +spec: + replicas: {{ .Values.schedule.replicaCount }} + selector: + matchLabels: + app: {{ template "arex.name" . }}-{{ .Values.schedule.name }} + template: + metadata: + {{- if .Values.schedule.podAnnotations }} + annotations: +{{ toYaml .Values.schedule.podAnnotations | indent 8 }} + {{- end }} + labels: + app: {{ template "arex.name" . }}-{{ .Values.schedule.name }} + component: "{{ .Values.schedule.name }}" + release: {{ .Release.Name }} + spec: + containers: + - name: {{ template "arex.name" . }}-{{ .Values.schedule.name }} + image: "{{ .Values.registerPre }}{{ .Values.schedule.image.repository }}:{{ .Values.schedule.image.tag }}" + imagePullPolicy: "{{ .Values.schedule.image.pullPolicy }}" + args: + {{- range $key, $value := .Values.schedule.extraArgs }} + - --{{ $key }}={{ $value }} + {{- end }} + env: + - name: JAVA_OPTS + value: -Dmongo.uri={{ include "arex.mongoConnection" .}} + -Darex.schedule.cache.redis.host={{ include "arex.redisConnection" .}} + -Darex.storage.service.api=http://{{ template "arex.storage.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.storage.service.servicePort }} + -Darex.report.service.api=http://{{ template "arex.report.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.report.service.servicePort }} + ports: + - containerPort: {{ .Values.schedule.service.servicePort }} + resources: +{{ toYaml .Values.schedule.resources | indent 12 }} + {{- if .Values.schedule.nodeSelector }} + nodeSelector: +{{ toYaml .Values.schedule.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.schedule.tolerations }} + tolerations: +{{ toYaml .Values.schedule.tolerations | indent 8 }} + {{- end }} + {{- if .Values.schedule.affinity }} + affinity: +{{ toYaml .Values.schedule.affinity | indent 8 }} + {{- end }} +{{- end }} + diff --git a/arex-chart/templates/arex-schedule-service.yaml b/arex-chart/templates/arex-schedule-service.yaml new file mode 100644 index 0000000..45637ca --- /dev/null +++ b/arex-chart/templates/arex-schedule-service.yaml @@ -0,0 +1,47 @@ +{{- if .Values.schedule.enabled -}} +apiVersion: v1 +kind: Service +metadata: +{{- if .Values.schedule.service.annotations }} + annotations: +{{ toYaml .Values.schedule.service.annotations | indent 4}} +{{- end }} + labels: + app: {{ template "arex.name" . }}-{{ .Values.schedule.name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.schedule.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +{{- if .Values.schedule.service.labels }} +{{ toYaml .Values.schedule.service.labels | indent 4}} +{{- end }} + name: {{ template "arex.schedule.fullname" . }} +spec: +{{- if .Values.schedule.service.clusterIP }} + clusterIP: {{ .Values.schedule.service.clusterIP }} +{{- end }} +{{- if .Values.schedule.service.externalIPs }} + externalIPs: +{{ toYaml .Values.schedule.service.externalIPs | indent 4 }} +{{- end }} +{{- if .Values.schedule.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.schedule.service.loadBalancerIP }} +{{- end }} +{{- if .Values.schedule.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range $cidr := .Values.schedule.service.loadBalancerSourceRanges }} + - {{ $cidr }} + {{- end }} +{{- end }} + ports: + - name: http + port: {{ .Values.schedule.service.servicePort }} + protocol: TCP + targetPort: {{ .Values.schedule.service.servicePort }} + selector: + app: {{ template "arex.name" . }}-{{ .Values.schedule.name }} + component: "{{ .Values.schedule.name }}" + release: {{ .Release.Name }} + type: "{{ .Values.schedule.service.type }}" +{{- end }} + diff --git a/arex-chart/templates/arex-schedule-serviceaccount.yaml b/arex-chart/templates/arex-schedule-serviceaccount.yaml new file mode 100644 index 0000000..7f1373b --- /dev/null +++ b/arex-chart/templates/arex-schedule-serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.rbac.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app: {{ template "arex.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.schedule.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "arex.schedule.fullname" . }} +{{- end }} + diff --git a/arex-chart/templates/arex-storage-deployment.yaml b/arex-chart/templates/arex-storage-deployment.yaml new file mode 100644 index 0000000..6f638cf --- /dev/null +++ b/arex-chart/templates/arex-storage-deployment.yaml @@ -0,0 +1,58 @@ +{{- if .Values.storage.enabled -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: {{ template "arex.name" . }}-{{ .Values.storage.name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.storage.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "arex.storage.fullname" . }} +spec: + replicas: {{ .Values.storage.replicaCount }} + selector: + matchLabels: + app: {{ template "arex.name" . }}-{{ .Values.storage.name }} + template: + metadata: + {{- if .Values.storage.podAnnotations }} + annotations: +{{ toYaml .Values.storage.podAnnotations | indent 8 }} + {{- end }} + labels: + app: {{ template "arex.name" . }}-{{ .Values.storage.name }} + component: "{{ .Values.storage.name }}" + release: {{ .Release.Name }} + spec: + containers: + - name: {{ template "arex.name" . }}-{{ .Values.storage.name }} + image: "{{ .Values.registerPre }}{{ .Values.storage.image.repository }}:{{ .Values.storage.image.tag }}" + imagePullPolicy: "{{ .Values.storage.image.pullPolicy }}" + args: + {{- range $key, $value := .Values.storage.extraArgs }} + - --{{ $key }}={{ $value }} + {{- end }} + env: + - name: JAVA_OPTS + value: -Darex.storage.mongo.host={{ include "arex.mongoConnection" .}} + -Darex.storage.cache.url={{ include "arex.redisConnection" .}} + -Darex.report.service.api=http://{{ template "arex.report.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.report.service.servicePort }}/ + ports: + - containerPort: {{ .Values.storage.service.servicePort }} + resources: +{{ toYaml .Values.storage.resources | indent 12 }} + {{- if .Values.storage.nodeSelector }} + nodeSelector: +{{ toYaml .Values.storage.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.storage.tolerations }} + tolerations: +{{ toYaml .Values.storage.tolerations | indent 8 }} + {{- end }} + {{- if .Values.storage.affinity }} + affinity: +{{ toYaml .Values.storage.affinity | indent 8 }} + {{- end }} +{{- end }} + diff --git a/arex-chart/templates/arex-storage-service.yaml b/arex-chart/templates/arex-storage-service.yaml new file mode 100644 index 0000000..37baa02 --- /dev/null +++ b/arex-chart/templates/arex-storage-service.yaml @@ -0,0 +1,47 @@ +{{- if .Values.storage.enabled -}} +apiVersion: v1 +kind: Service +metadata: +{{- if .Values.storage.service.annotations }} + annotations: +{{ toYaml .Values.storage.service.annotations | indent 4}} +{{- end }} + labels: + app: {{ template "arex.name" . }}-{{ .Values.storage.name }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.storage.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +{{- if .Values.storage.service.labels }} +{{ toYaml .Values.storage.service.labels | indent 4}} +{{- end }} + name: {{ template "arex.storage.fullname" . }} +spec: +{{- if .Values.storage.service.clusterIP }} + clusterIP: {{ .Values.storage.service.clusterIP }} +{{- end }} +{{- if .Values.storage.service.externalIPs }} + externalIPs: +{{ toYaml .Values.storage.service.externalIPs | indent 4 }} +{{- end }} +{{- if .Values.storage.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.storage.service.loadBalancerIP }} +{{- end }} +{{- if .Values.storage.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range $cidr := .Values.storage.service.loadBalancerSourceRanges }} + - {{ $cidr }} + {{- end }} +{{- end }} + ports: + - name: http + port: {{ .Values.storage.service.servicePort }} + protocol: TCP + targetPort: {{ .Values.storage.service.servicePort }} + selector: + app: {{ template "arex.name" . }}-{{ .Values.storage.name }} + component: "{{ .Values.storage.name }}" + release: {{ .Release.Name }} + type: "{{ .Values.storage.service.type }}" +{{- end }} + diff --git a/arex-chart/templates/arex-storage-serviceaccount.yaml b/arex-chart/templates/arex-storage-serviceaccount.yaml new file mode 100644 index 0000000..2d1e3ec --- /dev/null +++ b/arex-chart/templates/arex-storage-serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.rbac.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app: {{ template "arex.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + component: "{{ .Values.storage.name }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "arex.storage.fullname" . }} +{{- end }} + diff --git a/arex-chart/templates/arex-storageclass.yml b/arex-chart/templates/arex-storageclass.yml new file mode 100644 index 0000000..289c706 --- /dev/null +++ b/arex-chart/templates/arex-storageclass.yml @@ -0,0 +1,8 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: local-storage +# provisioner: kubernetes.io/minikube-hostpath +# volumeBindingMode: Immediate +provisioner: kubernetes.io/no-provisioner +volumeBindingMode: WaitForFirstConsumer diff --git a/arex-chart/templates/configmap.yaml b/arex-chart/templates/configmap.yaml new file mode 100644 index 0000000..d5c1ffa --- /dev/null +++ b/arex-chart/templates/configmap.yaml @@ -0,0 +1,32 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: arex-configmap +data: + myvalue: "just-demo" +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: arex-mongodb-init +data: + mongo-allone-init.js: | + db = db.getSiblingDB("arex_storage_db"); + db.createUser({ + user: "arex", + pwd: "iLoveArex", + roles: [{ role: "readWrite", db: "arex_storage_db" }], + }); +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: mongodb-conf +data: + mongodb.conf: | + logpath=/data/mongodb/mongodb.log + pidfilepath=/data/mongodb/master.pid + directoryperdb=true + logappend=true + bind_ip=0.0.0.0 + port=27017 diff --git a/arex-chart/values.yaml b/arex-chart/values.yaml new file mode 100644 index 0000000..27126ae --- /dev/null +++ b/arex-chart/values.yaml @@ -0,0 +1,213 @@ +rbac: + create: false + +nameOverride: "" +fullnameOverride: "" +# register prefix +registerPre: "arexadmin01/" +# mongodb config demo +mongoInfo: "mongodb://arex:iLoveArex@10.5.153.1:27017/arex_storage_db" +# redis config demo +redisInfo: "redis://10.5.153.1:6390/" + +front: + enabled: true + name: ui + image: + repository: arex + tag: 0.2.9 + pullPolicy: IfNotPresent + + serviceAcountName: default + extraArgs: {} + prefixURL: "" + baseURL: "" + + replicaCount: 1 + service: + annotations: {} + labels: {} + clusterIP: "" + externalIPs: [] + + loadBalancerIP: "" + loadBalancerSourceRanges: [] + servicePort: 8080 + type: ClusterIP + + ingress: + enabled: true + annotations: {} + hosts: ["local.arextest.com"] + tls: "" + + resources: {} + nodeSelector: {} + podAnnotations: {} + tolerations: {} + +storage: + enabled: true + name: storage + image: + repository: arex-storage-serive + tag: 0.2.9 + pullPolicy: IfNotPresent + serviceAcountName: default + extraArgs: {} + prefixURL: "" + baseURL: "" + replicaCount: 1 + service: + annotations: {} + labels: {} + clusterIP: "" + externalIPs: [] + loadBalancerIP: "" + loadBalancerSourceRanges: [] + servicePort: 8080 + type: ClusterIP + resources: {} + nodeSelector: {} + podAnnotations: {} + tolerations: {} + +report: + enabled: true + name: report + image: + repository: arex-report + tag: 0.2.9 + pullPolicy: IfNotPresent + + serviceAcountName: default + extraArgs: {} + prefixURL: "" + baseURL: "" + + replicaCount: 1 + service: + annotations: {} + labels: {} + clusterIP: "" + externalIPs: [] + + loadBalancerIP: "" + loadBalancerSourceRanges: [] + servicePort: 8080 + type: ClusterIP + + resources: {} + nodeSelector: {} + podAnnotations: {} + tolerations: {} + +schedule: + enabled: true + name: schedule + image: + repository: arex-replay-schedule + tag: 0.2.9 + pullPolicy: IfNotPresent + replicaCount: 1 + service: + annotations: {} + labels: {} + clusterIP: "" + externalIPs: [] + + loadBalancerIP: "" + loadBalancerSourceRanges: [] + servicePort: 8080 + type: ClusterIP + + nodeSelector: {} + podAnnotations: {} + tolerations: {} + resources: {} + +node: + enabled: true + name: node + image: + repository: arex-node + tag: 0.2.7 + pullPolicy: IfNotPresent + + serviceAcountName: default + extraArgs: {} + prefixURL: "" + baseURL: "" + + replicaCount: 1 + service: + annotations: {} + labels: {} + clusterIP: "" + externalIPs: [] + + loadBalancerIP: "" + loadBalancerSourceRanges: [] + servicePort: 3000 + type: ClusterIP + + ingress: + enabled: false + annotations: {} + hosts: [] + tls: "" + + resources: {} + nodeSelector: {} + podAnnotations: {} + tolerations: {} + +mongodb: + enabled: true + name: mongodb + storage: 5Gi + image: + repository: mongo + tag: 5.0 + pullPolicy: IfNotPresent + replicaCount: 1 + service: + annotations: {} + labels: {} + clusterIP: "" + externalIPs: [] + + loadBalancerIP: "" + loadBalancerSourceRanges: [] + servicePort: 27017 + type: ClusterIP + + nodeSelector: {} + podAnnotations: {} + tolerations: {} + resources: {} + +redis: + enabled: true + name: redis + storage: 1Gi + image: + repository: redis + tag: 6.2.6 + pullPolicy: IfNotPresent + replicaCount: 1 + service: + annotations: {} + labels: {} + clusterIP: "" + externalIPs: [] + + loadBalancerIP: "" + loadBalancerSourceRanges: [] + servicePort: 6379 + type: ClusterIP + + nodeSelector: {} + podAnnotations: {} + tolerations: {} + resources: {} diff --git a/docker-compose-distribute.yml b/docker-compose-distribute.yml index 4cf07a2..85381aa 100644 --- a/docker-compose-distribute.yml +++ b/docker-compose-distribute.yml @@ -2,7 +2,7 @@ version: "3" services: arex: - image: arexadmin01/arex:0.2.8 + image: arexadmin01/arex:$AREX_VERSION container_name: arex-front restart: always ports: @@ -29,7 +29,7 @@ services: - ./arex-logs/arex-node:/usr/src/app/logs arex-report-service: - image: arexadmin01/arex-report:0.2.8 + image: arexadmin01/arex-report:$AREX_VERSION container_name: arex-report restart: always ports: @@ -45,7 +45,7 @@ services: - mongodb - redis arex-storage-service1: - image: arexadmin01/arex-storage-serive:0.2.8 + image: arexadmin01/arex-storage-serive:$AREX_VERSION container_name: arex-storage1 restart: always ports: @@ -60,7 +60,7 @@ services: - mongodb - redis arex-storage-service2: - image: arexadmin01/arex-storage-serive:0.2.8 + image: arexadmin01/arex-storage-serive:$AREX_VERSION container_name: arex-storage2 restart: always ports: @@ -86,7 +86,7 @@ services: - arex-storage-service1 - arex-storage-service2 arex-schedule-service1: - image: arexadmin01/arex-replay-schedule:0.2.8 + image: arexadmin01/arex-replay-schedule:$AREX_VERSION container_name: arex-schedule1 restart: always ports: @@ -102,7 +102,7 @@ services: - mongodb - redis arex-schedule-service2: - image: arexadmin01/arex-replay-schedule:0.2.8 + image: arexadmin01/arex-replay-schedule:$AREX_VERSION container_name: arex-schedule2 restart: always ports: diff --git a/docker-compose-mongo4.4.21.yml b/docker-compose-mongo4.4.21.yml new file mode 100644 index 0000000..0321d12 --- /dev/null +++ b/docker-compose-mongo4.4.21.yml @@ -0,0 +1,103 @@ +version: "3" + +services: + arex: + image: arexadmin01/arex:$AREX_VERSION + container_name: arex-front + restart: always + ports: + - '8088:8080' + volumes: + - ./arex-logs/arex-front:/usr/src/app/logs + environment: + - SERVICE_REPORT_URL=http://arex-report-service:8080 + - SERVICE_SCHEDULE_URL=http://arex-schedule-service:8080 + - SERVICE_NODE_URL=http://arex-node:3000 + - SERVICE_STORAGE_URL=http://arex-storage-service:8080 + depends_on: + - arex-report-service + - arex-schedule-service + - arex-storage-service + - arex-node + arex-node: + image: arexadmin01/arex-node:0.2.7 + container_name: arex-node + restart: always + ports: + - '10001:3000' + volumes: + - ./arex-logs/arex-node:/usr/src/app/logs + arex-report-service: + image: arexadmin01/arex-report:$AREX_VERSION + container_name: arex-report + restart: always + ports: + - '8090:8080' + volumes: + - ./arex-logs/arex-report:/usr/local/tomcat/logs + environment: + - JAVA_OPTS=-Darex.report.mongo.uri=mongodb://arex:iLoveArex@mongodb:27017/arex_storage_db + -Darex.redis.uri=redis://redis:6379/ + -Darex.storage.service.url=http://arex-storage-service:8080 + -Darex.ui.url=http://arex:8080 + depends_on: + - mongodb + - redis + arex-storage-service: + image: arexadmin01/arex-storage-serive:$AREX_VERSION + container_name: arex-storage + restart: always + ports: + - '8093:8080' + volumes: + - ./arex-logs/arex-storage:/usr/local/tomcat/logs + environment: + - JAVA_OPTS=-Darex.storage.mongo.host=mongodb://arex:iLoveArex@mongodb:27017/arex_storage_db + -Darex.storage.cache.url=redis://redis:6379/ + -Darex.report.service.api=http://arex-report-service:8080 + depends_on: + - mongodb + - redis + arex-schedule-service: + image: arexadmin01/arex-replay-schedule:$AREX_VERSION + container_name: arex-schedule + restart: always + ports: + - '8092:8080' + volumes: + - ./arex-logs/arex-schedule:/usr/local/tomcat/logs + environment: + - JAVA_OPTS=-Dmongo.uri=mongodb://arex:iLoveArex@mongodb:27017/arex_storage_db + -Darex.schedule.cache.redis.host=redis://redis:6379 + -Darex.storage.service.api=http://arex-storage-service:8080 + -Darex.report.service.api=http://arex-report-service:8080 + depends_on: + - mongodb + - redis + mongodb: + image: mongo:4.4.21 + container_name: arex-mongodb + restart: always + ports: + - 27017:27017 + volumes: + - ./arex-data/mongodb:/data/db + - ./mongo-allone-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro + - ./arex-logs/mongodb:/var/log/mongodb + command: --auth + environment: + - MONGO_INITDB_ROOT_USERNAME=citizix + - MONGO_INITDB_ROOT_PASSWORD=S3cret + - MONGO_INITDB_DATABASE=rootdb + - MONGO_USERNAME=arex + - MONGO_PASSWORD=iLoveArex + redis: + image: redis:6.2.6 + container_name: arex-redis + restart: always + command: --appendonly yes + ports: + - 6379:6379 + volumes: + - ./arex-data/redis:/data + - ./arex-logs/redis:/var/log/redis diff --git a/docker-compose.yml b/docker-compose.yml index 277c986..351ec1f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3" services: arex: - image: arexadmin01/arex:0.2.8 + image: arexadmin01/arex:$AREX_VERSION container_name: arex-front restart: always ports: @@ -28,7 +28,7 @@ services: volumes: - ./arex-logs/arex-node:/usr/src/app/logs arex-report-service: - image: arexadmin01/arex-report:0.2.8 + image: arexadmin01/arex-report:$AREX_VERSION container_name: arex-report restart: always ports: @@ -44,7 +44,7 @@ services: - mongodb - redis arex-storage-service: - image: arexadmin01/arex-storage-serive:0.2.8 + image: arexadmin01/arex-storage-serive:$AREX_VERSION container_name: arex-storage restart: always ports: @@ -59,7 +59,7 @@ services: - mongodb - redis arex-schedule-service: - image: arexadmin01/arex-replay-schedule:0.2.8 + image: arexadmin01/arex-replay-schedule:$AREX_VERSION container_name: arex-schedule restart: always ports: