75 lines
1.9 KiB
Bash
Executable File
75 lines
1.9 KiB
Bash
Executable File
#!/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=<username> --docker-password=<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=<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. 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 -f values.yaml nocr-mariadb bitnami/mariadb --namespace nocr
|
|
|
|
|
|
# 05. Main deployment
|
|
#
|
|
# Make the main deployment.
|
|
|
|
kubectl apply -f deployment.yaml
|