Skip to content

Instantly share code, notes, and snippets.

@mikebell

mikebell/k30s-master.yaml

Last active Apr 19, 2020
Embed
What would you like to do?
ssh_authorized_keys:
- "github:mikebell"
hostname: k30s-master
write_files:
- enconding: ""
content: |-
#!/bin/bash
write_log () {
local message="${1}"
logger -t "run-cmd" "${message}"
echo "${message}"
}
write_log "Getting the service using eth0..."
ETH0=$(connmanctl services | awk '{ print $3 }' | while read -r s1; do connmanctl services $s1 | grep -q "eth0" && echo "$s1"; done)
write_log "eth0 is bound to: ${ETH0}"
write_log "Setting up manual net config..."
connmanctl config $ETH0 --ipv4 manual 192.168.1.250 255.255.255.0 192.168.1.1 --nameservers 1.1.1.1 1.0.0.1
connmanctl config $ETH0 --ipv6 off
write_log "Restarting connman..."
service connman restart
write_log "$(connmanctl services $ETH0)"
write_log "Network setup done."
owner: root:root
path: /etc/run-cmd.sh
permissions: '0755'
run_cmd:
- "/etc/run-cmd.sh"
k3s_args:
- server
- "--disable-agent --no-deploy traefik --no-deploy servicelb"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment