Skip to content

Commit

Permalink
Merge pull request #1139 from threefoldtech/development_wireguard_opt…
Browse files Browse the repository at this point in the history
…ion_to_tfrobot

added wireguard option to tfrobot
  • Loading branch information
rawdaGastan authored Aug 11, 2024
2 parents 35c6519 + c078a0d commit 3d8c334
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tfrobot/example/conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"env_vars": {
"user": "user1",
"pwd": "1234"
}
},
"wireguard": false
}
],
"ssh_keys": {
Expand Down
1 change: 1 addition & 0 deletions tfrobot/example/conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ vms:
env_vars: # env vars are passed to the newly created vms
user: user1
pwd: 1234
wireguard: false

ssh_keys: # map of ssh keys with key=name and value=the actual ssh key
example1: ssh_key1
Expand Down
15 changes: 15 additions & 0 deletions tfrobot/example/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ node_groups:
free_cpu: 2
free_mru: 8

- name: group_d
nodes_count: 2
free_cpu: 1
free_mru: 4

vms:
- name: example_a #test deployment of vms with public ip
vms_count: 3
Expand Down Expand Up @@ -49,5 +54,15 @@ vms:
entry_point: /sbin/zinit init
ssh_key: key1

- name: example_d #test deployment with wireguard access
vms_count: 2
node_group: group_d
cpu: 1
mem: 1
wireguard: true
flist: https://hub.grid.tf/tf-official-apps/base:latest.flist
entry_point: /sbin/zinit init
ssh_key: key1

ssh_keys:
key1: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsnouceyLPDj1OFjMO0amzznxbSurxLbZ21WEY5o6uaBuhAlDa2zMIvN8gmeZZeJcKHZfOZI0+atVo0FCjFc2VWZX7LwasW4Lbb2MV3xk4RTlkIRlKov/Iyj8lcAXEnFIV81fpLZtTmk6ERp5gYIBYP2n5CISK0lCiWeu/QFerYa9lb1cYpo/+epSREts4ka80XifA12kWMKfDNJKcWqv4EZZyRyPTVTTxKSJzHahu+J+Kpg+fs65toRaDAuXDzwBLJ/d2qCeR3dfbJl681jiFUlS46ap4njSrnGLssSSwpbhxPEWF3lJ+mQFn14aPLQikq4lOhGUhq7BCYQH9RNkZ
3 changes: 1 addition & 2 deletions tfrobot/pkg/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ func buildNetworkDeployment(vm Vms, nodeID uint32, name, solutionType string) wo

myceliumKeys[nodeID] = key
}

return workloads.ZNet{
Name: fmt.Sprintf("%s_network", name),
Description: "network for mass deployment",
Expand All @@ -335,7 +334,7 @@ func buildNetworkDeployment(vm Vms, nodeID uint32, name, solutionType string) wo
IP: net.IPv4(10, 20, 0, 0),
Mask: net.CIDRMask(16, 32),
}),
AddWGAccess: false,
AddWGAccess: vm.WireGuard,
MyceliumKeys: myceliumKeys,
SolutionType: solutionType,
}
Expand Down
1 change: 1 addition & 0 deletions tfrobot/pkg/deployer/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type Vms struct {
Entrypoint string `yaml:"entry_point" validate:"required" json:"entry_point"`
SSHKey string `yaml:"ssh_key" validate:"required" json:"ssh_key"`
EnvVars map[string]string `yaml:"env_vars" json:"env_vars"`
WireGuard bool `yaml:"wireguard" json:"wireguard"`
}

type Disk struct {
Expand Down

0 comments on commit 3d8c334

Please sign in to comment.