K8s-training: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
echo "== INIT ENV ==" | echo "== INIT ENV ==" | ||
hostName=${appName}-${nameSpace}.${domainCluster} | hostName=${appName}-${nameSpace}.${domainCluster} | ||
appInternalPassword=${hostName} | appInternalPassword=${hostName} | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | helm repo add bitnami https://charts.bitnami.com/bitnami | ||
mkdir -p ~/old | |||
echo "== INFRA ==" | echo "== INFRA ==" | ||
Line 19: | Line 19: | ||
--set ingress.enabled=true,ingress.hostname=${hostName} \ | --set ingress.enabled=true,ingress.hostname=${hostName} \ | ||
--set mediawikiHost=${hostName},mediawikiPassword=${appInternalPassword} \ | --set mediawikiHost=${hostName},mediawikiPassword=${appInternalPassword} \ | ||
--set mariadb.auth.rootPassword=${appInternalPassword},mariadb.auth.password=${appInternalPassword} |tee ~/old/ | --set mariadb.auth.rootPassword=${appInternalPassword},mariadb.auth.password=${appInternalPassword} |tee ~/old/${hostName} | ||
echo "== DEPLOY ==" | echo "== DEPLOY ==" | ||
kubectl apply -f ~/old/ | kubectl apply -f ~/old/${hostName} | ||
echo "== YOURS URL ==" | echo "== YOURS URL ==" | ||
#kubectl get ingress -n ${nameSpace} | |||
echo https://${hostName} | echo https://${hostName} | ||
echo "== DELETE ==" | echo "== DELETE ==" | ||
kubectl delete -f ~/old/ | kubectl delete -f ~/old/${hostName} | ||
echo "== DELETE REMAINING DB ==" | echo "== DELETE REMAINING DB ==" | ||
kubectl delete pvc/data-${appName}-mariadb-0 -n | #kubectl get pvc -n ${nameSpace} | ||
kubectl delete pvc/data-${appName}-mariadb-0 -n ${nameSpace} | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 15:01, 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 =="
hostName=${appName}-${nameSpace}.${domainCluster}
appInternalPassword=${hostName}
helm repo add bitnami https://charts.bitnami.com/bitnami
mkdir -p ~/old
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/${hostName}
echo "== DEPLOY =="
kubectl apply -f ~/old/${hostName}
echo "== YOURS URL =="
#kubectl get ingress -n ${nameSpace}
echo https://${hostName}
echo "== DELETE =="
kubectl delete -f ~/old/${hostName}
echo "== DELETE REMAINING DB =="
#kubectl get pvc -n ${nameSpace}
kubectl delete pvc/data-${appName}-mariadb-0 -n ${nameSpace}