From ac1864d58a57bd65cf69566c900a2b206f64b9a8 Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Fri, 24 May 2024 16:15:02 +0700 Subject: [PATCH 1/3] add selfhost kube config Signed-off-by: Alexander Onnikov --- kube/account/account-deployment.yaml | 72 +++++++++++++++ kube/account/account-ingress.yaml | 21 +++++ kube/account/account-service.yaml | 12 +++ .../collaborator/collaborator-deployment.yaml | 59 ++++++++++++ kube/collaborator/collaborator-ingress.yaml | 21 +++++ kube/collaborator/collaborator-service.yaml | 12 +++ kube/config/config.yaml | 15 +++ kube/config/secret.yaml | 9 ++ kube/front/front-deployment.yaml | 92 +++++++++++++++++++ kube/front/front-ingress.yaml | 21 +++++ kube/front/front-service.yaml | 12 +++ kube/rekoni/rekoni-deployment.yaml | 33 +++++++ kube/rekoni/rekoni-ingress.yaml | 21 +++++ kube/rekoni/rekoni-service.yaml | 12 +++ kube/transactor/transactor-deployment.yaml | 77 ++++++++++++++++ kube/transactor/transactor-ingress.yaml | 21 +++++ kube/transactor/transactor-service.yaml | 13 +++ 17 files changed, 523 insertions(+) create mode 100644 kube/account/account-deployment.yaml create mode 100644 kube/account/account-ingress.yaml create mode 100644 kube/account/account-service.yaml create mode 100644 kube/collaborator/collaborator-deployment.yaml create mode 100644 kube/collaborator/collaborator-ingress.yaml create mode 100644 kube/collaborator/collaborator-service.yaml create mode 100644 kube/config/config.yaml create mode 100644 kube/config/secret.yaml create mode 100644 kube/front/front-deployment.yaml create mode 100644 kube/front/front-ingress.yaml create mode 100644 kube/front/front-service.yaml create mode 100644 kube/rekoni/rekoni-deployment.yaml create mode 100644 kube/rekoni/rekoni-ingress.yaml create mode 100644 kube/rekoni/rekoni-service.yaml create mode 100644 kube/transactor/transactor-deployment.yaml create mode 100644 kube/transactor/transactor-ingress.yaml create mode 100644 kube/transactor/transactor-service.yaml diff --git a/kube/account/account-deployment.yaml b/kube/account/account-deployment.yaml new file mode 100644 index 0000000..a719b1f --- /dev/null +++ b/kube/account/account-deployment.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: account + name: account +spec: + replicas: 1 + selector: + matchLabels: + app: account + template: + metadata: + labels: + app: account + spec: + containers: + - env: + - name: ACCOUNTS_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: ACCOUNTS_URL + - name: ACCOUNT_PORT + value: '3000' + - name: FRONT_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: FRONT_URL + - name: MINIO_ACCESS_KEY + valueFrom: + secretKeyRef: + name: huly-secret + key: MINIO_ACCESS_KEY + - name: MINIO_ENDPOINT + valueFrom: + configMapKeyRef: + name: huly-config + key: MINIO_ENDPOINT + - name: MINIO_SECRET_KEY + valueFrom: + secretKeyRef: + name: huly-secret + key: MINIO_SECRET_KEY + - name: MODEL_ENABLED + value: '*' + - name: MONGO_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: MONGO_URL + - name: SERVER_SECRET + valueFrom: + secretKeyRef: + name: huly-secret + key: SERVER_SECRET + - name: TRANSACTOR_URL + value: ws://transactor/ + - name: ENDPOINT_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: TRANSACTOR_URL + image: hardcoreeng/account:latest + name: account + ports: + - containerPort: 3000 + resources: + limits: + memory: "512M" + restartPolicy: Always diff --git a/kube/account/account-ingress.yaml b/kube/account/account-ingress.yaml new file mode 100644 index 0000000..93a82ce --- /dev/null +++ b/kube/account/account-ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: nginx + labels: + app: account + name: account +spec: + ingressClassName: nginx + rules: + - host: account.huly.example + http: + paths: + - backend: + service: + name: account + port: + number: 80 + path: / + pathType: Prefix diff --git a/kube/account/account-service.yaml b/kube/account/account-service.yaml new file mode 100644 index 0000000..031cca7 --- /dev/null +++ b/kube/account/account-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: account + name: account +spec: + ports: + - port: 80 + targetPort: 3000 + selector: + app: account diff --git a/kube/collaborator/collaborator-deployment.yaml b/kube/collaborator/collaborator-deployment.yaml new file mode 100644 index 0000000..bb96718 --- /dev/null +++ b/kube/collaborator/collaborator-deployment.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: collaborator + name: collaborator +spec: + replicas: 1 + selector: + matchLabels: + app: collaborator + template: + metadata: + labels: + app: collaborator + spec: + containers: + - env: + - name: ACCOUNTS_URL + value: http://account + - name: COLLABORATOR_PORT + value: "3078" + - name: MINIO_ACCESS_KEY + valueFrom: + secretKeyRef: + name: huly-secret + key: MINIO_ACCESS_KEY + - name: MINIO_ENDPOINT + valueFrom: + configMapKeyRef: + name: huly-config + key: MINIO_ENDPOINT + - name: MINIO_SECRET_KEY + valueFrom: + secretKeyRef: + name: huly-secret + key: MINIO_SECRET_KEY + - name: MONGO_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: MONGO_URL + - name: SECRET + valueFrom: + secretKeyRef: + name: huly-secret + key: SERVER_SECRET + - name: TRANSACTOR_URL + value: ws://transactor/ + - name: UPLOAD_URL + value: /files + image: hardcoreeng/collaborator:latest + name: collaborator + ports: + - containerPort: 3078 + resources: + limits: + memory: '512M' + restartPolicy: Always diff --git a/kube/collaborator/collaborator-ingress.yaml b/kube/collaborator/collaborator-ingress.yaml new file mode 100644 index 0000000..2091140 --- /dev/null +++ b/kube/collaborator/collaborator-ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: nginx + labels: + app: collaborator + name: collaborator +spec: + ingressClassName: nginx + rules: + - host: collaborator.huly.example + http: + paths: + - backend: + service: + name: collaborator + port: + number: 80 + path: / + pathType: Prefix diff --git a/kube/collaborator/collaborator-service.yaml b/kube/collaborator/collaborator-service.yaml new file mode 100644 index 0000000..cb5db83 --- /dev/null +++ b/kube/collaborator/collaborator-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: collaborator + name: collaborator +spec: + ports: + - port: 80 + targetPort: 3078 + selector: + app: collaborator diff --git a/kube/config/config.yaml b/kube/config/config.yaml new file mode 100644 index 0000000..069c393 --- /dev/null +++ b/kube/config/config.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: huly-config +data: + ACCOUNTS_URL: 'http://account.huly.example/' + COLLABORATOR_URL: 'ws://collaborator.huly.example/' + COLLABORATOR_API_URL: 'http://collaborator.huly.example/' + FRONT_URL: 'http://huly.example' + REKONI_URL: 'http://rekoni.huly.example/' + TRANSACTOR_URL: 'ws://transactor.huly.example/' + MINIO_ENDPOINT: 'minio' + MONGO_URL: 'mongodb://mongodb:27017' + ELASTIC_URL: 'http://elastic:9200/' + ELASTIC_INDEX_NAME: 'huly_storage_index' diff --git a/kube/config/secret.yaml b/kube/config/secret.yaml new file mode 100644 index 0000000..406dd6f --- /dev/null +++ b/kube/config/secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: huly-secret +type: Opaque +stringData: + MINIO_ACCESS_KEY: minioadmin + MINIO_SECRET_KEY: minioadmin + SERVER_SECRET: secret diff --git a/kube/front/front-deployment.yaml b/kube/front/front-deployment.yaml new file mode 100644 index 0000000..0b2f773 --- /dev/null +++ b/kube/front/front-deployment.yaml @@ -0,0 +1,92 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: front + name: front +spec: + replicas: 1 + selector: + matchLabels: + app: front + template: + metadata: + labels: + app: front + spec: + containers: + - env: + - name: ACCOUNTS_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: ACCOUNTS_URL + - name: CALENDAR_URL + value: http://calendar + - name: COLLABORATOR_API_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: COLLABORATOR_API_URL + - name: COLLABORATOR_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: COLLABORATOR_URL + - name: DEFAULT_LANGUAGE + value: en + - name: ELASTIC_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: ELASTIC_URL + - name: GMAIL_URL + value: http://gmail:8088 + - name: MINIO_ACCESS_KEY + valueFrom: + secretKeyRef: + name: huly-secret + key: MINIO_ACCESS_KEY + - name: MINIO_ENDPOINT + valueFrom: + configMapKeyRef: + name: huly-config + key: MINIO_ENDPOINT + - name: MINIO_SECRET_KEY + valueFrom: + secretKeyRef: + name: huly-secret + key: MINIO_SECRET_KEY + - name: MONGO_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: MONGO_URL + - name: REKONI_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: REKONI_URL + - name: SERVER_PORT + value: "8080" + - name: SERVER_SECRET + valueFrom: + secretKeyRef: + name: huly-secret + key: SERVER_SECRET + - name: TELEGRAM_URL + value: http://telegram:8086 + - name: TITLE + value: Huly Self Hosted + - name: TRANSACTOR_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: TRANSACTOR_URL + - name: UPLOAD_URL + value: /files + image: hardcoreeng/front:latest + name: front + ports: + - containerPort: 8080 + restartPolicy: Always diff --git a/kube/front/front-ingress.yaml b/kube/front/front-ingress.yaml new file mode 100644 index 0000000..675de0b --- /dev/null +++ b/kube/front/front-ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: nginx + labels: + app: front + name: front +spec: + ingressClassName: nginx + rules: + - host: huly.example + http: + paths: + - backend: + service: + name: front + port: + number: 80 + path: / + pathType: Prefix diff --git a/kube/front/front-service.yaml b/kube/front/front-service.yaml new file mode 100644 index 0000000..e9a6a0c --- /dev/null +++ b/kube/front/front-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: front + name: front +spec: + ports: + - port: 80 + targetPort: 8080 + selector: + app: front diff --git a/kube/rekoni/rekoni-deployment.yaml b/kube/rekoni/rekoni-deployment.yaml new file mode 100644 index 0000000..9c1ec9f --- /dev/null +++ b/kube/rekoni/rekoni-deployment.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: rekoni + name: rekoni +spec: + replicas: 1 + selector: + matchLabels: + app: rekoni + template: + metadata: + labels: + app: rekoni + spec: + containers: + - image: hardcoreeng/rekoni-service:latest + name: rekoni + env: + - name: SECRET + valueFrom: + secretKeyRef: + name: huly-secret + key: SERVER_SECRET + ports: + - containerPort: 4004 + hostPort: 4004 + protocol: TCP + resources: + limits: + memory: "500M" + restartPolicy: Always diff --git a/kube/rekoni/rekoni-ingress.yaml b/kube/rekoni/rekoni-ingress.yaml new file mode 100644 index 0000000..bb598be --- /dev/null +++ b/kube/rekoni/rekoni-ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: nginx + labels: + app: rekoni + name: rekoni +spec: + ingressClassName: nginx + rules: + - host: rekoni.huly.example + http: + paths: + - backend: + service: + name: rekoni + port: + number: 80 + path: / + pathType: Prefix diff --git a/kube/rekoni/rekoni-service.yaml b/kube/rekoni/rekoni-service.yaml new file mode 100644 index 0000000..0995308 --- /dev/null +++ b/kube/rekoni/rekoni-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: rekoni + name: rekoni +spec: + ports: + - port: 80 + targetPort: 4004 + selector: + app: rekoni diff --git a/kube/transactor/transactor-deployment.yaml b/kube/transactor/transactor-deployment.yaml new file mode 100644 index 0000000..7061fd4 --- /dev/null +++ b/kube/transactor/transactor-deployment.yaml @@ -0,0 +1,77 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: transactor + name: transactor +spec: + replicas: 1 + selector: + matchLabels: + app: transactor + template: + metadata: + labels: + app: transactor + spec: + containers: + - env: + - name: ACCOUNTS_URL + value: http://account + - name: ELASTIC_INDEX_NAME + valueFrom: + configMapKeyRef: + name: huly-config + key: ELASTIC_INDEX_NAME + - name: ELASTIC_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: ELASTIC_URL + - name: FRONT_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: FRONT_URL + - name: MINIO_ACCESS_KEY + valueFrom: + secretKeyRef: + name: huly-secret + key: MINIO_ACCESS_KEY + - name: MINIO_ENDPOINT + valueFrom: + configMapKeyRef: + name: huly-config + key: MINIO_ENDPOINT + - name: MINIO_SECRET_KEY + valueFrom: + secretKeyRef: + name: huly-secret + key: MINIO_SECRET_KEY + - name: MONGO_URL + valueFrom: + configMapKeyRef: + name: huly-config + key: MONGO_URL + - name: REKONI_URL + value: http://rekoni + - name: SERVER_CURSOR_MAXTIMEMS + value: "30000" + - name: SERVER_PORT + value: "3333" + - name: SERVER_PROVIDER + value: ws + - name: SERVER_SECRET + valueFrom: + secretKeyRef: + name: huly-secret + key: SERVER_SECRET + - name: UPLOAD_URL + value: /files + image: hardcoreeng/transactor:latest + name: transactor + ports: + - containerPort: 3333 + hostPort: 3333 + protocol: TCP + restartPolicy: Always diff --git a/kube/transactor/transactor-ingress.yaml b/kube/transactor/transactor-ingress.yaml new file mode 100644 index 0000000..84bfc33 --- /dev/null +++ b/kube/transactor/transactor-ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: nginx + labels: + app: transactor + name: transactor +spec: + ingressClassName: nginx + rules: + - host: transactor.huly.example + http: + paths: + - backend: + service: + name: transactor + port: + number: 80 + path: / + pathType: Prefix diff --git a/kube/transactor/transactor-service.yaml b/kube/transactor/transactor-service.yaml new file mode 100644 index 0000000..bb14e3b --- /dev/null +++ b/kube/transactor/transactor-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: transactor + name: transactor +spec: + ports: + - port: 80 + protocol: TCP + targetPort: 3333 + selector: + app: transactor From 6f93682a1447b8be8473c9c256b56f5d2b21a87a Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Fri, 24 May 2024 16:26:16 +0700 Subject: [PATCH 2/3] update selfhost huly version Signed-off-by: Alexander Onnikov --- setup.sh | 4 ++-- template.compose.yaml | 8 +++++++- use-version.sh | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index b55e27e..f200aab 100755 --- a/setup.sh +++ b/setup.sh @@ -1,7 +1,7 @@ #!/bin/sh -export SERVER_ADDRESS=$1 +export SERVER_ADDRESS="$1" echo "Setting Huly Server Address: $SERVER_ADDRESS" envsubst < template.conf > nginx.conf envsubst < template.env > .env -./use-version.sh v0.6.221 +./use-version.sh v0.6.245 diff --git a/template.compose.yaml b/template.compose.yaml index 35b5270..f9e3603 100644 --- a/template.compose.yaml +++ b/template.compose.yaml @@ -61,6 +61,7 @@ services: - INIT_WORKSPACE=demo-tracker - MODEL_ENABLED=* - ACCOUNTS_URL=http://localhost:3000 + - ACCOUNT_PORT=3000 restart: unless-stopped front: image: hardcoreeng/front:${HULY_VERSION} @@ -88,6 +89,7 @@ services: - MINIO_ENDPOINT=minio - MINIO_ACCESS_KEY=minioadmin - MINIO_SECRET_KEY=minioadmin + - MONGO_URL=mongodb://mongodb:27017 - TITLE=Huly Self Hosted - DEFAULT_LANGUAGE=en - LAST_NAME_FIRST=true @@ -126,6 +128,7 @@ services: - SERVER_SECRET=secret - SERVER_CURSOR_MAXTIMEMS=30000 - ELASTIC_URL=http://elastic:9200 + - ELASTIC_INDEX_NAME=huly_storage_index - MONGO_URL=mongodb://mongodb:27017 - METRICS_CONSOLE=false - METRICS_FILE=metrics.txt @@ -137,11 +140,14 @@ services: - SERVER_PROVIDER=ws - ACCOUNTS_URL=http://account:3000 - LAST_NAME_FIRST=true + - UPLOAD_URL=http://${SERVER_ADDRESS}/files restart: unless-stopped rekoni: - image: hardcoreeng/rekoni-service:latest + image: hardcoreeng/rekoni-service:${HULY_VERSION} ports: - 4004:4004 + environment: + - SECRET=secret deploy: resources: limits: diff --git a/use-version.sh b/use-version.sh index 4ce6f96..74b7157 100755 --- a/use-version.sh +++ b/use-version.sh @@ -1,4 +1,4 @@ #!/bin/sh -export HULY_VERSION=$1 +export HULY_VERSION="$1" echo "Setting Huly Version: $HULY_VERSION" envsubst < template.compose.yaml > compose.yaml From bcc1a4f7f0b7f2701cf897e4a4b42080149e69d1 Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Wed, 5 Jun 2024 23:57:43 +0700 Subject: [PATCH 3/3] add elastic, minio, and mongodb configuration Signed-off-by: Alexander Onnikov --- README.md | 2 + kube/README.md | 18 ++++++ kube/elastic/elastic-deployment.yaml | 58 +++++++++++++++++++ .../elastic-persistentvolumeclaim.yaml | 12 ++++ kube/elastic/elastic-service.yaml | 14 +++++ kube/minio/files-persistentvolumeclaim.yaml | 12 ++++ kube/minio/minio-deployment.yaml | 43 ++++++++++++++ kube/minio/minio-service.yaml | 16 +++++ kube/mongodb/mongodb-deployment.yaml | 38 ++++++++++++ kube/mongodb/mongodb-service.yaml | 13 +++++ 10 files changed, 226 insertions(+) create mode 100644 kube/README.md create mode 100644 kube/elastic/elastic-deployment.yaml create mode 100644 kube/elastic/elastic-persistentvolumeclaim.yaml create mode 100644 kube/elastic/elastic-service.yaml create mode 100644 kube/minio/files-persistentvolumeclaim.yaml create mode 100644 kube/minio/minio-deployment.yaml create mode 100644 kube/minio/minio-service.yaml create mode 100644 kube/mongodb/mongodb-deployment.yaml create mode 100644 kube/mongodb/mongodb-service.yaml diff --git a/README.md b/README.md index d97ac69..46d5071 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Please use this README if you want to deploy Huly on your server with `docker co > [!NOTE] > Huly is quite resource-heavy, so I recommend using a Droplet with 2 vCPUs and 4GB of RAM. Droplets with less RAM may stop responding or fail. +If you prefer Kubernetes deployment, there is a sample Kubernetes configuration under [kube](kube) directory. + ## Installing `nginx` and `docker` First, let's install `nginx` and `docker` using the commands below if you have not already installed them on your machine. diff --git a/kube/README.md b/kube/README.md new file mode 100644 index 0000000..fb66c0a --- /dev/null +++ b/kube/README.md @@ -0,0 +1,18 @@ +# Huly Kubernetes Deployment + +This folder contains a sample configuration for Huly Kubernetes deployment. + +## Check and update configuration + +Huly deployment configuration is located in [config.yaml](config/config.yaml) and [secret.yaml](config/secret.yaml) files. +The sample configuration assume that Huly is available on huly.example hostname with dedicated hostname per service. + +## Deploy Huly to Kubernetes + +Deploy Huly with `kubectl`. + +```bash +kubectl apply -R -f . +``` + +Now, launch your web browser and enjoy Huly! diff --git a/kube/elastic/elastic-deployment.yaml b/kube/elastic/elastic-deployment.yaml new file mode 100644 index 0000000..e98300a --- /dev/null +++ b/kube/elastic/elastic-deployment.yaml @@ -0,0 +1,58 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: elastic + name: elastic +spec: + replicas: 1 + selector: + matchLabels: + app: elastic + strategy: + type: Recreate + template: + metadata: + labels: + app: elastic + spec: + containers: + - args: + - /bin/sh + - -c + - |- + ./bin/elasticsearch-plugin list | grep -q ingest-attachment || yes | ./bin/elasticsearch-plugin install --silent ingest-attachment; + /usr/local/bin/docker-entrypoint.sh eswrapper + env: + - name: BITNAMI_DEBUG + value: "true" + - name: ELASTICSEARCH_PORT_NUMBER + value: "9200" + - name: ES_JAVA_OPTS + value: -Xms1024m -Xmx1024m + - name: discovery.type + value: single-node + - name: http.cors.allow-origin + value: http://localhost:8082 + - name: http.cors.enabled + value: "true" + image: elasticsearch:7.14.2 + livenessProbe: + exec: + command: + - curl -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"' + failureThreshold: 10 + periodSeconds: 20 + name: elastic + ports: + - containerPort: 9200 + hostPort: 9200 + protocol: TCP + volumeMounts: + - mountPath: /usr/share/elasticsearch/data + name: elastic + restartPolicy: Always + volumes: + - name: elastic + persistentVolumeClaim: + claimName: elastic diff --git a/kube/elastic/elastic-persistentvolumeclaim.yaml b/kube/elastic/elastic-persistentvolumeclaim.yaml new file mode 100644 index 0000000..54049c0 --- /dev/null +++ b/kube/elastic/elastic-persistentvolumeclaim.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app: elastic + name: elastic +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi diff --git a/kube/elastic/elastic-service.yaml b/kube/elastic/elastic-service.yaml new file mode 100644 index 0000000..656d7be --- /dev/null +++ b/kube/elastic/elastic-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + labels: + app: elastic + name: elastic +spec: + ports: + - name: "9200" + port: 9200 + targetPort: 9200 + selector: + app: elastic diff --git a/kube/minio/files-persistentvolumeclaim.yaml b/kube/minio/files-persistentvolumeclaim.yaml new file mode 100644 index 0000000..af0754d --- /dev/null +++ b/kube/minio/files-persistentvolumeclaim.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app: files + name: files +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi diff --git a/kube/minio/minio-deployment.yaml b/kube/minio/minio-deployment.yaml new file mode 100644 index 0000000..604dcbd --- /dev/null +++ b/kube/minio/minio-deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: minio + name: minio +spec: + replicas: 1 + selector: + matchLabels: + app: minio + strategy: + type: Recreate + template: + metadata: + labels: + app: minio + spec: + containers: + - args: + - server + - /data + - --address + - :9000 + - --console-address + - :9001 + image: minio/minio + name: minio + ports: + - containerPort: 9000 + hostPort: 9000 + protocol: TCP + - containerPort: 9001 + hostPort: 9001 + protocol: TCP + volumeMounts: + - mountPath: /data + name: files + restartPolicy: Always + volumes: + - name: files + persistentVolumeClaim: + claimName: files diff --git a/kube/minio/minio-service.yaml b/kube/minio/minio-service.yaml new file mode 100644 index 0000000..bbbc269 --- /dev/null +++ b/kube/minio/minio-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: minio + name: minio +spec: + ports: + - name: "9000" + port: 9000 + targetPort: 9000 + - name: "9001" + port: 9001 + targetPort: 9001 + selector: + app: minio diff --git a/kube/mongodb/mongodb-deployment.yaml b/kube/mongodb/mongodb-deployment.yaml new file mode 100644 index 0000000..159c333 --- /dev/null +++ b/kube/mongodb/mongodb-deployment.yaml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: mongodb + name: mongodb +spec: + replicas: 1 + selector: + matchLabels: + app: mongodb + strategy: + type: Recreate + template: + metadata: + labels: + app: mongodb + spec: + containers: + - env: + - name: PGID + value: "1000" + - name: PUID + value: "1000" + image: mongo:7-jammy + name: mongodb + ports: + - containerPort: 27017 + hostPort: 27017 + protocol: TCP + volumeMounts: + - mountPath: /data/db + name: db + restartPolicy: Always + volumes: + - name: db + persistentVolumeClaim: + claimName: db diff --git a/kube/mongodb/mongodb-service.yaml b/kube/mongodb/mongodb-service.yaml new file mode 100644 index 0000000..3cdf45a --- /dev/null +++ b/kube/mongodb/mongodb-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: mongodb + name: mongodb +spec: + ports: + - name: "27017" + port: 27017 + targetPort: 27017 + selector: + app: mongodb