Primary Objects#
SkyProvider Object#
SkyProvider
is an object that represents a cloud provider.
By creating a SkyProvider object, a gateway node is created
and acts as a reouter to connect this provider to the overlay network.
During this setup, the security groups, keypairs and other required
resources are created.
The gateway
object specifies the gateway node configuration.
It is recommended to use a flavor that provides at least 4 vCPUs to provide
enough computing power required for encrypting traffic when
there is a high volume of traffic involved.
1apiVersion: xrds.skycluster.io/v1alpha1
2kind: SkyProvider
3metadata:
4 name: sky-provider-test1
5 namespace: skytest
6 labels:
7 skycluster.io/managed-by: skycluster
8
9 # This is part of internal settings and users do not
10 # need to set this.
11 # skycluster.io/provider-name: os
12 # skycluster.io/provider-region: SCINET
13 # skycluster.io/provider-zone: default
14
15 # Often there is a need to use existing external resources
16 # such as a public network, an existing router, etc.
17 # You can specify the external resource ID using
18 # the following labels:
19 # skycluster.io/ext-Kind-Group-Version: <resource-name>
20 # Due to the annotation key length limit, we only use
21 # the first word of the api group.
22 # This approach prevents creating, modifying or deleting
23 # the resource group by SkyCluster. However, SkyCluster
24 # pull resource group information and use them when
25 # creating other resources.
26
27 # For Azure, for instance, you can specify the resource group:
28 # skycluster.io/ext-ResourceGroup-azure-v1beta1: skycluster-manual
29
30 # For OpenStack providers, SkyCluster does not support creating
31 # a public (external) network.
32 # The network should exist before creating the provider.
33 # Use the label below to specify the external network name:
34 # skycluster.io/ext-os-public-subnet-name: ext-net
35
36 # Other examples:
37 # skycluster.io/ext-ProjectV3-identity-v1alpha1: 1e1c7...3ddc8f30b
38 # skycluster.io/ext-RouterV2-networking-v1alpha1: 0033d21...6153167017
39spec:
40 forProvider:
41 # For openstack, we get the subnet cidr, typically in the form of
42 # x.y.z.0/24, and we manually assign the network cidr to x.y.0.0/16
43 # Currently, this is the only swttings we support
44 vpcCidr: 10.80.10.0/24
45 gateway: {}
46 # flavor: large
47 # If public key is not provided, a new keypair using SkyCluster keypair secret
48 # will be created. This secert should be generated during the configuration of
49 # the SkyCluster.
50 # publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDQz3
51 # You can omit the vpnServer section if the secret containing the overley data
52 # is already created, otherwise you need to provide all fields within the vpnServer section
53 # vpnServer:
54 # host: http://vpnserver.com
55 # port: 443
56 # token: 123df456
57 # ca_cert: base64 encoded string of the ca.crt content
58 providerRef:
59 # Provider name can be any of the supported providers
60 # Currently, we support aws, gcp, azure and os (openstack)
61 providerName: os
62 providerRegion: <RegionName>
63 providerZone: <ZoneName>
skyprovider-example.sh
1apiVersion: xrds.skycluster.io/v1alpha1
2kind: SkyProvider
3metadata:
4 name: skyprovider-test102
5 namespace: skytest
6 labels:
7 skycluster.io/managed-by: skycluster
8 # the following labels should be added internally
9 skycluster.io/provider-name: aws
10 skycluster.io/provider-region: us-east-1
11 skycluster.io/provider-zone: use1-az1
12spec:
13 forProvider:
14 vpcCidr: 10.30.185.0/24
15 providerRef:
16 providerName: aws
17 providerRegion: us-east-1
18 providerZone: use1-az1
SkyVM Object#
SkyVM
is a virtual machine that can be deployed
across any of the registered providers by specifying the providerRef
object.
1apiVersion: xrds.skycluster.io/v1alpha1
2kind: SkyVM
3metadata:
4 name: skyvm-test-1018
5 namespace: skytest
6 labels:
7 skycluster.io/managed-by: skycluster
8 # the following labels should be added internally
9 skycluster.io/provider-name: <ProviderName>
10 skycluster.io/provider-region: <RegionName>
11 skycluster.io/provider-zone: <ZoneName>
12spec:
13 forProvider:
14 # Or you can specify the VM size and image:
15 flavor: 1vCPU-2GB # 2vCPU-2GB, 4vCPU-8GB, ...
16 image: ubuntu-22.04 # ubuntu-20.04, ubuntu-18.04
17
18 userData: |
19 #cloud-config
20 runcmd:
21 - echo "Hello, World!" > /tmp/hello.txt
22
23 # If publicIp is set to true, a public IP is assigned to the VM
24 # For openstack provider, ensure the annotation
25 # "skycluster.io/ext-os-public-subnet-name" is set to the public subnet name
26 publicIp: true
27
28 # You can create a new keypair exclusively for this VM
29 # by providing the public key. If it is not provided,
30 # the default skycluster keypair is used.
31 publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD
32
33 # If set IP forwarding is enabled for the node depending on the provider type
34 # For openstack provider, setting a security group
35 # makes IP forwarding impossible. Hence, the security group is not applied
36 # if IP forwarding is enabled.
37 iPForwarding: false
38
39 # You can create a custom security group for this VM
40 secGroup:
41 description: "Allow SSH and HTTP"
42 tcpPorts:
43 - fromPort: 22
44 toPort: 22
45 - fromPort: 80
46 toPort: 80
47 udpPorts: []
48
49 providerRef:
50 # Provider name can be any of the supported providers
51 # Currently, we support aws, gcp, azure and os (openstack)
52 providerName: <ProviderName>
53 providerRegion: <RegionName>
54 providerZone: <ZoneName>
flavor
specifies the type of VM to be created. The abstracted flavors are
introduced in the helm charts during the installation SkyCluster.
You can get a list of available flavors across providers by using skycluster
cli tool:
# Listed all available flavors across aws, azure and gcp
skycluster skyvm flavor list --provider-name aws,gcp,azure
image
specifies the image to be used for the VM. Like flavors, the abstracted images are
introduced in the helm charts during the installation SkyCluster.
You can get a list of available images across providers by using skycluster
cli tool:
# Listed all available images across aws, azure and gcp
skycluster skyvm image list --provider-name aws,gcp,azure
skyvm-example.sh
1apiVersion: xrds.skycluster.io/v1alpha1
2kind: SkyVM
3metadata:
4 name: skyvm-test102
5 namespace: skytest
6 labels:
7 skycluster.io/managed-by: skycluster
8 # the following labels should be added internally
9 skycluster.io/provider-name: aws
10 skycluster.io/provider-region: us-east-1
11 skycluster.io/provider-zone: use1-az1
12spec:
13 forProvider: {}
14 providerRef:
15 providerName: aws
16 providerRegion: us-east-1
17 providerZone: use1-az1
SkyK8SCluster Object#
SkyK8S is a virtual Kubernetes cluster which can be deployed geographically distributed across multiple cloud providers. We optimize the deployment of node pools across multiple cloud providers. So you need to specify the data flow and location constraints for each node pool. The node instances within each node pool is determined by minimum and max number of nodes and location and quality constraints.
skyk8s-example.sh
1apiVersion: xrds.skycluster.io/v1alpha1
2kind: SkyK8SCluster
3metadata:
4 labels:
5 skycluster.io/managed-by: skycluster
6 name: my-skyk8s-1
7spec:
8 forProvider:
9 # If you are using a private registry, you can specify the private registry
10 # We don't support private registry with secret yet.
11 privateRegistry: registry.skycluster.io
12 agents:
13 - name: agent-sci-1
14 flavor: 4vCPU-16GB
15 image: ubuntu-22.04
16 providerRef:
17 providerName: os
18 providerRegion: SCINET
19 providerZone: default
20 - name: agent-va-1
21 flavor: 4vCPU-16GB
22 image: ubuntu-22.04
23 providerRef:
24 providerName: os
25 providerRegion: VAUGHAN
26 providerZone: default
27 ctrl:
28 flavor: 8vCPU-32GB
29 image: ubuntu-22.04
30 providerRef:
31 providerName: os
32 providerRegion: SCINET
33 providerZone: default
34
35 # [Auto scalling functionally is not yet supported.]
36 # "autoscaling" enables scalling of the nodes in
37 # this node pool. Not implemented yet.
38 autoscaling:
39 # The minimum and maximum number of nodes is used to ensure
40 # The number of nodes in the pool is within the specified range
41 minCount: 3
42 maxCount: 5
43 metrics:
44 # Custom metrics should be specified as part of services within
45 # the cluster using the post-setup application configuration
46 - type: Metric
47 metric:
48 endpoint: my-svc/k8s-metrics
49 target: 50