K8s-training: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
#==TRAINING K8S/HELM== | #==TRAINING K8S/HELM== | ||
#URL https:// | #URL https://appName.domainCluster | ||
domainCluster=c2.mi.infocepo.com | echo "== YOURS VARS ==" | ||
export appName=wiki | |||
export domainCluster=c2.mi.infocepo.com | |||
echo "== INIT ENV ==" | echo "== INIT ENV ==" | ||
export nameSpace=infra-$USER | |||
mkdir -p ~/old | mkdir -p ~/old | ||
localPassword= | export localPassword=${appName} | ||
hostName=${ | hostName=${appName}.${domainCluster} | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | helm repo add bitnami https://charts.bitnami.com/bitnami | ||
echo "== GITOPS ==" | echo "== GITOPS ==" | ||
clear | clear | ||
helm template | helm template ${appName} bitnami/mediawiki | ||
--namespace ${nameSpace} --create-namespace \ | |||
--set ingress.enabled=true,ingress.hostname=${hostName} \ | --set ingress.enabled=true,ingress.hostname=${hostName} \ | ||
--set mediawikiHost=${hostName},mediawikiPassword=${localPassword} \ | --set mediawikiHost=${hostName},mediawikiPassword=${localPassword} \ | ||
--set mariadb.auth.rootPassword=${localPassword},mariadb.auth.password=${localPassword} |tee ~/old/infra-$USER | --set mariadb.auth.rootPassword=${localPassword},mariadb.auth.password=${localPassword} |tee ~/old/infra-$USER-${appName} | ||
echo "== DEPLOY ==" | echo "== DEPLOY ==" | ||
kubectl apply -f ~/old/infra-$USER | kubectl apply -f ~/old/infra-$USER-${appName} | ||
echo "== YOURS URL ==" | |||
echo https://${hostName} | |||
echo "== DELETE ==" | echo "== DELETE ==" | ||
kubectl delete -f ~/old/infra-$USER | kubectl delete -f ~/old/infra-$USER-${appName} | ||
echo "== DELETE REMAINING DB ==" | echo "== DELETE REMAINING DB ==" | ||
kubectl delete pvc/data-infra-$USER-mariadb-0 -n infra-$USER | kubectl delete pvc/data-infra-$USER-mariadb-0 -n infra-$USER | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 12:18, 15 February 2023
#==TRAINING K8S/HELM==
#URL https://appName.domainCluster
echo "== YOURS VARS =="
export appName=wiki
export domainCluster=c2.mi.infocepo.com
echo "== INIT ENV =="
export nameSpace=infra-$USER
mkdir -p ~/old
export localPassword=${appName}
hostName=${appName}.${domainCluster}
helm repo add bitnami https://charts.bitnami.com/bitnami
echo "== GITOPS =="
clear
helm template ${appName} bitnami/mediawiki
--namespace ${nameSpace} --create-namespace \
--set ingress.enabled=true,ingress.hostname=${hostName} \
--set mediawikiHost=${hostName},mediawikiPassword=${localPassword} \
--set mariadb.auth.rootPassword=${localPassword},mariadb.auth.password=${localPassword} |tee ~/old/infra-$USER-${appName}
echo "== DEPLOY =="
kubectl apply -f ~/old/infra-$USER-${appName}
echo "== YOURS URL =="
echo https://${hostName}
echo "== DELETE =="
kubectl delete -f ~/old/infra-$USER-${appName}
echo "== DELETE REMAINING DB =="
kubectl delete pvc/data-infra-$USER-mariadb-0 -n infra-$USER