K8s-training: Difference between revisions
Jump to navigation
Jump to search
(→DEPLOY) |
No edit summary |
||
Line 8: | Line 8: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
echo "== INIT ENV ==" | echo "== INIT ENV ==" | ||
export appName=wiki | export appName=wiki-demo | ||
export nameSpace=home-$USER | #export nameSpace=home-$USER | ||
hostName=${appName}-${nameSpace}.${rootDomain} | #hostName=${appName}-${nameSpace}.${rootDomain} | ||
appInternalPassword=${hostName} | hostName=${appName}.${rootDomain} | ||
appInternalPassword=$(echo -n ${hostName} |base64 -w0 ) | |||
helm repo add bitnami https://charts.bitnami.com/bitnami | helm repo add bitnami https://charts.bitnami.com/bitnami | ||
mkdir -p ~/old | mkdir -p ~/old | ||
Line 20: | Line 21: | ||
--set ingress.enabled=true,ingress.hostname=${hostName} \ | --set ingress.enabled=true,ingress.hostname=${hostName} \ | ||
--set mariadb.auth.rootPassword=${appInternalPassword},mariadb.auth.password=${appInternalPassword} \ | --set mariadb.auth.rootPassword=${appInternalPassword},mariadb.auth.password=${appInternalPassword} \ | ||
--set mediawikiHost=${hostName},mediawikiPassword=${appInternalPassword} |grep -vw namespace | --set mediawikiHost=${hostName},mediawikiPassword=${appInternalPassword} |grep -vw namespace |tee ~/old/${hostName} | ||
echo "== DEPLOY ==" | echo "== DEPLOY ==" | ||
kubectl create namespace ${nameSpace} | #kubectl create namespace ${nameSpace} | ||
oc | oc project openshift-infra 2>/dev/null #fix OPENSHIFT incompatibility | ||
kubectl apply -f ~/old/${hostName | kubectl apply -f ~/old/${hostName} | ||
oc create route edge --service==${appName}-mediawiki --hostname=${hostName} -n ${nameSpace} | oc create route edge --service==${appName}-mediawiki --hostname=${hostName} -n ${nameSpace} 2>/dev/null #fix OPENSHIFT incompatibility | ||
echo "== YOURS URL ==" | echo "== YOURS URL ==" |
Revision as of 14:38, 20 May 2023
YOURS VARS
export rootDomain=
DEPLOY
echo "== INIT ENV =="
export appName=wiki-demo
#export nameSpace=home-$USER
#hostName=${appName}-${nameSpace}.${rootDomain}
hostName=${appName}.${rootDomain}
appInternalPassword=$(echo -n ${hostName} |base64 -w0 )
helm repo add bitnami https://charts.bitnami.com/bitnami
mkdir -p ~/old
echo "== INFRA =="
clear
helm template ${appName} bitnami/mediawiki \
--set ingress.enabled=true,ingress.hostname=${hostName} \
--set mariadb.auth.rootPassword=${appInternalPassword},mariadb.auth.password=${appInternalPassword} \
--set mediawikiHost=${hostName},mediawikiPassword=${appInternalPassword} |grep -vw namespace |tee ~/old/${hostName}
echo "== DEPLOY =="
#kubectl create namespace ${nameSpace}
oc project openshift-infra 2>/dev/null #fix OPENSHIFT incompatibility
kubectl apply -f ~/old/${hostName}
oc create route edge --service==${appName}-mediawiki --hostname=${hostName} -n ${nameSpace} 2>/dev/null #fix OPENSHIFT incompatibility
echo "== YOURS URL =="
#kubectl get ingress -n ${nameSpace}
echo https://${hostName}
DELETE
kubectl delete -f ~/old/${hostName} -n ${nameSpace}
echo "== DELETE REMAINING DB =="
#kubectl get pvc -n ${nameSpace}
kubectl delete pvc/data-${appName}-mariadb-0 -n ${nameSpace}