Verified Commit 7595c59e authored by Dmytro Bogatov's avatar Dmytro Bogatov 💕

Migrate with new OS to new configuration and new DNS name.

parent 5389c049
......@@ -11,15 +11,16 @@ CWD=$(pwd)
# Checks
usage () {
printf "usage: ./$0 <certDirPath> <statusSiteConfig>\n"
printf "usage: ./$0 <certDirPath> <statusSiteConfig> <name>\n"
printf "where\n"
printf "\t certDirPath - absolute path to directory with SSL cert (certificate.crt) and key (certificate.key) file\n"
printf "\t statusSiteConfig - absolute path to appsettings.production.yml file\n"
printf "\t name - cluster name (e.g. sandor in sandor.dbogatov.org)\n"
exit 1;
}
if ! [ $# -eq 2 ]
if ! [ $# -eq 3 ]
then
usage
fi
......@@ -28,6 +29,7 @@ source .secret.sh
CERTDIRPATH=$1
STATUSSITECONFIG=$2
NAME=$3
# Initiate cluster
......@@ -51,8 +53,8 @@ echo "Adding SWAP file to the nodes"
cd "$CWD"
IPS=("$(dig @ns1.digitalocean.com +short A dolores-workers.digital-ocean.dbogatov.org)")
IPS+=("$(dig @ns1.digitalocean.com +short A dolores.digital-ocean.dbogatov.org)")
IPS=("$(dig @ns1.digitalocean.com +short A dolores-workers.$NAME.dbogatov.org)")
IPS+=("$(dig @ns1.digitalocean.com +short A dolores.$NAME.dbogatov.org)")
cat >var-vm-swapfile1.swap <<EOL
[Unit]
......@@ -92,7 +94,7 @@ rm var-vm-swapfile1.swap
echo "Waiting 30 secs..."
# sleep 30
sleep 30
cd "$CWD"
......@@ -103,8 +105,8 @@ NAMESPACES=("websites" "monitoring" "ingress" "status-site" "kube-system")
for namespace in ${NAMESPACES[@]}
do
kubectl create namespace "$namespace" || true # some of them already exist
kubectl create --namespace="$namespace" secret tls lets-encrypt --key "$CERTDIRPATH"/certificate.key --cert "$CERTDIRPATH"/certificate.crt
kubectl create --namespace="$namespace" secret generic basic-auth --from-file=$CERTDIRPATH/auth
kubectl create --namespace="$namespace" secret tls lets-encrypt --key "$CERTDIRPATH"/certificate.key --cert "$CERTDIRPATH"/certificate.crt || true # some of them already exist
kubectl create --namespace="$namespace" secret generic basic-auth --from-file=$CERTDIRPATH/auth || true # some of them already exist
done
echo "Deploying the registry secret"
......
......@@ -43,7 +43,7 @@ SERVICES["blog-bogatov-kiev-ua"]="registry.dbogatov.org/daddy/blog-bogatov-kiev-
declare -A DOMAINS
AVALUE="dolores-workers.digital-ocean.dbogatov.org"
AVALUE="dolores-workers.sandor.dbogatov.org"
DOMAINS["dbogatov.org"]=$AVALUE
DOMAINS["dmytro.app"]=$AVALUE
......
......@@ -10,16 +10,16 @@ module "digital-ocean-dolores" {
}
region = "nyc3"
dns_zone = "digital-ocean.dbogatov.org"
dns_zone = "sandor.dbogatov.org"
cluster_name = "dolores"
image = "coreos-stable"
controller_count = 1
controller_type = "s-1vcpu-1gb"
controller_count = 2
controller_type = "s-2vcpu-2gb"
worker_count = 3
worker_type = "s-2vcpu-2gb"
worker_type = "s-2vcpu-4gb"
ssh_fingerprints = ["df:a9:7f:e1:e5:e8:c7:3e:2c:c3:a9:ac:7c:bd:e7:a6"]
# output assets dir
asset_dir = "/Users/dbogatov/.secrets/clusters/dolores"
asset_dir = "/Users/dmytro/.secrets/clusters/dolores"
}
......@@ -21,7 +21,7 @@ DOMAINS["nigmatullina.org"]=true
DOMAINS["photobarrat.com"]=true
DOMAINS["res-public.net"]=true
DOMAINS["shevastream.com"]=true
DOMAINS["travelus.com.ua"]=true
# DOMAINS["travelus.com.ua"]=true
DOMAINS["veles-russia.com"]=true
DOMAINS["visajapan.com.ua"]=true
DOMAINS["vleskniga.com"]=true
......
......@@ -23,7 +23,7 @@ FILES=("certificate.key" "certificate.crt")
for file in ${FILES[@]}
do
scp $CERTDIRPATH/$file git.dbogatov.org:/home/dbogatov/certs/
scp $CERTDIRPATH/$file dbogatov@git.dbogatov.org:/home/dbogatov/certs/
done
echo "Done."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment