Cluster-template

There are a relationship between controller

Configuration

cluster infrastructure controller OscCluster

example without bastion:

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OscCluster
metadata:
  name: hello-osc
  namespace: default
spec:
  network:
    bastion:
      enable: false
    clusterName: cluster-api
    subregionName: eu-west-2a
    loadBalancer:
      loadbalancername: OscSdkExample-7
      subregionname: eu-west-2a
    net:
      name: cluster-api-net
      clusterName: cluster-api
      ipRange: "172.19.95.128/25"
    subnets:
      - name: cluster-api-subnet
        ipSubnetRange: "172.19.95.192/27"
    publicIps:
      - name: cluster-api-publicip

    internetService:
      clusterName: cluster-api
      name: cluster-api-internetservice
    natService:
      clusterName: cluster-api
      name: cluster-api-natservice
      publicipname: cluster-api-publicip
      subnetname: cluster-api-subnet
    routeTables:
      - name: cluster-api-routetable
        subnetname: cluster-api-subnet
        routes:
          - name: cluster-api-routes
            targetName: cluster-api-internetservice
            targetType: gateway 
            destination: "0.0.0.0/0"
    securityGroups:
      - name: cluster-api-securitygroups
        description: Security Group with cluster-api   
        securityGroupRules:
          - name: cluste-api-securitygrouprule
            flow: Inbound
            ipProtocol: tcp
            ipRange: "46.231.147.5/32"
            fromPortRange: 22
            toPortRange: 22 

example with bastion:

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OscCluster
metadata:
  name:  cluster-api
  namespace: default
spec:
  network:
    clusterName: cluster-api
    loadBalancer:
      loadbalancername: cluster-api-lb
      clusterName: cluster-api
      loadbalancertype: internet-facing
      subnetname: cluster-api-subnet
      securitygroupname: cluster-api-securitygroup-lb
    net:
      name: cluster-api-net
      clusterName: cluster-api-az
      ipRange: "10.0.0.0/16"
    internetService:
      name: cluster-api-igw
      clusterName: cluster-api
    controlPlaneSubnets:
      - cluster-api-subnet
    subnets:
    - name: cluster-api-subnet
      ipSubnetRange: "10.0.0.0/24"
      subregionName: eu-west-2a
    natServices:
    - name: cluster-api-nat
      clusterName: cluster-api
      publicipname: cluster-api-publicip
      subnetname: cluster-api-subnet
    publicIps:
      - name: cluster-api-publicip
        clusterName: cluster-api
    routeTables:
    - name: cluster-api-rtb
      subnets:
      - cluster-api-subnet
      routes:
      - name: cluster-api-nat
        targetName: cluster-api-nat
        targetType: nat
        destination: "0.0.0.0/0"
    securityGroups:
    - name: cluster-api-securitygroup-lb
      description: Cluster-api Load Balancer Security Group
      securityGroupRules:
      - name: cluster-api-securitygrouprule-calico-vxlan
        flow: Inbound
        ipProtocol: tcp
        ipRange: "0.0.0.0/0"
        fromPortRange: 6443
        toPortRange: 6443
    bastion:
      clusterName: cluster-api
      enable: true
      name: cluster-api-vm-bastion
      keypairName: cluster-api
      deviceName: /dev/sda1
      imageName: ubuntu-2004-2004-kubernetes-v1.22.11-2022-08-22
      rootDisk:
        rootDiskSize: 15
        rootDiskIops: 1000
        rootDiskType: io1
      subnetName: cluster-api-subnet-public
      subregionName: eu-west-2a
      securityGroupNames:
        - name: cluster-api-securitygroup-lb
      vmType: "tinav6.c4r8p2"

loadBalancer

NameDefaultRequiredDescription
loadbalancernameOscClusterApi-1falseThe Load Balancer unique name
subregionnameeu-west-2afalseThe SubRegion Name where the Load Balancer will be created
listener``falseThe Listener Spec
healthcheck``falseThe healthcheck Spec

Listener

NameDefaultRequiredDescription
backendport6443falseThe port on which the backend vm will listen
backendprotocolTCPfalseThe protocol (‘HTTP’
loadbalancerport6443falseThe port on which the loadbalancer will listen
loadbalancerprotocolTCPfalsethe routing protocol (‘HTTP’

HealthCheck

NameDefaultRequiredDescription
checkinterval30falsethe time in second between two pings
healthythreshold10falsethe consecutive number of pings which are sucessful to consider the vm healthy
unhealthythreshold5falsethe consecutive number of pings which are failed to consider the vm unhealthy
port6443falsethe HealthCheck port number
protocolTCPfalseThe HealthCheck protocol (‘HTTP’
timeout5falsethe Timeout to consider VM unhealthy

Bastion

NameDefaultRequiredDescription
clusterNamecluster-apifalseThe cluster name
enablefalsefalseEnable to have bastion
namecluster-api-vm-bastionfalseThe name of the bastion
imageNametcpfalsethe omi
keypairNamecluster-apifalseThe keypair name used to access bastion
deviceName/dev/sda1falseThe device name
rootDiskSize15falseThe Root Disk Size
rootDiskIops1000falseThe Root Disk Iops (only for io1)
rootDiskTypeio1falseThe Root Disk Type (io1, gp2, standard)
subnetNamecluster-api-subnet-publicfalseThe Subnet associated to your bastion
subregionNameeu-west-2afalseThe subregionName used for bastion and volume
securityGroupNamescluster-api-securitygroup-lbfalseThe securityGroupName which is associated with bastion
vmTypetinav6.c2r4p2falseThe vmType use for the bastion

Net

NameDefaultRequiredDescription
namecluster-api-netfalsethe tag name associated with the Net
ipRange172.19.95.128/25falseNet Ip range with CIDR notation
clusterNamecluster-apifalseName of the cluster
subregionNameeu-west-2afalseThe subregionName used for vm and volume

controlPlaneSubnets

List of subnet to spread controlPlane nodes

Subnet

NameDefaultRequiredDescription
namecluster-api-subnetfalseThe tag name associated with the Subnet
ipSubnetRange172.19.95.192/27falseSubnet Ip range with CIDR notation

publicIps

NameDefaultRequiredDescription
namecluster-api-publicipfalseThe tag name associated with the Public Ip

internetService

NameDefaultRequiredDescription
namecluster-api-internetservicefalseThe tag name associated with the Internet Service
clusterNamecluster-apifalseName of the cluster

natService

NameDefaultRequiredDescription
namecluster-api-natservicefalseThe tag name associated with the Nat Service
publicIpNamecluster-api-publicipfalseThe Public Ip tag name associated wtih a Public Ip
subnetNamecluster-api-subnetfalseThe subnet tag name associated with a Subnet
clusterNamecluster-apifalseName of the cluster

natServices

List of natServices

You can have either list of natService (natServices) or one natService (natService)

NameDefaultRequiredDescription
namecluster-api-natservicefalseThe tag name associated with the Nat Service
publicIpNamecluster-api-publicipfalseThe Public Ip tag name associated wtih a Public Ip
subnetNamecluster-api-subnetfalseThe subnet tag name associated with a Subnet
clusterNamecluster-apifalseName of the cluster

routeTables

NameDefaultRequiredDescription
namecluster-api-routetablefalseThe tag name associated with the Route Table
subnetNamecluster-api-subnetfalseThe subnet tag name associated with a Subnet
route``falseThe route configuration

route

NameDefaultRequiredDescription
namecluster-api-routefalseThe tag name associated with the Route
targetNamecluster-api-internetservicefalseThe tag name associated with the target resource type
targetTypegatewayfalseThe target resource type which can be Internet Service (gateway) or Nat Service (nat-service)
destination0.0.0.0/0falsethe destination match Ip range with CIDR notation

securityGroup

NameDefaultRequiredDescription
namecluster-api-securitygroupfalseThe tag name associate with the security group
descriptionSecurity Group with cluster-apifalseThe description of the security group
securityGroupRules``falseThe securityGroupRules configuration

securityGroupRule

NameDefaultRequiredDescription
namecluster-api-securitygrouprulefalseThe tag name associate with the security group
flowInboundfalseThe flow of the security group (inbound or outbound)
ipProtocoltcpfalseThe ip protocol name (tcp, udp, icmp or -1)
ipRange46.231.147.5/32falseThe ip range of the security group rule
fromPortRange6443falseThe beginning of the port range
toPortRange6443falseThe end of the port range

machine infrastructure controller OscCluster

example:

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OscMachineTemplate
metadata:
  name: "cluster-api-md-0"
  namespace: default
  annotations:
    cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "5"
    cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "0"
spec:
  template:
    spec:
      node:
        clusterName: cluster-api
        image:
          name: ubuntu-2004-2004-kubernetes-v1.22.11-2022-08-22
        keypair:
          name: cluster-api
        vm:
          clusterName: cluster-api
          name: cluster-api-vm-kw
          keypairName: cluster-api
          deviceName: /dev/sda1
          rootDisk:
            rootDiskSize: 30
            rootDiskIops: 1500
            rootDiskType: io1
          subnetName: cluster-api-subnet-kw
          subregionName: eu-west-2a
          securityGroupNames:
            - name: cluster-api-securitygroups-kw
          vmType: "tinav6.c2r4p2"

OscImage

NameDefaultRequiredDescription
name``falseThe image name you will use

OscKeypair

NameDefaultRequiredDescription
keypairNamecluster-api-keypairfalseThe keypairname you will use
destroyKeypairfalsefalseDestroy keypair at the end

OscVm

NameDefaultRequiredDescription
clusterNamecluster-apifalseThe cluster name
namecluster-api-vm-kwfalseThe name of the vm
keypairNamecluster-apifalseThe keypair name used to access vm
deviceNamecluster-apifalseThe device path to mount root volumes
rootDiskSize30falseThe Root Disk Size
rootDiskIops1500falseThe Root Disk Iops (only for io1)
rootDiskTypeio1falseThe Root Disk Type (io1, gp2, standard)
rootDiskTypeio1falseThe Root Disk Type (io1, gp2, standard)
subnetNamecluster-api-subnet-kwfalseThe Subnet associated to your vm
subregionNameeu-west-2afalseThe subregionName used for vm and volume
securityGroupNamescluster-api-securitygroups-kwfalseThe securityGroupName which is associated with vm
vmTypetinav6.c2r4p2falseThe vmType use for the vm
imageNameubuntu-2004-2004-kubernetes-v1.22.11-2022-08-22falseThe vmType use for the vm