Documentation
¶
Index ¶
- Variables
- type AllocationPool
- type Auth
- type Cloud
- type Config
- type Domain
- type ExtensionRepo
- type Flavor
- type Framework
- type Helm
- type HostRoute
- type Image
- type Kubernetes
- type LoadBalancer
- type Machine
- type Mirror
- type Network
- type Networks
- type OciImage
- type Openstack
- type Os
- type Plugins
- type PortRange
- type Project
- type Quantity
- type Rancher
- type Registry
- type Role
- type Router
- type Rule
- type SSH
- type SecurityGroup
- type Spec
- type Subnet
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultSpec = Spec{ Framework: Framework{ Networks: Networks{}, OciImages: []OciImage{}, OsImages: []string{ "manila-service-image", "amphora-x64-haproxy", }, ExtensionRepos: []ExtensionRepo{ { Name: "cube-apps", Tld: "registry.cubecos.com", Username: "admin", Password: "admin", InsecureSkipVerify: true, InsecurePlainHttp: true, }, }, }, Kubernetes: Kubernetes{ Name: "app-framework", Config: "/opt/appfw/kubeconfig", Version: "v1.32.4+rke2r1", Cloud: Cloud{Provider: "openstack"}, Network: Network{Cni: "cilium"}, Master: Machine{ Name: "master", Quantity: 1, Flavor: Flavor{Name: "t2.xlarge"}, }, Worker: Machine{ Name: "worker", Quantity: 3, Flavor: Flavor{Name: "t2.xlarge"}, }, Plugins: Plugins{ Helm: Helm{ Charts: []helm.Chart{ { Type: "kubernetes-interface-driver", Release: "cinder-csi", Version: "2.31.2", Namespace: "kube-system", Tgz: helm.Tgz{ Local: "/opt/appfw/plugins/charts/openstack-cinder-csi-2.31.2.tgz", }, }, { Type: "kubernetes-interface-driver", Release: "manila-csi", Version: "2.31.1", Namespace: "kube-system", Tgz: helm.Tgz{ Local: "/opt/appfw/plugins/charts/openstack-manila-csi-2.31.1.tgz", }, }, { Type: "kubernetes-interface-driver", Release: "csi-driver-nfs", Version: "v4.9.0", Namespace: "kube-system", Tgz: helm.Tgz{ Local: "/opt/appfw/plugins/charts/csi-driver-nfs-v4.9.0.tgz", }, }, { Type: "kubernetes-interface-driver", Release: "openstack-cloud-controller-manager", Version: "1.3.0", Namespace: "kube-system", Tgz: helm.Tgz{ Local: "/opt/appfw/plugins/charts/openstack-cloud-controller-manager-1.3.0.tgz", }, }, }, }, }, Applications: Helm{ Charts: []helm.Chart{ { Release: "harbor", Version: "1.18.0", Namespace: "harbor", Tgz: helm.Tgz{ Local: "/opt/appfw/plugins/charts/harbor-1.18.0.tgz", }, }, { Release: "keycloak", Version: "18.1.1-cube", Namespace: "keycloak", Tgz: helm.Tgz{ Local: "/opt/appfw/plugins/charts/keycloak-18.1.1-cube.tgz", }, }, }, }, Registry: Registry{ Protocol: "http", Port: 5080, Configs: map[string]Config{ "internal-oci-registry": { DomainName: "registry.cubecos.com", Username: "appctl", Registry: rancher.Registry{InsecureSkipVerify: true}, }, }, Mirrors: []Mirror{ {Hostname: "*", To: ""}, {Hostname: "index.docker.io", To: ""}, {Hostname: "docker.io", To: ""}, {Hostname: "registry.k8s.io", To: ""}, {Hostname: "registry-1.docker.io", To: ""}, {Hostname: "quay.io", To: ""}, }, }, }, Openstack: Openstack{ Project: &projects.Project{ Name: "app-framework", DomainID: "default", }, User: User{ Name: "app-framework", Domain: Domain{Name: "default"}, }, Roles: []Role{ {Name: "admin", User: "admin_cli"}, {Name: "admin", User: "admin (IAM)"}, {Name: "_member_", User: "app-framework"}, }, FloatingIpPool: "", EndpointType: "publicURL", Routers: []Router{ { Name: "public", Network: Network{Name: "public"}, AdminStateUp: true, Subnets: []Subnet{ {Name: "private_subnet"}, {Name: "private-k8s_subnet"}, }, }, }, Networks: []Network{ { Name: "private", IpVersion: 4, AdminStateUp: true, Shared: false, Subnets: []Subnet{ { Name: "private_subnet", IpVersion: 4, Cidr: "192.168.0.0/24", GatewayIP: "192.168.0.1", EnableDHCP: true, AllocationPools: []subnets.AllocationPool{ {Start: "192.168.0.2", End: "192.168.0.253"}, }, }, }, }, { Name: "private-k8s", IpVersion: 4, AdminStateUp: true, Shared: false, Subnets: []Subnet{ { Name: "private-k8s_subnet", IpVersion: 4, Cidr: "192.168.1.0/24", GatewayIP: "192.168.1.1", EnableDHCP: true, AllocationPools: []subnets.AllocationPool{ {Start: "192.168.1.2", End: "192.168.1.253"}, }, }, }, }, }, SecurityGroups: []SecurityGroup{ { Name: "default", Rules: []Rule{ { Direction: "egress", Description: "whitelist - openstack metadata server", EtherType: "IPv4", Protocol: "", Cidr: "169.254.169.254", PortRange: PortRange{Min: 0, Max: 0}, }, { Direction: "egress", Description: "whitelist - DNS", EtherType: "IPv4", Protocol: "udp", Cidr: "0.0.0.0/0", PortRange: PortRange{Min: 53, Max: 53}, }, { Direction: "egress", Description: "whitelist - DHCP", EtherType: "IPv4", Protocol: "udp", Cidr: "0.0.0.0/0", PortRange: PortRange{Min: 67, Max: 67}, }, }, }, { Name: "default-k8s", Rules: []Rule{ { Direction: "egress", EtherType: "IPv4", Protocol: "tcp", CidrSource: "vip", PortRange: PortRange{Min: 5000, Max: 5000}, }, { Direction: "egress", EtherType: "IPv4", Protocol: "tcp", CidrSource: "vip", PortRange: PortRange{Min: 8774, Max: 8774}, }, { Direction: "egress", EtherType: "IPv4", Protocol: "tcp", CidrSource: "vip", PortRange: PortRange{Min: 8776, Max: 8776}, }, { Direction: "egress", EtherType: "IPv4", Protocol: "tcp", CidrSource: "vip", PortRange: PortRange{Min: 8786, Max: 8786}, }, { Direction: "egress", EtherType: "IPv4", Protocol: "tcp", CidrSource: "vip", PortRange: PortRange{Min: 9696, Max: 9696}, }, { Direction: "egress", EtherType: "IPv4", Protocol: "tcp", CidrSource: "vip", PortRange: PortRange{Min: 9876, Max: 9876}, }, { Direction: "egress", EtherType: "IPv4", Protocol: "tcp", CidrSource: "vip", PortRange: PortRange{Min: 10443, Max: 10443}, }, { Direction: "egress", EtherType: "IPv4", Protocol: "", Cidr: "0.0.0.0/0", PortRange: PortRange{Min: 0, Max: 0}, }, { Direction: "egress", EtherType: "IPv6", Protocol: "", Cidr: "::/0", PortRange: PortRange{Min: 0, Max: 0}, }, { Direction: "ingress", EtherType: "IPv4", Protocol: "", CidrSource: "management", PortRange: PortRange{Min: 0, Max: 0}, }, { Direction: "ingress", EtherType: "IPv4", Protocol: "tcp", Cidr: "0.0.0.0/0", PortRange: PortRange{Min: 22, Max: 22}, }, { Direction: "ingress", EtherType: "IPv4", Protocol: "tcp", Cidr: "0.0.0.0/0", PortRange: PortRange{Min: 80, Max: 80}, }, { Direction: "ingress", EtherType: "IPv4", Protocol: "tcp", Cidr: "0.0.0.0/0", PortRange: PortRange{Min: 443, Max: 443}, }, { Direction: "ingress", EtherType: "IPv4", Protocol: "tcp", Cidr: "0.0.0.0/0", PortRange: PortRange{Min: 2376, Max: 2376}, }, { Direction: "ingress", EtherType: "IPv4", Protocol: "tcp", Cidr: "0.0.0.0/0", PortRange: PortRange{Min: 6443, Max: 6443}, }, { Direction: "ingress", EtherType: "IPv4", Protocol: "tcp", Cidr: "0.0.0.0/0", PortRange: PortRange{Min: 30000, Max: 32767}, }, { Direction: "ingress", EtherType: "IPv4", Protocol: "udp", Cidr: "0.0.0.0/0", PortRange: PortRange{Min: 30000, Max: 32767}, }, }, }, }, Flavor: Flavor{Name: "storage.xlarge"}, SSH: SSH{ User: "ubuntu", Port: 22, }, Image: Image{Name: "rancher-cluster-image-rke2-v1.32.4"}, }, } )
Functions ¶
This section is empty.
Types ¶
type AllocationPool ¶
type Cloud ¶
type Cloud struct {
Provider string `json:"provider"`
Credential *rancher.CloudCredential `json:"credential"`
}
type ExtensionRepo ¶
type ExtensionRepo struct {
Name string `json:"name"`
Tld string `json:"tld"`
HttpUrl string `json:"httpUrl"`
OciUrl string `json:"ociUrl"`
DomainName string `json:"domainName"`
Username string `json:"username"`
Password string `json:"password"`
InsecurePlainHttp bool `json:"insecurePlainHttp"`
InsecureSkipVerify bool `json:"insecureSkipVerify"`
}
type Framework ¶
type Framework struct {
Name string `json:"name"`
KubernetesVersion string `json:"kubernetesVersion"`
Networks `json:"network"`
Os `json:"os"`
Quantity `json:"replicas"`
OsImages []string `json:"osImages"`
OciImages []OciImage `json:"ociImages"`
ExtensionRepos []ExtensionRepo `json:"extensionRepos"`
Plugins `json:"plugins"`
}
func (*Framework) IsPublicNetAndManagementNetSame ¶
type Kubernetes ¶
type Kubernetes struct {
Version string `json:"version"`
Id string `json:"id"`
Name string `json:"name"`
Cloud `json:"cloud"`
Network `json:"network"`
Master Machine `json:"master"`
Worker Machine `json:"worker"`
Plugins `json:"plugins"`
Applications Helm `json:"applications"`
Registry `json:"registry"`
Config string `json:"config"`
}
type LoadBalancer ¶
type LoadBalancer struct {
Ip string `json:"ip"`
}
type Networks ¶
type Networks struct {
Public string `json:"public"`
Management string `json:"management"`
HostRoute `json:"hostRoute"`
LoadBalancer `json:"loadBalancer"`
}
type Openstack ¶
type Openstack struct {
Auth `json:"auth"`
Project *projects.Project `json:"project"`
User `json:"user"`
Roles []Role `json:"roles"`
Routers []Router `json:"routers"`
Networks []Network `json:"networks"`
FloatingIpPool string `json:"floatingIpPool"`
EndpointType string `json:"endpointType"`
SecurityGroups []SecurityGroup `json:"securityGroups"`
Flavor `json:"flavor"`
Image `json:"image"`
SSH `json:"ssh"`
}
type Rule ¶
type Rule struct {
Description string `json:"description"`
Direction rules.RuleDirection `json:"direction"`
Protocol rules.RuleProtocol `json:"protocol"`
EtherType rules.RuleEtherType `json:"etherType"`
Cidr string `json:"cidr"`
CidrSource string `json:"cidrSource"`
PortRange `json:"portRange"`
}
type SecurityGroup ¶
type Spec ¶
type Spec struct {
Framework `json:"framework"`
Openstack `json:"openstack"`
Rancher `json:"rancher"`
Kubernetes `json:"kubernetes"`
}
type Subnet ¶
type Subnet struct {
ID string `json:"id"`
Name string `json:"name"`
IpVersion gophercloud.IPVersion `json:"ipVersion"`
Cidr string `json:"cidr"`
GatewayIP string `json:"gatewayIp"`
EnableDHCP bool `json:"enableDhcp"`
AllocationPools []subnets.AllocationPool `json:"allocationPools"`
HostRoutes []subnets.HostRoute `json:"hostRoutes"`
PortIp string `json:"portIp"`
}
Click to show internal directories.
Click to hide internal directories.