K8s-training: Difference between revisions
Jump to navigation
Jump to search
(→DELETE) |
No edit summary |
||
Line 1: | Line 1: | ||
#URL https://appName-nameSpace. | #URL https://appName-nameSpace.wildcardDomain | ||
== YOURS VARS == | == YOURS VARS == | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
export | export wildcardDomain= | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 9: | Line 9: | ||
echo "== INIT ENV ==" | echo "== INIT ENV ==" | ||
export appName=wiki-demo | export appName=wiki-demo | ||
hostName=${appName}.${ | hostName=${appName}.${wildcardDomain} | ||
appInternalPassword=$(echo -n ${hostName} |base64 -w0 ) | appInternalPassword=$(echo -n ${hostName} |base64 -w0 ) | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | helm repo add bitnami https://charts.bitnami.com/bitnami |
Revision as of 09:03, 8 August 2023
YOURS VARS
export wildcardDomain=
DEPLOY
echo "== INIT ENV =="
export appName=wiki-demo
hostName=${appName}.${wildcardDomain}
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 apply -f ~/old/${hostName}
echo "== FIX OPENSHIFT SOLUTION =="
for sa in $(oc get sa -o jsonpath="{.items[*].metadata.name}")
do
oc adm policy add-scc-to-user privileged -z ${sa}
done
oc create route edge --service=${appName}-mediawiki --hostname=${hostName} 2>/dev/null
echo "== YOURS URL =="
echo https://${hostName}
DELETE
oc delete route ${appName}-mediawiki 2>/dev/null #FIX OPENSHIFT SOLUTION
kubectl delete -f ~/old/${hostName}
echo "== DELETE REMAINING DB =="
kubectl delete pvc/data-${appName}-mariadb-0