#!/bin/bash # This is a history like script to memorise all actions # needed to deploy the microservice applications into # kubernetes cluster. # # nocr # # 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= --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. # kubectl apply -f pv.yaml # bubectl apply -f pvc.yaml # NB. There is very URGENT consideration, that even running local # single noded k9s cluster, should avoid of beeing tainted, rather # and deployment wont start automatical. # THis done by the next command: # # kubectl taint nodes --all node-role.kubernetes.io/control-plane- # # 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 # Next secret got telegram bot auth. kubectl create secret generic telegram-bot \ --from-literal=token= \ --namespace nocr # 05. installing persistant rdbs engine helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update # # note that you should create a values.yaml file with db credentials at least. # 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 # # Make the main deployment. kubectl apply -f deployment.yaml