configs

package
v0.0.0-...-b286d24 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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 AllocationPool struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

type Auth

type Auth struct {
	Type     string `json:"type"`
	Url      string `json:"url"`
	Username string `json:"username"`
	Password string `json:"password"`
	Token    string `json:"token"`
	Project  `json:"project"`
}

type Cloud

type Cloud struct {
	Provider   string                   `json:"provider"`
	Credential *rancher.CloudCredential `json:"credential"`
}

type Config

type Config struct {
	DomainName       string `json:"domainName"`
	Username         string `json:"username"`
	Password         string `json:"password"`
	rancher.Registry `json:"registry"`
	FloatingIp       string `json:"floatingIp"`
}

type Domain

type Domain struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

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 Flavor

type Flavor struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	VCPUs   int    `json:"vcpus"`
	RamMiB  int    `json:"ramMiB"`
	DiskGiB int    `json:"diskGiB"`
}

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

func (f *Framework) IsPublicNetAndManagementNetSame() bool

type Helm

type Helm struct {
	Charts []helm.Chart `json:"charts"`
}

type HostRoute

type HostRoute struct {
	GatewayIp string `json:"gatewayIp"`
	Cidr      string `json:"cidr"`
}

type Image

type Image struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

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 Machine

type Machine struct {
	Name     string `json:"name"`
	Quantity int    `json:"quantity"`
	Flavor   `json:"flavor"`
}

type Mirror

type Mirror struct {
	Hostname string `json:"hostname"`
	To       string `json:"to"`
}

type Network

type Network struct {
	ID           string   `json:"id"`
	Name         string   `json:"name"`
	Cni          string   `json:"cni"`
	IpVersion    int      `json:"ipVersion"`
	Subnets      []Subnet `json:"subnets"`
	AdminStateUp bool     `json:"adminStateUp"`
	Shared       bool     `json:"shared"`
}

type Networks

type Networks struct {
	Public       string `json:"public"`
	Management   string `json:"management"`
	HostRoute    `json:"hostRoute"`
	LoadBalancer `json:"loadBalancer"`
}

type OciImage

type OciImage struct {
	Space string `json:"space"`
	Name  string `json:"name"`
	Tag   string `json:"tag"`
}

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 Os

type Os struct {
	Image  string `json:"image"`
	Flavor string `json:"flavor"`
}

type Plugins

type Plugins struct {
	Helm        `json:"helm"`
	Crds        []string `json:"crds"`
	Controllers []string `json:"controllers"`
}

type PortRange

type PortRange struct {
	Min int `json:"min"`
	Max int `json:"max"`
}

type Project

type Project struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Domain `json:"domain"`
}

type Quantity

type Quantity struct {
	Master int `json:"master"`
	Worker int `json:"worker"`
}

type Rancher

type Rancher struct {
	Url  string `json:"url"`
	Auth `json:"auth"`
}

type Registry

type Registry struct {
	Protocol string            `json:"protocol"`
	Port     int               `json:"defaultPort"`
	Configs  map[string]Config `json:"configs"`
	Mirrors  []Mirror          `json:"mirrors"`
}

type Role

type Role struct {
	Name string `json:"name"`
	User string `json:"user"`
}

type Router

type Router struct {
	Name         string `json:"name"`
	Network      `json:"network"`
	Subnets      []Subnet `json:"subnets"`
	AdminStateUp bool     `json:"adminStateUp"`
}

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 SSH

type SSH struct {
	User string `json:"user"`
	Port int    `json:"port"`
}

type SecurityGroup

type SecurityGroup struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Rules []Rule `json:"rules"`
}

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"`
}

type User

type User struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Password string `json:"password"`
	Domain   `json:"domain"`
}

Jump to

Keyboard shortcuts

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