finalized deployment of module telegram-listener.

This commit is contained in:
ruberoid 2024-04-05 15:10:43 +04:00
parent c3b06325b8
commit 83648fdba2
3 changed files with 41 additions and 12 deletions

View File

@ -7,14 +7,17 @@
# nocr # nocr
# #
# First initialize the namespace # 01. First initialize the namespace
kubectl create namespace nocr kubectl create namespace nocr
# 02. Infrustructure
#
# Create secret for accessing registry hub with application # Create secret for accessing registry hub with application
# artifacts. # 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=<username> --docker-password=<password> --docker-email=some@email.com --namespace nocr
# Create the persistent volume for the whole application # Create the persistent volume for the whole application
# and do the claims all that needs and shares the volume. # 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- # 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: # Initialize the rabitmq kubernetes cluster and deployment followed by:
# https://www.rabbitmq.com/kubernetes/operator/install-operator # https://www.rabbitmq.com/kubernetes/operator/install-operator
# #
# Then apply rabbitmq.yaml # Then apply rabbitmq.yaml
# 04. Application secrets
#
# First secret file for telegram session authentication
kubectl create secret generic secretfiles --from-file=<location_to>/WTelegram.session --namespace=nocr
# Next secret got WTelegram client lib auth.
kubectl create secret generic wtelegram-client \
--from-literal=apiid=<value> \
--from-literal=apihash=<value> \
--from-literal=phonenumber=<value> \
--namespace nocr
# 05. Main deployment
#
# Make the main deployment. # Make the main deployment.
kubectl apply -f deployment.yaml kubectl apply -f deployment.yaml

View File

@ -43,8 +43,23 @@ spec:
secretKeyRef: secretKeyRef:
name: rmqc-default-user name: rmqc-default-user
key: port key: port
- name: AppSettings__RebusRabbitMqOptions__ConnectionString - name: RebusRabbitMqOptions__ConnectionString
value: "amqp://$(ASPNETCORE_rmqc_username):$(ASPNETCORE_rmqc_password)@$(ASPNETCORE_rmqc_host):$(ASPNETCORE_rmqc_port)/" 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: volumeMounts:
- name: secrets - name: secrets
mountPath: /app/.secrets mountPath: /app/.secrets

@ -1 +1 @@
Subproject commit 23ec10a012493d69a8904ba9ef44b8d9ce24c870 Subproject commit 73043b4ff0603ec0898b79c3723b91fc209ec79b