Setup
terraform init
Create a .envrc
export CODER_URL="https://coder.sharing.io" export CODER_DOMAIN="coder.sharing.io" #*.DOMAIN for spaces export LOCAL_IP="" # local to the cluster for ingress export PUBLIC_IP="" # external DNS / reachable by everyone
export PDNS_API_KEY="" # Usually pretty short export PDNS_API_URL="https://pdns.ii.nz" # We may run this per cluster later export PDNS_API_ACCOUNT="" # Actually the PowerDNS Admin account
export DNS_UPDATE_SERVER="" # DNS Server to connect to export DNS_UPDATE_KEYNAME="sharing.io." # TSIG Key Name export DNS_UPDATE_KEYALGORITHM="hmac-sha256" # TSIG Key Algorithm export DNS_UPDATE_KEYSECRET=""
export DEFAULT_GIT_URL="https://github.com/ii/iipod/" export DEFAULT_ORG_URL="" export DEFAULT_CONTAINER_IMAGE="ghcr.io/ii/iipod:2024.10.17.2139"
export TF_VERSION="1.9.7"
export CODER_TEMPLATE_NAME="iipod"
export OPENAI_API_TOKEN=""
Push the standard template
coder template push \ --yes \ --directory . \ --variable coder_url=$CODER_URL \ --variable ingress_ip=$INGRESS_IP \ --variable coder_domain=$CODER_DOMAIN \ --variable openai_api_token=$OPENAI_API_TOKEN \ --variable pdns_api_url=$PDNS_API_URL \ --variable pdns_api_key=$PDNS_API_KEY \ --variable pdns_api_account=$PDNS_API_ACCOUNT \ --variable dns_update_server=$DNS_UPDATE_SERVER \ --variable dns_update_keyname=$DNS_UPDATE_KEYNAME \ --variable dns_update_keyalgorithm=$DNS_UPDATE_KEYALGORITHM \ --variable dns_update_keysecret=$DNS_UPDATE_KEYSECRET \ --variable default_git_url=$DEFAULT_GIT_URL \ --variable default_org_url=$DEFAULT_ORG_URL \ --variable default_container_image=$DEFAULT_CONTAINER_IMAGE \ $CODER_TEMPLATE_NAME \ --message "$USER iipod Template at $(date)" --variable public_ip="$(dig +short A coder.sharing.io)" \ --variable privileged=false
Push the privileged template
coder template push \ --yes \ --directory . \ --variable coder_url=$CODER_URL \ --variable ingress_ip=$INGRESS_IP \ --variable coder_domain=$CODER_DOMAIN \ --variable openai_api_token=$OPENAI_API_TOKEN \ --variable pdns_api_url=$PDNS_API_URL \ --variable pdns_api_key=$PDNS_API_KEY \ --variable pdns_api_account=$PDNS_API_ACCOUNT \ --variable dns_update_server=$DNS_UPDATE_SERVER \ --variable dns_update_keyname=$DNS_UPDATE_KEYNAME \ --variable dns_update_keyalgorithm=$DNS_UPDATE_KEYALGORITHM \ --variable dns_update_keysecret=$DNS_UPDATE_KEYSECRET \ --variable default_git_url=$DEFAULT_GIT_URL \ --variable default_org_url=$DEFAULT_ORG_URL \ --variable default_container_image=$DEFAULT_CONTAINER_IMAGE \ $CODER_TEMPLATE_NAME-privileged \ --message "$USER iipod Template at $(date)" --variable public_ip="$(dig +short A coder.sharing.io)" \ --variable privileged=true
Privileged requires the namespace label ~pod-security.kubernetes.io/enforce: privileged~.