types

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSStateVm added in v1.1.4

type AWSStateVm struct {
	Vpc                  string `json:"vpc"`
	HostName             string `json:"name"`
	DiskSize             string `json:"disk_size"`
	InstanceType         string `json:"instance_type"`
	InstanceID           string `json:"instance_id"`
	Subnet               string `json:"subnet"`
	NetworkSecurityGroup string `json:"network_security_group"`
	PublicIP             string `json:"public_ip"`
	PrivateIP            string `json:"private_ip"`
	NetworkInterfaceId   string `json:"network_interface_id"`
}

type AWSStateVms added in v1.1.4

type AWSStateVms struct {
	HostNames            []string `json:"names"`
	DiskNames            []string `json:"disk_name"`
	InstanceIds          []string `json:"instance_id"`
	PrivateIPs           []string `json:"private_ip"`
	PublicIPs            []string `json:"public_ip"`
	NetworkInterfaceIDs  []string `json:"network_interface_id"`
	SubnetNames          []string `json:"subnet_name"`
	SubnetIDs            []string `json:"subnet_id"`
	NetworkSecurityGroup string   `json:"network_security_group"`
}

type AzureStateVM

type AzureStateVM struct {
	Name                     string `json:"name" bson:"name"`
	NetworkSecurityGroupName string `json:"network_security_group_name" bson:"network_security_group_name"`
	NetworkSecurityGroupID   string `json:"network_security_group_id" bson:"network_security_group_id"`
	DiskName                 string `json:"disk_name" bson:"disk_name"`
	PublicIPName             string `json:"public_ip_name" bson:"public_ip_name"`
	PublicIPID               string `json:"public_ip_id" bson:"public_ip_id"`
	NetworkInterfaceName     string `json:"network_interface_name" bson:"network_interface_name"`
	NetworkInterfaceID       string `json:"network_interface_id" bson:"network_interface_id"`
	PrivateIP                string `json:"private_ip" bson:"private_ip"`
	PublicIP                 string `json:"public_ip" bson:"public_ip"`
	HostName                 string `json:"hostname" bson:"hostname"`
}

type AzureStateVMs

type AzureStateVMs struct {
	Names                    []string `json:"names" bson:"names"`
	NetworkSecurityGroupName string   `json:"network_security_group_name" bson:"network_security_group_name"`
	NetworkSecurityGroupID   string   `json:"network_security_group_id" bson:"network_security_group_id"`
	DiskNames                []string `json:"disk_names" bson:"disk_names"`
	PublicIPNames            []string `json:"public_ip_names" bson:"public_ip_names"`
	PublicIPIDs              []string `json:"public_ip_ids" bson:"public_ip_ids"`
	PrivateIPs               []string `json:"private_ips" bson:"private_ips"`
	PublicIPs                []string `json:"public_ips" bson:"public_ips"`
	NetworkInterfaceNames    []string `json:"network_interface_names" bson:"network_interface_names"`
	NetworkInterfaceIDs      []string `json:"network_interface_ids" bson:"network_interface_ids"`
	Hostnames                []string `json:"hostnames" bson:"hostnames"`
}

type BaseInfra

type BaseInfra struct {
	IsCompleted bool `json:"status" bson:"status"`

	SSHID      string `json:"ssh_id" bson:"ssh_id"`
	SSHUser    string `json:"ssh_usr" bson:"ssh_usr"`
	SSHKeyName string `json:"sshkey_name" bson:"sshkey_name"`

	KubernetesDistro string `json:"k8s_distro" bson:"k8s_distro"`
	KubernetesVer    string `json:"k8s_version" bson:"k8s_version"`
}

type BaseK8sBootstrap

type BaseK8sBootstrap struct {
	KubernetesDistro string        `json:"k8s_distro" bson:"k8s_distro"`
	KubernetesVer    string        `json:"k8s_version" bson:"k8s_version"`
	SSHInfo          cloud.SSHInfo `json:"cloud_ssh_info" bson:"cloud_ssh_info"`
	PublicIPs        Instances     `json:"cloud_public_ips" bson:"cloud_public_ips"`
	PrivateIPs       Instances     `json:"cloud_private_ips" bson:"cloud_private_ips"`

	CACert   string `json:"ca_cert" bson:"ca_cert"`
	EtcdCert string `json:"etcd_cert" bson:"etcd_cert"`
	EtcdKey  string `json:"etcd_key" bson:"etcd_key"`
}

type CivoStateVM

type CivoStateVM struct {
	VMID      string `json:"vm_id" bson:"vm_id"`
	PrivateIP string `json:"private_ip" bson:"private_ip"`
	PublicIP  string `json:"public_ip" bson:"public_ip"`
	HostName  string `json:"hostname" bson:"hostname"`
}

type CivoStateVMs

type CivoStateVMs struct {
	VMIDs      []string `json:"vm_ids" bson:"vm_ids"`
	PrivateIPs []string `json:"private_ips" bson:"private_ips"`
	PublicIPs  []string `json:"public_ips" bson:"public_ips"`
	Hostnames  []string `json:"hostnames" bson:"hostnames"`
}

type CredentialsAws added in v1.1.4

type CredentialsAws struct {
	AcessKeyID     string
	AcessKeySecret string
}

type CredentialsAzure

type CredentialsAzure struct {
	SubscriptionID string `json:"subscription_id" bson:"subscription_id"`
	TenantID       string `json:"tenant_id" bson:"tenant_id"`
	ClientID       string `json:"client_id" bson:"client_id"`
	ClientSecret   string `json:"client_secret" bson:"client_secret"`
}

type CredentialsCivo

type CredentialsCivo struct {
	Token string `json:"token" bson:"token"`
}

type CredentialsDocument

type CredentialsDocument struct {
	ID            primitive.ObjectID `bson:"_id,omitempty"`
	Aws           *CredentialsAws    `json:"aws,omitempty" bson:"aws,omitempty"`
	Azure         *CredentialsAzure  `json:"azure,omitempty" bson:"azure,omitempty"`
	Civo          *CredentialsCivo   `json:"civo,omitempty" bson:"civo,omitempty"`
	InfraProvider consts.KsctlCloud  `json:"cloud_provider" bson:"cloud_provider"`
}

CredentialsDocument object which stores the credentials for each provider

type InfrastructureState

type InfrastructureState struct {
	Aws   *StateConfigurationAws   `json:"aws,omitempty" bson:"aws,omitempty"`
	Azure *StateConfigurationAzure `json:"azure,omitempty" bson:"azure,omitempty"`
	Civo  *StateConfigurationCivo  `json:"civo,omitempty" bson:"civo,omitempty"`
	Local *StateConfigurationLocal `json:"local,omitempty" bson:"local,omitempty"`
}

type Instances

type Instances struct {
	ControlPlanes []string `json:"controlplanes" bson:"controlplanes"`
	WorkerPlanes  []string `json:"workerplanes" bson:"workerplanes"`
	DataStores    []string `json:"datastores" bson:"datastores"`
	LoadBalancer  string   `json:"loadbalancer" bson:"loadbalancer"`
}

Instances specific to each infrastructure like civo or azure

type KubernetesBootstrapState

type KubernetesBootstrapState struct {
	B       BaseK8sBootstrap           `json:"b" bson:"b"`
	K3s     *StateConfigurationK3s     `json:"k3s,omitempty" bson:"k3s,omitempty"`
	Kubeadm *StateConfigurationKubeadm `json:"kubeadm,omitempty" bson:"kubeadm,omitempty"`
}

type SSHKeyPairState

type SSHKeyPairState struct {
	PublicKey  string `json:"public_key" bson:"public_key"`
	PrivateKey string `json:"private_key" bson:"private_key"`
}

type StateConfigurationAws added in v1.1.4

type StateConfigurationAws struct {
	B BaseInfra `json:"b" bson:"b"`

	IsCompleted bool
	ClusterName string `json:"cluster_name"`
	Region      string `json:"region"`
	VpcName     string `json:"vpc"`
	VpcId       string `json:"vpc_id"`

	ManagedClusterName string `json:"managed_cluster_name"`
	NoManagedNodes     int    `json:"no_managed_nodes"`
	SubnetName         string `json:"subnet_name"`
	SubnetID           string `json:"subnet_id"`
	NetworkAclID       string `json:"network_acl_id"`

	GatewayID    string `json:"gateway_id"`
	RouteTableID string `json:"route_table_id"`

	InfoControlPlanes AWSStateVms `json:"info_control_planes"`
	InfoWorkerPlanes  AWSStateVms `json:"info_worker_planes"`
	InfoDatabase      AWSStateVms `json:"info_database"`
	InfoLoadBalancer  AWSStateVm  `json:"info_load_balancer"`

	KubernetesDistro string `json:"k8s_distro"`
	KubernetesVer    string `json:"k8s_version"`
}

type StateConfigurationAzure

type StateConfigurationAzure struct {
	B BaseInfra `json:"b" bson:"b"`

	ResourceGroupName string `json:"resource_group_name" bson:"resource_group_name"`

	ManagedClusterName string `json:"managed_cluster_name" bson:"managed_cluster_name"`
	NoManagedNodes     int    `json:"no_managed_cluster_nodes" bson:"no_managed_cluster_nodes"`

	SubnetName         string        `json:"subnet_name" bson:"subnet_name"`
	SubnetID           string        `json:"subnet_id" bson:"subnet_id"`
	VirtualNetworkName string        `json:"virtual_network_name" bson:"virtual_network_name"`
	VirtualNetworkID   string        `json:"virtual_network_id" bson:"virtual_network_id"`
	InfoControlPlanes  AzureStateVMs `json:"info_control_planes" bson:"info_control_planes"`
	InfoWorkerPlanes   AzureStateVMs `json:"info_worker_planes" bson:"info_worker_planes"`
	InfoDatabase       AzureStateVMs `json:"info_database" bson:"info_database"`
	InfoLoadBalancer   AzureStateVM  `json:"info_load_balancer" bson:"info_load_balancer"`
}

type StateConfigurationCivo

type StateConfigurationCivo struct {
	B BaseInfra `json:"b" bson:"b"`

	ManagedClusterID string `json:"managed_cluster_id" bson:"managed_cluster_id"`
	NoManagedNodes   int    `json:"no_managed_cluster_nodes" bson:"no_managed_cluster_nodes"`

	FirewallIDControlPlanes string `json:"fwidcontrolplanenode" bson:"fwidcontrolplanenode"`
	FirewallIDWorkerNodes   string `json:"fwidworkernode" bson:"fwidworkernode"`
	FirewallIDLoadBalancer  string `json:"fwidloadbalancenode" bson:"fwidloadbalancenode"`
	FirewallIDDatabaseNodes string `json:"fwiddatabasenode" bson:"fwiddatabasenode"`
	NetworkID               string `json:"clusternetworkid" bson:"clusternetworkid"`

	InfoControlPlanes CivoStateVMs `json:"info_control_planes" bson:"info_control_planes"`
	InfoWorkerPlanes  CivoStateVMs `json:"info_worker_planes" bson:"info_worker_planes"`
	InfoDatabase      CivoStateVMs `json:"info_database" bson:"info_database"`
	InfoLoadBalancer  CivoStateVM  `json:"info_load_balancer" bson:"info_load_balancer"`
}

type StateConfigurationK3s

type StateConfigurationK3s struct {
	K3sToken string `json:"k3s_token" bson:"k3s_token"`
}

type StateConfigurationKubeadm

type StateConfigurationKubeadm struct {
	// CertificateKey is only valid till 24 hours
	CertificateKey string `json:"certificate_key" bson:"certificate_key"`

	// BootstrapToken cryptographic random string
	BootstrapToken string `json:"bootstrap_token" bson:"bootstrap_token"`

	DiscoveryTokenCACertHash string `json:"discorvery_token_ca_cert_hash" bson:"discorvery_token_ca_cert_hash"`
}

type StateConfigurationLocal

type StateConfigurationLocal struct {
	B     BaseInfra `json:"b" bson:"b"`
	Nodes int       `json:"nodes" bson:"nodes"`
}

type StorageDocument

type StorageDocument struct {
	ID primitive.ObjectID `bson:"_id,omitempty"`

	ClusterType string `json:"cluster_type" bson:"cluster_type" `
	Region      string `json:"region" bson:"region"`
	ClusterName string `json:"cluster_name" bson:"cluster_name"`

	InfraProvider     consts.KsctlCloud      `json:"cloud_provider" bson:"cloud_provider"`
	BootstrapProvider consts.KsctlKubernetes `json:"bootstrap_provider" bson:"bootstrap_provider"`

	CloudInfra        *InfrastructureState      `json:"cloud_infrastructure_state" bson:"cloud_infrastructure_state,omitempty"`
	K8sBootstrap      *KubernetesBootstrapState `json:"kubernetes_bootstrap_state" bson:"kubernetes_bootstrap_state,omitempty"`
	ClusterKubeConfig string                    `json:"cluster_kubeconfig" bson:"cluster_kubeconfig"`

	SSHKeyPair SSHKeyPairState `json:"ssh_key_pair" bson:"ssh_key_pair"`
}

StorageDocument object which stores the state of infra and bootstrap in a doc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL