k3s doc: https://docs.k3s.io/installation/configuration
curl -sfL https://get.k3s.io | shInstall kubectl: https://kubernetes.io/ja/docs/tasks/tools/install-kubectl/
Configure kubectl credential.
mkdir ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chmod 644 ~/.kube/config
sudo chown USER:GROUP ~/.kube/configThen you see system pods.
kubectl get pods -AFirst, install cloudflared. c.f. https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/ Then log in.
cloudflared tunnel loginCreate a tunnel.
cloudflared tunnel create --credentials-file ./credentials.json k3s-tunnelCreate a secret to hold the credentials.
kubectl create secret generic cloudflare-tunnel-credentials -n cloudflare --from-file=credentials.json=credentials.jsonAdd a DNS record: CNAME from subdomain to the .cfargotunnel.com.
Follow Argo CD Getting Started document.
Install Argo CD CLI. If you have Homebrew, run
brew install argocdInstall Argo CD via helm.
helm dependency build ./helm/argocd
helm install -f helm/argocd/values.yaml argocd ./helm/argocd/Then complete access to Argo CD with this command.
argocd login --coreI adopt app of apps pattern for deploy convinience. Just apply the root application manifest.
kubectl apply -f argocd/apps.yamlExtract the initial password for "admin" user.
kubectl get secrets -n monitoring kube-prometheus-stack-grafana -o jsonpath="{.data.admin-password}" | base64 --decodeCreate a secret for PostgreSQL.
kubectl create secret generic nextcloud-postgresql-creds -n nextcloud --from-literal=admin-password='' --from-literal=user-password=''