- Create a virtual machine that will host your project.
- Write down the root credentials somewhere in WIKI
- Install
docker
(curl -fsSL https://get.docker.com | sh -s
) if it's not installed already
- Prepare configuration
- Create DNS entry and point it to your Virtual Machine
- Run
./GenerateDotEnv.ps1
fromscripts
folder. File.env
will be generated for you
- Create a folder on VM, e.g.
/home/k3s
. Copy.env
file to that folder (you could runnano
and copy&paste the contents).
- Run
curl -sfL https://raw.githubusercontent.com/mccsoft/backend-frontend-template/master/k8s/setup.sh | /bin/bash -s -
from folder containing.env
file. This will setup k3s, Kubernetes Dashboard (athttps://VIRTUAL_HOST/kube-dashboard
) and letsencrypt.- Grab the contents of
dashboard-token.txt
, it contains the token you could use to login in Kubernetes Dashboard.
- Grab the contents of
- Create Secret File in Azure with your Kubernetes Config. To do so:
- Grab the
cat /etc/rancher/k3s/k3s.yaml
from your VM - Save it locally as
k3s-dev.yaml
(ork3s-prod.yaml
if it's PROD environment) - Change
server: https://localhost:6443
toserver: https://SERVER_IP_ADDRESS:6443
(it's important to put IP, not the Hostname there) - Add it to Azure Secret files.
- Grab the
- Run your pipeline. Everything should be deployed.
- If you want to change something in
.env
(e.g. VIRTUAL_HOST, EMAIL, or some other secret), change it in VM. Then runcurl -sfL https://raw.githubusercontent.com/mccsoft/backend-frontend-template/master/k8s/reinit-namespace.sh | /bin/bash -s -
. - If you want to completely reinitialize whole kubernetes cluster, run the following:
/usr/local/bin/k3s-uninstall.sh
to uninstall everything- Repeat the setup steps
Instructions will follow
-
If
https
has wrong certificate, start troubleshooting by runningkubectl -n YOUR_NAMESPACE describe certificate
(you might face an error like:Failed to create Order: 429 urn:ietf:params:acme:error:rateLimited: Error creating new order :: too many certificates (5) already issued for this exact set of domains in the last 168 hours`).
If it didn't help, head over to CertManager troubleshooting guide.