Skip to content

Commit

Permalink
WIP: Cloudstack
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred78290 committed Aug 4, 2024
1 parent 28ea220 commit 5d02a04
Show file tree
Hide file tree
Showing 33 changed files with 6,607 additions and 51 deletions.
87 changes: 87 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,27 @@
]
},
{
"preLaunchTask": "k3s cloudstack",
"name": "k3s cloudstack",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}",
"cwd": "${env:HOME}/go/src/github.com/Fred78290/kubernetes-cloud-autoscaler",
"args": [
"--listen=unix:/tmp/autoscaler.sock",
"--request-timeout=120s",
"--grpc-provider=externalgrpc",
"--distribution=k3s",
"--plateform=cloudstack",
"--plateform-config=${workspaceFolder}/.config/cloudstack/cloudstack-dev-k3s/provider.json",
"--machines=${workspaceFolder}/.config/cloudstack/cloudstack-dev-k3s/machines.json",
"--config=${workspaceFolder}/.config/cloudstack/cloudstack-dev-k3s/autoscaler.json",
"--save=${workspaceFolder}/.config/cloudstack/cloudstack-dev-k3s/state.json",
"--kubeconfig=${workspaceFolder}/.config/cloudstack/cloudstack-dev-k3s/config",
"--log-level=debug"
]
}, {
"preLaunchTask": "k3s vsphere",
"name": "k3s vsphere",
"type": "go",
Expand Down Expand Up @@ -214,6 +235,28 @@
]
},
{
"preLaunchTask": "kubeadm cloudstack",
"name": "kubeadm cloudstack",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}",
"cwd": "${env:HOME}/go/src/github.com/Fred78290/kubernetes-cloud-autoscaler",
"args": [
"--listen=unix:/tmp/autoscaler.sock",
"--request-timeout=120s",
"--grpc-provider=externalgrpc",
"--distribution=kubeadm",
"--plateform=cloudstack",
"--plateform-config=${workspaceFolder}/.config/cloudstack/cloudstack-dev-kubeadm/provider.json",
"--cloud-provider=external",
"--machines=${workspaceFolder}/.config/cloudstack/cloudstack-dev-kubeadm/machines.json",
"--config=${workspaceFolder}/.config/cloudstack/cloudstack-dev-kubeadm/autoscaler.json",
"--save=${workspaceFolder}/.config/cloudstack/cloudstack-dev-kubeadm/state.json",
"--kubeconfig=${workspaceFolder}/.config/cloudstack/cloudstack-dev-kubeadm/config",
"--log-level=info"
]
}, {
"preLaunchTask": "kubeadm vsphere",
"name": "kubeadm vsphere",
"type": "go",
Expand Down Expand Up @@ -334,6 +377,28 @@
]
},
{
"preLaunchTask": "rke2 cloudstack",
"name": "rke2 cloudstack",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}",
"cwd": "${env:HOME}/go/src/github.com/Fred78290/kubernetes-cloud-autoscaler",
"args": [
"--listen=unix:/tmp/autoscaler.sock",
"--request-timeout=120s",
"--grpc-provider=externalgrpc",
"--distribution=rke2",
"--plateform=cloudstack",
"--plateform-config=${workspaceFolder}/.config/cloudstack/cloudstack-dev-rke2/provider.json",
"--cloud-provider=external",
"--machines=${workspaceFolder}/.config/cloudstack/cloudstack-dev-rke2/machines.json",
"--config=${workspaceFolder}/.config/cloudstack/cloudstack-dev-rke2/autoscaler.json",
"--save=${workspaceFolder}/.config/cloudstack/cloudstack-dev-rke2/state.json",
"--kubeconfig=${workspaceFolder}/.config/cloudstack/cloudstack-dev-rke2/config",
"--log-level=debug"
]
}, {
"preLaunchTask": "rke2 vsphere",
"name": "rke2 vsphere",
"type": "go",
Expand Down Expand Up @@ -454,6 +519,28 @@
]
},
{
"preLaunchTask": "microk8s cloudstack",
"name": "microk8s cloudstack",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}",
"cwd": "${env:HOME}/go/src/github.com/Fred78290/kubernetes-cloud-autoscaler",
"args": [
"--listen=unix:/tmp/autoscaler.sock",
"--request-timeout=120s",
"--grpc-provider=externalgrpc",
"--distribution=microk8s",
"--plateform=cloudstack",
"--plateform-config=${workspaceFolder}/.config/cloudstack/cloudstack-dev-microk8s/provider.json",
"--cloud-provider=external",
"--machines=${workspaceFolder}/.config/cloudstack/cloudstack-dev-microk8s/machines.json",
"--config=${workspaceFolder}/.config/cloudstack/cloudstack-dev-microk8s/autoscaler.json",
"--save=${workspaceFolder}/.config/cloudstack/cloudstack-dev-microk8s/state.json",
"--kubeconfig=${workspaceFolder}/.config/cloudstack/cloudstack-dev-microk8s/config",
"--log-level=debug"
]
}, {
"preLaunchTask": "microk8s vsphere",
"name": "microk8s vsphere",
"type": "go",
Expand Down
39 changes: 39 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@
}
},
{
"label": "k3s cloudstack",
"type": "shell",
"command": "${workspaceFolder}/scripts/prepare.sh cloudstack cloudstack-dev-k3s",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}, {
"label": "k3s vsphere",
"type": "shell",
"command": "${workspaceFolder}/scripts/prepare.sh vsphere vsphere-dev-k3s",
Expand Down Expand Up @@ -113,6 +122,16 @@
"isDefault": true
}
},
{
"label": "kubeadm cloudstack",
"type": "shell",
"command": "${workspaceFolder}/scripts/prepare.sh cloudstack cloudstack-dev-kubeadm",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "kubeadm vsphere",
"type": "shell",
Expand Down Expand Up @@ -163,6 +182,16 @@
"isDefault": true
}
},
{
"label": "rke2 cloudstack",
"type": "shell",
"command": "${workspaceFolder}/scripts/prepare.sh cloudstack cloudstack-dev-rke2",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "rke2 vsphere",
"type": "shell",
Expand Down Expand Up @@ -213,6 +242,16 @@
"isDefault": true
}
},
{
"label": "microk8s cloudstack",
"type": "shell",
"command": "${workspaceFolder}/scripts/prepare.sh cloudstack cloudstack-dev-microk8s",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "microk8s vsphere",
"type": "shell",
Expand Down
21 changes: 21 additions & 0 deletions artifacts/examples/cloudstack/k3s/managed-addr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: "nodemanager.aldunelabs.com/v1alpha2"
kind: "ManagedNode"
metadata:
name: "cloudstack-dev-k3s-managed-02"
spec:
nodegroup: cloudstack-dev-k3s
controlPlane: false
allowDeployment: true
instanceType: small
labels:
- demo-label.acme.com=demo
- sample-label.acme.com=sample
annotations:
- demo-annotation.acme.com=demo
- sample-annotation.acme.com=sample
network:
cloudstack:
- network: vpc-01
dhcp: false
address: 172.16.0.24
netmask: 255.255.254.0
43 changes: 43 additions & 0 deletions artifacts/examples/cloudstack/k3s/managed-control-plane.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: "nodemanager.aldunelabs.com/v1alpha2"
kind: "ManagedNode"
metadata:
name: "cloudstack-dev-k3s-master-02"
spec:
nodegroup: cloudstack-dev-k3s
controlPlane: true
allowDeployment: true
instanceType: medium
labels:
- demo-label.acme.com=demo
- sample-label.acme.com=sample
annotations:
- demo-annotation.acme.com=demo
- sample-annotation.acme.com=sample
network:
cloudstack:
- network: vpc-01
dhcp: false
address: 172.16.0.11
netmask: 255.255.252.0
---
apiVersion: "nodemanager.aldunelabs.com/v1alpha2"
kind: "ManagedNode"
metadata:
name: "cloudstack-dev-k3s-master-03"
spec:
nodegroup: cloudstack-dev-k3s
controlPlane: true
allowDeployment: true
instanceType: medium
labels:
- demo-label.acme.com=demo
- sample-label.acme.com=sample
annotations:
- demo-annotation.acme.com=demo
- sample-annotation.acme.com=sample
network:
cloudstack:
- network: vpc-01
dhcp: false
address: 172.16.0.12
netmask: 255.255.252.0
19 changes: 19 additions & 0 deletions artifacts/examples/cloudstack/k3s/managed-dhcp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: "nodemanager.aldunelabs.com/v1alpha2"
kind: "ManagedNode"
metadata:
name: "cloudstack-dev-k3s-managed-01"
spec:
nodegroup: cloudstack-dev-k3s
controlPlane: false
allowDeployment: true
instanceType: small
labels:
- demo-label.acme.com=demo
- sample-label.acme.com=sample
annotations:
- demo-annotation.acme.com=demo
- sample-annotation.acme.com=sample
network:
cloudstack:
- network: vpc-01
dhcp: true
39 changes: 39 additions & 0 deletions artifacts/examples/cloudstack/k3s/managed-nodes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: "nodemanager.aldunelabs.com/v1alpha2"
kind: "ManagedNode"
metadata:
name: "cloudstack-dev-k3s-managed-01"
spec:
nodegroup: cloudstack-dev-k3s
controlPlane: false
allowDeployment: true
instanceType: small
labels:
- demo-label.acme.com=demo
- sample-label.acme.com=sample
annotations:
- demo-annotation.acme.com=demo
- sample-annotation.acme.com=sample
network:
cloudstack:
- network: vpc-01
dhcp: true
---
apiVersion: "nodemanager.aldunelabs.com/v1alpha2"
kind: "ManagedNode"
metadata:
name: "cloudstack-dev-k3s-managed-02"
spec:
nodegroup: cloudstack-dev-k3s
controlPlane: false
allowDeployment: true
instanceType: small
labels:
- demo-label.acme.com=demo
- sample-label.acme.com=sample
annotations:
- demo-annotation.acme.com=demo
- sample-annotation.acme.com=sample
network:
cloudstack:
- network: vpc-01
dhcp: true
21 changes: 21 additions & 0 deletions artifacts/examples/cloudstack/kubeadm/managed-addr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: "nodemanager.aldunelabs.com/v1alpha2"
kind: "ManagedNode"
metadata:
name: "cloudstack-dev-kubeadm-managed-02"
spec:
nodegroup: cloudstack-dev-kubeadm
controlPlane: false
allowDeployment: true
instanceType: small
labels:
- demo-label.acme.com=demo
- sample-label.acme.com=sample
annotations:
- demo-annotation.acme.com=demo
- sample-annotation.acme.com=sample
network:
cloudstack:
- network: "vpc-01"
dhcp: false
address: 172.16.0.24
netmask: 255.255.252.0
44 changes: 44 additions & 0 deletions artifacts/examples/cloudstack/kubeadm/managed-control-plane.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apiVersion: "nodemanager.aldunelabs.com/v1alpha2"
kind: "ManagedNode"
metadata:
name: "cloudstack-dev-kubeadm-master-02"
spec:
nodegroup: cloudstack-dev-kubeadm
controlPlane: true
allowDeployment: true
instanceType: small
labels:
- demo-label.acme.com=demo
- sample-label.acme.com=sample
annotations:
- demo-annotation.acme.com=demo
- sample-annotation.acme.com=sample
network:
cloudstack:
- network: vpc-01
dhcp: false
address: 172.16.0.11
netmask: 255.255.252.0
---
apiVersion: "nodemanager.aldunelabs.com/v1alpha2"
kind: "ManagedNode"
metadata:
name: "cloudstack-dev-kubeadm-master-03"
spec:
nodegroup: cloudstack-dev-kubeadm
controlPlane: true
allowDeployment: true
instanceType: small

labels:
- demo-label.acme.com=demo
- sample-label.acme.com=sample
annotations:
- demo-annotation.acme.com=demo
- sample-annotation.acme.com=sample
network:
cloudstack:
- network: vpc-01
dhcp: false
address: 172.16.0.12
netmask: 255.255.252.0
19 changes: 19 additions & 0 deletions artifacts/examples/cloudstack/kubeadm/managed-dhcp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: "nodemanager.aldunelabs.com/v1alpha2"
kind: "ManagedNode"
metadata:
name: "cloudstack-dev-kubeadm-managed-01"
spec:
nodegroup: cloudstack-dev-kubeadm
controlPlane: false
allowDeployment: true
instanceType: small
labels:
- demo-label.acme.com=demo
- sample-label.acme.com=sample
annotations:
- demo-annotation.acme.com=demo
- sample-annotation.acme.com=sample
network:
cloudstack:
- network: "vpc-01"
dhcp: true
Loading

0 comments on commit 5d02a04

Please sign in to comment.