added users deployment.

This commit is contained in:
ruberoid 2024-04-14 15:22:41 +04:00
parent 6e4a705e07
commit e5c71e1bc8
3 changed files with 85 additions and 5 deletions

View File

@ -64,8 +64,13 @@ helm repo update
# #
# note that you should create a values.yaml file with db credentials at least. # note that you should create a values.yaml file with db credentials at least.
# #
# helm install -f values.yaml nocr-maria-db bitnami/mariadb --namespace nocr
helm install nocr-mdb --set db.name=nocr_text_matcher,db.user=nocr_text_matcher_user stable/mariadb --namespace nocr helm install mdb-tm --set auth.database=nocr_text_matcher bitnami/mariadb --namespace nocr
helm install mdb-u --set auth.database=nocr_users bitnami/mariadb --namespace nocr
# to update helm release please use
# helm upgrade my-release oci://REGISTRY_NAME/REPOSITORY_NAME/mariadb --set auth.rootPassword=[ROOT_PASSWORD]
# 05. Main deployment # 05. Main deployment

View File

@ -103,6 +103,25 @@ spec:
spec: spec:
imagePullSecrets: imagePullSecrets:
- name: hubcred - name: hubcred
initContainers:
- name: text-matcher-migrator
image: hub.musk.fun/k8s/nocr/text_matcher_migrator:latest
env:
- name: "DOTNET_ENVIRONMENT"
value: "k8s"
- name: mariadb_host
value: mdb-tm-mariadb.nocr.svc
- name: mariadb_database
value: nocr_text_matcher
- name: mariadb_user
value: root
- name: mariadb_password
valueFrom:
secretKeyRef:
name: mdb-tm-mariadb
key: mariadb-root-password
- name: ConnectionStrings__k8s
value: "server=$(mariadb_host);port=3306;database=$(mariadb_database);uid=$(mariadb_user);pwd=$(mariadb_password)"
containers: containers:
- name: text-matcher - name: text-matcher
image: hub.musk.fun/k8s/nocr/text_matcher:latest image: hub.musk.fun/k8s/nocr/text_matcher:latest
@ -132,7 +151,7 @@ spec:
- name: RebusRabbitMqOptions__ConnectionString - name: RebusRabbitMqOptions__ConnectionString
value: "amqp://$(rmqc_username):$(rmqc_password)@$(rmqc_host):$(rmqc_port)/" value: "amqp://$(rmqc_username):$(rmqc_password)@$(rmqc_host):$(rmqc_port)/"
- name: mariadb_host - name: mariadb_host
value: nocr-mdb-mariadb.nocr.svc value: mdb-tm-mariadb.nocr.svc
- name: mariadb_database - name: mariadb_database
value: nocr_text_matcher value: nocr_text_matcher
- name: mariadb_user - name: mariadb_user
@ -140,7 +159,63 @@ spec:
- name: mariadb_password - name: mariadb_password
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: nocr-mdb-mariadb name: mdb-tm-mariadb
key: mariadb-root-password key: mariadb-root-password
- name: ConnectionStrings__TextMatcherContext - name: ConnectionStrings__TextMatcherContext
value: "server=$(mariadb_host);port=3306;database=$(mariadb_database);uid=$(mariadb_user);pwd=$(mariadb_password)" value: "server=$(mariadb_host);port=3306;database=$(mariadb_database);uid=$(mariadb_user);pwd=$(mariadb_password)"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: users
namespace: nocr
spec:
replicas: 1
selector:
matchLabels:
app: users
template:
metadata:
labels:
app: users
spec:
imagePullSecrets:
- name: hubcred
initContainers:
- name: users-migrator
image: hub.musk.fun/k8s/nocr/users_migrator:latest
env:
- name: "DOTNET_ENVIRONMENT"
value: "k8s"
- name: mariadb_host
value: mdb-u-mariadb.nocr.svc
- name: mariadb_database
value: nocr_users
- name: mariadb_user
value: root
- name: mariadb_password
valueFrom:
secretKeyRef:
name: mdb-u-mariadb
key: mariadb-root-password
- name: ConnectionStrings__k8s
value: "server=$(mariadb_host);port=3306;database=$(mariadb_database);uid=$(mariadb_user);pwd=$(mariadb_password)"
containers:
- name: users
image: hub.musk.fun/k8s/nocr/users:latest
env:
- name: "ASPNETCORE_ENVIRONMENT"
value: "k8s"
- name: mariadb_host
value: mdb-u-mariadb.nocr.svc
- name: mariadb_database
value: nocr_text_matcher
- name: mariadb_user
value: root
- name: mariadb_password
valueFrom:
secretKeyRef:
name: mdb-u-mariadb
key: mariadb-root-password
- name: ConnectionStrings__UsersContext
value: "server=$(mariadb_host);port=3306;database=$(mariadb_database);uid=$(mariadb_user);pwd=$(mariadb_password)"

2
users

@ -1 +1 @@
Subproject commit 0f0fb22b4fd5b84240b76d619f58f5fdacc72ceb Subproject commit 76fbafb476d64a01453d41def4ffebe7afe424a7