Skip to content

Instantly share code, notes, and snippets.

@wickedev
Last active October 12, 2022 02:51
Show Gist options
  • Save wickedev/e6edd4bc0b4e03339f1429100521c1ce to your computer and use it in GitHub Desktop.
Save wickedev/e6edd4bc0b4e03339f1429100521c1ce to your computer and use it in GitHub Desktop.
#!/bin/bash
EXTERNAL_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
curl -sfL https://get.k3s.io | sh -s - \
--disable=traefik \
--no-deploy=traefik \
--write-kubeconfig-mode=644 \
--tls-san=${EXTERNAL_IP}
mkdir $HOME/.kube
cat /etc/rancher/k3s/k3s.yaml \
| sed -e "s/127.0.0.1/$EXTERNAL_IP/" \
> $HOME/.kube/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment