K8s-training: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
#URL https://appName-nameSpace. | #URL https://appName-nameSpace.rootDomain | ||
== YOURS VARS == | == YOURS VARS == | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
export | export rootDomain= | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 10: | Line 10: | ||
export appName=wiki | export appName=wiki | ||
export nameSpace=home-$USER | export nameSpace=home-$USER | ||
hostName=${appName}-${nameSpace}.${ | hostName=${appName}-${nameSpace}.${rootDomain} | ||
appInternalPassword=${hostName} | appInternalPassword=${hostName} | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | helm repo add bitnami https://charts.bitnami.com/bitnami |
Revision as of 11:39, 20 May 2023
YOURS VARS
export rootDomain=
DEPLOY
echo "== INIT ENV =="
export appName=wiki
export nameSpace=home-$USER
hostName=${appName}-${nameSpace}.${rootDomain}
appInternalPassword=${hostName}
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 mediawikiHost=${hostName},mediawikiPassword=${appInternalPassword} \
--set mariadb.auth.rootPassword=${appInternalPassword},mariadb.auth.password=${appInternalPassword} |grep -vw namespace |tee ~/old/${hostName}
echo "== DEPLOY =="
kubectl create namespace ${nameSpace}
oc adm policy add-scc-to-user privileged -z default -n ${nameSpace} 2>/dev/null #ENABLE PRIVILIGIED for OPENSHIFT
kubectl apply -f ~/old/${hostName}
echo "== YOURS URL =="
#kubectl get ingress -n ${nameSpace}
echo https://${hostName}
DELETE
kubectl delete -f ~/old/${hostName}
echo "== DELETE REMAINING DB =="
#kubectl get pvc -n ${nameSpace}
kubectl delete pvc/data-${appName}-mariadb-0 -n ${nameSpace}