Skip to content

Commit eb84daf

Browse files
committed
add EdgeNet@home configuration
1 parent 8fc2b1a commit eb84daf

File tree

7 files changed

+27
-11
lines changed

7 files changed

+27
-11
lines changed

edgenet-at-home-node.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
- hosts: all
3+
become: true
4+
roles:
5+
- edgenet-ssh
6+
- edgenet-kubernetes
7+
vars_files:
8+
- vars/edgenet-at-home.yml

main.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
"time"
3535
)
3636

37-
const defaultKubeconfigURL = "https://raw.githubusercontent.com/EdgeNet-project/edgenet/master/configs/public.cfg"
3837
const defaultVPNNetworkV4 = "10.183.0.0/20"
3938
const defaultVPNNetworkV6 = "fdb4:ae86:ec99:4004::/64"
4039
const edgenetConfigFile = "/opt/edgenet/config.yaml"
@@ -157,10 +156,6 @@ func main() {
157156
config.load(edgenetConfigFile)
158157
log.Printf("config=%+v\n", config)
159158

160-
if config.KubeconfigURL == "" {
161-
config.KubeconfigURL = defaultKubeconfigURL
162-
}
163-
164159
if config.Platform == "" {
165160
log.Println("step=detect-platform")
166161
config.Platform = platforms.Detect()
@@ -188,7 +183,7 @@ func main() {
188183
check(err)
189184
_, vpnNetworkV6, err := net.ParseCIDR(defaultVPNNetworkV6)
190185
check(err)
191-
config.VPNIPv4, config.VPNIPv6 = cluster.FindVPNIPs(defaultKubeconfigURL, *vpnNetworkV4, *vpnNetworkV6)
186+
config.VPNIPv4, config.VPNIPv6 = cluster.FindVPNIPs(config.KubeconfigURL, *vpnNetworkV4, *vpnNetworkV6)
192187
}
193188

194189
if config.VPNPrivateKey == "" {
@@ -219,9 +214,9 @@ func main() {
219214
network.AssignVPNIP(vpnLinkName, *config.VPNIPv4, *config.VPNIPv6)
220215
privateKey, err := wgtypes.ParseKey(config.VPNPrivateKey)
221216
check(err)
222-
cluster.CreateVPNPeer(defaultKubeconfigURL, hostname, config.PublicIPv4, config.VPNIPv4.IP, config.VPNIPv6.IP, config.VPNListenPort, privateKey.PublicKey().String())
217+
cluster.CreateVPNPeer(config.KubeconfigURL, hostname, config.PublicIPv4, config.VPNIPv4.IP, config.VPNIPv6.IP, config.VPNListenPort, privateKey.PublicKey().String())
223218
// Pre-establish the tunnels before the VPNPeer controller gets started.
224-
peers := cluster.ListVPNPeer(defaultKubeconfigURL)
219+
peers := cluster.ListVPNPeer(config.KubeconfigURL)
225220
for _, peer := range peers {
226221
network.AddPeer(vpnLinkName, peer)
227222
}
@@ -239,5 +234,5 @@ func main() {
239234
network.SetKubeletNodeIP(kubeletEnvFileRedHat, nodeIP)
240235

241236
log.Println("step=join-cluster")
242-
cluster.Join(defaultKubeconfigURL, hostname, nodeIP)
237+
cluster.Join(config.KubeconfigURL, hostname, nodeIP)
243238
}

roles/edgenet-kubernetes/tasks/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@
102102
state: directory
103103
mode: "0755"
104104

105+
- name: Ensure EdgeNet configuration is present
106+
template:
107+
src: edgenet-config.yaml.j2
108+
dest: /opt/edgenet/config.yaml
109+
mode: 0644
110+
105111
- name: Ensure EdgeNet binary is present
106112
get_url:
107113
url: "{{ edgenet_node_url }}"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kubeconfigURL: {{ kubeconfig_url }}

roles/edgenet-ssh/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
groups: wheel
2929
append: true
3030
createhome: true
31-
comment: EdgeNet (edge-net.org)
31+
comment: edge-net.org
3232

3333
- name: Ensure the .ssh directory is present
3434
file:

vars/edgenet-at-home.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# edgenet-kubernetes
2+
containerd_version: 1.6
3+
kubernetes_version: 1.23
4+
edgenet_node_version: 1.0.13
5+
# edgenet-ssh
6+
edgenet_ssh_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD0yU5EV3zQaP/2Ln4do32sHLm9NdU7p3vQUIKY/AttBp+91equT2jA7SD+71aOYiEp8TzjNCCN98DJxwyhT4MM0FRkd0KbgB3djk4rDJ4ePSeqPtmEXwzRfbnrMqfs9pt0STGWLqpCkPrX7Vfo89PyNMi3fGJaKJ+8AcYf40uLQm5MrPS1XZIOYi+UOru7VlgA53UxGkG0NorjCMYw5Sqt0q4Ds1pURBGq+dorbwgur4SgtYLURXvEqJG8q32Ta6q2hLQ6jJ3/hPaEs5Uc/pEmAoS5QMK5HLQtJxTlNQ3WfMz+Oz1NZRAaZO3TrrGKs4J2bUu9d6fbn1XIYtCF9ABXI+cBYPMk8RtOyNR8Rl9mxa1qN6KDgeCJR897Bo/IIIBwdthfK3kpQsK/PvPJIlTbga/e7r6fnYfXpa1Ycs36AfwZko6W5BorxMXza7asRLNvDa2TgZmfTsTEBut8Jw1BRIJWkvZRWbAmS13XE/bUPO3win0nq4CPO/8Q2UlqzudaDEWqrnlB7bgrEUoMSyTp0yG9JG1DAgKXOk9Z0dcUZ/XyhwSeR/nET7avKO2ixWX+1CPqPIHA3Ya3BYlWwYBkdEStA5k3c/7lrSRVzbBhsW9x8InyeLh+Tiv4VNG9V0BnsDzS6zppk+QpvlVfJBpNGfFTvoEsaSf6HcA8+V12Pw== [email protected]

vars/edgenet-production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# edgenet-kubernetes
22
containerd_version: 1.4
33
kubernetes_version: 1.21
4-
edgenet_node_version: 1.0.12
4+
edgenet_node_version: 1.0.13

0 commit comments

Comments
 (0)