Skip to content

Commit

Permalink
Merge pull request #501 from threefoldtech/development_docs
Browse files Browse the repository at this point in the history
add docs to resources
  • Loading branch information
rawdaGastan authored Sep 24, 2024
2 parents b79e109 + 468a301 commit 2939e83
Show file tree
Hide file tree
Showing 54 changed files with 3,807 additions and 1,003 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ linters:
- gofmt
- govet
- ineffassign
- lll
- misspell
- nakedret
- unconvert
Expand Down
50 changes: 26 additions & 24 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func main() {
Mycelium: pulumi.Bool(true),
Mounts: threefold.MountArray{
&threefold.MountArgs{
Disk_name: pulumi.String("data"),
Name: pulumi.String("data"),
Mount_point: pulumi.String("/app"),
},
},
Expand Down Expand Up @@ -300,7 +300,7 @@ deployment = threefold.Deployment("deployment",
memory=256, #MB
mycelium=True,
mounts=[threefold.MountArgs(
disk_name="data",
name="data",
mount_point="/app",
)],
env_vars={
Expand Down Expand Up @@ -379,7 +379,7 @@ resources:
planetary: true
mycelium: true
mounts:
- disk_name: data
- name: data
mount_point: /app
env_vars:
SSH_KEY:
Expand Down Expand Up @@ -434,7 +434,7 @@ const deployment = new threefold.Deployment("deployment", {
planetary: true,
mycelium: true,
mounts: [{
disk_name: "data",
name: "data",
mount_point: "/app",
}],
env_vars: {
Expand Down Expand Up @@ -510,22 +510,24 @@ func main() {
}
kubernetes, err := threefold.NewKubernetes(ctx, "kubernetes", &threefold.KubernetesArgs{
Master: &threefold.K8sNodeInputArgs{
Name: pulumi.String("kubernetes"),
Network_name: pulumi.String("test"),
Node: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
return nodes[0], nil
}).(pulumi.IntOutput),
VMInput: &threefold.VMInput{
Name: pulumi.String("kubernetes"),
Network_name: pulumi.String("test"),
NodeID: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
return nodes[0], nil
}).(pulumi.IntOutput),
Planetary: pulumi.Bool(true),
Mycelium: pulumi.Bool(true),
Cpu: pulumi.Int(2),
Memory: pulumi.Int(2048),
},
Disk_size: pulumi.Int(2),
Planetary: pulumi.Bool(true),
Mycelium: pulumi.Bool(true),
Cpu: pulumi.Int(2),
Memory: pulumi.Int(2048),
},
Workers: threefold.K8sNodeInputArray{
&threefold.K8sNodeInputArgs{
Name: pulumi.String("worker1"),
Network_name: pulumi.String("test"),
Node: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
Node_id: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
return nodes[0], nil
}).(pulumi.IntOutput),
Disk_size: pulumi.Int(2),
Expand All @@ -535,7 +537,7 @@ func main() {
&threefold.K8sNodeInputArgs{
Name: pulumi.String("worker2"),
Network_name: pulumi.String("test"),
Node: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
Node_id: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
return nodes[0], nil
}).(pulumi.IntOutput),
Disk_size: pulumi.Int(2),
Expand Down Expand Up @@ -594,7 +596,7 @@ kubernetes = threefold.Kubernetes("kubernetes",
master=threefold.K8sNodeInputArgs(
name="kubernetes",
network_name="example",
node=scheduler.nodes[0],
node_id=scheduler.nodes[0],
disk_size=2,
planetary=True,
mycelium=True,
Expand All @@ -605,15 +607,15 @@ kubernetes = threefold.Kubernetes("kubernetes",
threefold.K8sNodeInputArgs(
name="worker1",
network_name="example",
node=scheduler.nodes[0],
node_id=scheduler.nodes[0],
disk_size=2,
cpu=2,
memory=2048,
),
threefold.K8sNodeInputArgs(
name="worker2",
network_name="example",
node=scheduler.nodes[0],
node_id=scheduler.nodes[0],
disk_size=2,
cpu=2,
memory=2048,
Expand Down Expand Up @@ -678,7 +680,7 @@ resources:
master:
name: kubernetes
network_name: test
node: ${scheduler.nodes[0]}
node_id: ${scheduler.nodes[0]}
disk_size: 2
planetary: true
mycelium: true
Expand All @@ -688,14 +690,14 @@ resources:
workers:
- name: worker1
network_name: test
node: ${scheduler.nodes[0]}
node_id: ${scheduler.nodes[0]}
disk_size: 2
cpu: 2
memory: 2048
mycelium: true
- name: worker2
network_name: test
node: ${scheduler.nodes[0]}
node_id: ${scheduler.nodes[0]}
disk_size: 2
cpu: 2
memory: 2048
Expand Down Expand Up @@ -740,7 +742,7 @@ const kubernetes = new threefold.Kubernetes("kubernetes", {
master: {
name: "kubernetes",
network_name: "test",
node: scheduler.nodes[0],
node_id: scheduler.nodes[0],
disk_size: 2,
planetary: true,
mycelium: true,
Expand All @@ -751,7 +753,7 @@ const kubernetes = new threefold.Kubernetes("kubernetes", {
{
name: "worker1",
network_name: "test",
node: scheduler.nodes[0],
node_id: scheduler.nodes[0],
disk_size: 2,
cpu: 2,
memory: 2048,
Expand All @@ -760,7 +762,7 @@ const kubernetes = new threefold.Kubernetes("kubernetes", {
{
name: "worker2",
network_name: "test",
node: scheduler.nodes[0],
node_id: scheduler.nodes[0],
disk_size: 2,
cpu: 2,
memory: 2048,
Expand Down
16 changes: 8 additions & 8 deletions examples/go/kubernetes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,35 @@ func main() {
Master: &threefold.K8sNodeInputArgs{
Name: pulumi.String("kubernetes"),
Network_name: pulumi.String("test"),
Node: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
Node_id: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
return nodes[0], nil
}).(pulumi.IntOutput),
Disk_size: pulumi.Int(2),
Planetary: pulumi.Bool(true),
Mycelium: pulumi.Bool(true),
Cpu: pulumi.Int(2),
Memory: pulumi.Int(2048),
Disk_size: pulumi.Int(2),
},
Workers: threefold.K8sNodeInputArray{
&threefold.K8sNodeInputArgs{
Name: pulumi.String("worker1"),
Network_name: pulumi.String("test"),
Node: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
Node_id: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
return nodes[0], nil
}).(pulumi.IntOutput),
Disk_size: pulumi.Int(2),
Cpu: pulumi.Int(2),
Memory: pulumi.Int(2048),
Disk_size: pulumi.Int(2),
},
&threefold.K8sNodeInputArgs{
Name: pulumi.String("worker2"),
Network_name: pulumi.String("test"),
Node: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
Node_id: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) {
return nodes[0], nil
}).(pulumi.IntOutput),
Disk_size: pulumi.Int(2),
Cpu: pulumi.Int(2),
Memory: pulumi.Int(2048),
Disk_size: pulumi.Int(2),
},
},
Token: pulumi.String("t123456789"),
Expand All @@ -86,10 +86,10 @@ func main() {
return err
}
ctx.Export("node_deployment_id", kubernetes.Node_deployment_id)
ctx.Export("planetary_ip", kubernetes.Master_computed.ApplyT(func(master_computed threefold.K8sNodeComputed) (*string, error) {
ctx.Export("planetary_ip", kubernetes.Master_computed.ApplyT(func(master_computed threefold.VMComputed) (*string, error) {
return &master_computed.Planetary_ip, nil
}).(pulumi.StringPtrOutput))
ctx.Export("mycelium_ip", kubernetes.Master_computed.ApplyT(func(master_computed threefold.K8sNodeComputed) (*string, error) {
ctx.Export("mycelium_ip", kubernetes.Master_computed.ApplyT(func(master_computed threefold.VMComputed) (*string, error) {
return &master_computed.Mycelium_ip, nil
}).(pulumi.StringPtrOutput))
return nil
Expand Down
2 changes: 1 addition & 1 deletion examples/go/virtual_machine/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func main() {
Mycelium: pulumi.Bool(true),
Mounts: threefold.MountArray{
&threefold.MountArgs{
Disk_name: pulumi.String("data"),
Name: pulumi.String("data"),
Mount_point: pulumi.String("/app"),
},
},
Expand Down
6 changes: 3 additions & 3 deletions examples/nodejs/kubernetes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const kubernetes = new threefold.Kubernetes("kubernetes", {
master: {
name: "kubernetes",
network_name: "test",
node: scheduler.nodes[0],
node_id: scheduler.nodes[0],
disk_size: 2,
planetary: true,
mycelium: true,
Expand All @@ -33,15 +33,15 @@ const kubernetes = new threefold.Kubernetes("kubernetes", {
{
name: "worker1",
network_name: "test",
node: scheduler.nodes[0],
node_id: scheduler.nodes[0],
disk_size: 2,
cpu: 2,
memory: 2048,
},
{
name: "worker2",
network_name: "test",
node: scheduler.nodes[0],
node_id: scheduler.nodes[0],
disk_size: 2,
cpu: 2,
memory: 2048,
Expand Down
2 changes: 1 addition & 1 deletion examples/nodejs/virtual_machine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const deployment = new threefold.Deployment("deployment", {
planetary: true,
mycelium: true,
mounts: [{
disk_name: "data",
name: "data",
mount_point: "/app",
}],
env_vars: {
Expand Down
6 changes: 3 additions & 3 deletions examples/python/kubernetes/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
master=threefold.K8sNodeInputArgs(
name="kubernetes",
network_name="test",
node=scheduler.nodes[0],
node_id=scheduler.nodes[0],
disk_size=2,
planetary=True,
mycelium=True,
Expand All @@ -34,7 +34,7 @@
threefold.K8sNodeInputArgs(
name="worker1",
network_name="test",
node=scheduler.nodes[0],
node_id=scheduler.nodes[0],
disk_size=2,
cpu=2,
memory=2048,
Expand All @@ -43,7 +43,7 @@
threefold.K8sNodeInputArgs(
name="worker2",
network_name="test",
node=scheduler.nodes[0],
node_id=scheduler.nodes[0],
disk_size=2,
cpu=2,
memory=2048,
Expand Down
2 changes: 1 addition & 1 deletion examples/python/virtual_machine/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
memory=256, #MB
mycelium=True,
mounts=[threefold.MountArgs(
disk_name="data",
name="data",
mount_point="/app",
)],
env_vars={
Expand Down
6 changes: 3 additions & 3 deletions examples/yaml/kubernetes/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ resources:
master:
name: kubernetes
network_name: test
node: ${scheduler.nodes[0]}
node_id: ${scheduler.nodes[0]}
disk_size: 2
planetary: true
mycelium: true
Expand All @@ -58,14 +58,14 @@ resources:
workers:
- name: worker1
network_name: test
node: ${scheduler.nodes[0]}
node_id: ${scheduler.nodes[0]}
disk_size: 2
cpu: 2
memory: 2048
mycelium: true
- name: worker2
network_name: test
node: ${scheduler.nodes[0]}
node_id: ${scheduler.nodes[0]}
disk_size: 2
cpu: 2
memory: 2048
Expand Down
6 changes: 3 additions & 3 deletions examples/yaml/multiple_vms/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ resources:
mycelium: true
# mycelium_ip_seed: b60f2b7ec39c # hex encoded 6 bytes [example]
mounts:
- disk_name: data
- name: data
mount_point: /app
env_vars:
SSH_KEY:
Expand All @@ -70,7 +70,7 @@ resources:
mycelium: true
# mycelium_ip_seed: b60f2b7ec39c # hex encoded 6 bytes [example]
mounts:
- disk_name: data
- name: data
mount_point: /app
env_vars:
SSH_KEY:
Expand All @@ -85,7 +85,7 @@ resources:
mycelium: true
# mycelium_ip_seed: b60f2b7ec39c # hex encoded 6 bytes [example]
mounts:
- disk_name: data
- name: data
mount_point: /app
env_vars:
SSH_KEY:
Expand Down
2 changes: 1 addition & 1 deletion examples/yaml/virtual_machine/Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ resources:
mycelium: true
# mycelium_ip_seed: b60f2b7ec39c # hex encoded 6 bytes [example]
mounts:
- disk_name: data
- name: data
mount_point: /app
env_vars:
SSH_KEY:
Expand Down
Loading

0 comments on commit 2939e83

Please sign in to comment.