From 83648fdba2e0269dcbf740a7c4a2e0ecc4bc1b05 Mon Sep 17 00:00:00 2001 From: ruberoid Date: Fri, 5 Apr 2024 15:10:43 +0400 Subject: [PATCH] finalized deployment of module telegram-listener. --- _deploy/k8s/00_initial.sh | 34 ++++++++++++++++++++++++---------- _deploy/k8s/deployment.yaml | 17 ++++++++++++++++- telegram-listener | 2 +- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/_deploy/k8s/00_initial.sh b/_deploy/k8s/00_initial.sh index 2d1983d..2d32ee7 100755 --- a/_deploy/k8s/00_initial.sh +++ b/_deploy/k8s/00_initial.sh @@ -7,14 +7,17 @@ # nocr # -# First initialize the namespace +# 01. First initialize the namespace kubectl create namespace nocr + +# 02. Infrustructure +# # Create secret for accessing registry hub with application # artifacts. -kubectl create secret docker-registry hubcred --docker-server=https://hub.musk.fun/v1/ --docker-username=admin --docker-password=password --docker-email=some@email.com --namespace nocr +kubectl create secret docker-registry hubcred --docker-server=https://hub.musk.fun/v1/ --docker-username= --docker-password= --docker-email=some@email.com --namespace nocr # Create the persistent volume for the whole application # and do the claims all that needs and shares the volume. @@ -30,21 +33,32 @@ kubectl create secret docker-registry hubcred --docker-server=https://hub.musk.f # kubectl taint nodes --all node-role.kubernetes.io/control-plane- # -# next we have to edit secret files for services appllication config. -# This made like: -# -# kubectl create secret generic protected-appsettings --from-file=.secrets/appsettings.protected.json --namespace=nocr -# +# 03. Install rabbitmq +# # Initialize the rabitmq kubernetes cluster and deployment followed by: # https://www.rabbitmq.com/kubernetes/operator/install-operator # # Then apply rabbitmq.yaml +# 04. Application secrets +# +# First secret file for telegram session authentication + +kubectl create secret generic secretfiles --from-file=/WTelegram.session --namespace=nocr + +# Next secret got WTelegram client lib auth. + +kubectl create secret generic wtelegram-client \ + --from-literal=apiid= \ + --from-literal=apihash= \ + --from-literal=phonenumber= \ + --namespace nocr + + +# 05. Main deployment +# # Make the main deployment. - - - kubectl apply -f deployment.yaml diff --git a/_deploy/k8s/deployment.yaml b/_deploy/k8s/deployment.yaml index 12ceb17..911dcb3 100644 --- a/_deploy/k8s/deployment.yaml +++ b/_deploy/k8s/deployment.yaml @@ -43,8 +43,23 @@ spec: secretKeyRef: name: rmqc-default-user key: port - - name: AppSettings__RebusRabbitMqOptions__ConnectionString + - name: RebusRabbitMqOptions__ConnectionString value: "amqp://$(ASPNETCORE_rmqc_username):$(ASPNETCORE_rmqc_password)@$(ASPNETCORE_rmqc_host):$(ASPNETCORE_rmqc_port)/" + - name: WTelegramClientOptions__ApiId + valueFrom: + secretKeyRef: + name: wtelegram-client + key: apiid + - name: WTelegramClientOptions__ApiHash + valueFrom: + secretKeyRef: + name: wtelegram-client + key: apihash + - name: WTelegramClientOptions__PhoneNumber + valueFrom: + secretKeyRef: + name: wtelegram-client + key: phonenumber volumeMounts: - name: secrets mountPath: /app/.secrets diff --git a/telegram-listener b/telegram-listener index 23ec10a..73043b4 160000 --- a/telegram-listener +++ b/telegram-listener @@ -1 +1 @@ -Subproject commit 23ec10a012493d69a8904ba9ef44b8d9ce24c870 +Subproject commit 73043b4ff0603ec0898b79c3723b91fc209ec79b