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"> | ||
#URL https://appName-nameSpace.domainCluster | |||
#URL https://nameSpace.domainCluster | |||
echo "== YOURS VARS ==" | |||
export appName=wiki | |||
export nameSpace=infra-$USER | |||
export domainCluster=c2.mi.infocepo.com | |||
echo "== INIT ENV ==" | |||
mkdir -p ~/old | mkdir -p ~/old | ||
hostName=${appName}-${nameSpace}.${domainCluster} | |||
hostName=${nameSpace}.${domainCluster} | appInternalPassword=${hostName} | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | helm repo add bitnami https://charts.bitnami.com/bitnami | ||
echo "== INFRA ==" | |||
clear | clear | ||
helm template ${appName} bitnami/mediawiki \ | |||
helm template | --namespace ${nameSpace} --create-namespace \ | ||
--set ingress.enabled=true,ingress.hostname=${hostName} \ | --set ingress.enabled=true,ingress.hostname=${hostName} \ | ||
--set mediawikiHost=${hostName},mediawikiPassword=${ | --set mediawikiHost=${hostName},mediawikiPassword=${appInternalPassword} \ | ||
--set mariadb.auth.rootPassword=${ | --set mariadb.auth.rootPassword=${appInternalPassword},mariadb.auth.password=${appInternalPassword} |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 ==" | |||
kubectl delete pvc/data-${appName}-mariadb-0 -n infra-$USER | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 14:57, 15 February 2023
#URL https://appName-nameSpace.domainCluster
echo "== YOURS VARS =="
export appName=wiki
export nameSpace=infra-$USER
export domainCluster=c2.mi.infocepo.com
echo "== INIT ENV =="
mkdir -p ~/old
hostName=${appName}-${nameSpace}.${domainCluster}
appInternalPassword=${hostName}
helm repo add bitnami https://charts.bitnami.com/bitnami
echo "== INFRA =="
clear
helm template ${appName} bitnami/mediawiki \
--namespace ${nameSpace} --create-namespace \
--set ingress.enabled=true,ingress.hostname=${hostName} \
--set mediawikiHost=${hostName},mediawikiPassword=${appInternalPassword} \
--set mariadb.auth.rootPassword=${appInternalPassword},mariadb.auth.password=${appInternalPassword} |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-${appName}-mariadb-0 -n infra-$USER