Documentation ¶
Index ¶
- Constants
- Variables
- func AppendLeaseLabels(lid mtypes.LeaseID, labels map[string]string) map[string]string
- func LidNS(lid mtypes.LeaseID) string
- func ValidateSettings(settings Settings) error
- type ClusterDeployment
- type ContextKey
- type Deployment
- type IClusterDeployment
- type Manifest
- type NS
- type NetPol
- type Service
- type ServiceCredentials
- type Settings
- type StatefulSet
- type Workload
Constants ¶
View Source
const ( AkashManagedLabelName = "akash.network" AkashManifestServiceLabelName = "akash.network/manifest-service" AkashNetworkStorageClasses = "akash.network/storageclasses" AkashServiceTarget = "akash.network/service-target" AkashServiceCapabilityGPU = "akash.network/capabilities.gpu" AkashServiceCapabilityStorage = "akash.network/capabilities.storage" AkashMetalLB = "metal-lb" AkashLeaseOwnerLabelName = "akash.network/lease.id.owner" AkashLeaseDSeqLabelName = "akash.network/lease.id.dseq" AkashLeaseGSeqLabelName = "akash.network/lease.id.gseq" AkashLeaseOSeqLabelName = "akash.network/lease.id.oseq" AkashLeaseProviderLabelName = "akash.network/lease.id.provider" AkashLeaseManifestVersion = "akash.network/manifest.version" AkashLeaseUpdatedAt = "akash.network/lease.updated_at" )
View Source
const ( ValTrue = "true" ValFalse = "false" )
View Source
const ( ResourceGPUNvidia = corev1.ResourceName("nvidia.com/gpu") ResourceGPUAMD = corev1.ResourceName("amd.com/gpu") GPUVendorNvidia = "nvidia" GPUVendorAMD = "amd" )
View Source
const SettingsKey = ContextKey("kube-client-settings")
View Source
const SuffixForNodePortServiceName = "-np"
Variables ¶
View Source
var (
ErrKubeBuilder = errors.New("kube-builder")
)
View Source
var ErrSettingsValidation = errors.New("settings validation")
Functions ¶
func AppendLeaseLabels ¶
func ValidateSettings ¶
Types ¶
type ClusterDeployment ¶
type ClusterDeployment struct { Lid mtypes.LeaseID Group *mani.Group Sparams crd.ClusterSettings // contains filtered or unexported fields }
func (*ClusterDeployment) ClusterParams ¶
func (d *ClusterDeployment) ClusterParams() crd.ClusterSettings
func (*ClusterDeployment) LeaseID ¶
func (d *ClusterDeployment) LeaseID() mtypes.LeaseID
func (*ClusterDeployment) ManifestGroup ¶
func (d *ClusterDeployment) ManifestGroup() *mani.Group
func (*ClusterDeployment) UpdateManifest ¶
func (d *ClusterDeployment) UpdateManifest() bool
type ContextKey ¶
type ContextKey string
type Deployment ¶
type Deployment interface { Create() (*appsv1.Deployment, error) Update(obj *appsv1.Deployment) (*appsv1.Deployment, error) // contains filtered or unexported methods }
func NewDeployment ¶
func NewDeployment(workload Workload) Deployment
type IClusterDeployment ¶
type IClusterDeployment interface { LeaseID() mtypes.LeaseID ManifestGroup() *mani.Group UpdateManifest() bool ClusterParams() crd.ClusterSettings }
func ClusterDeploymentFromDeployment ¶
func ClusterDeploymentFromDeployment(d ctypes.IDeployment) (IClusterDeployment, error)
type Manifest ¶
type Manifest interface { Create() (*crd.Manifest, error) Update(obj *crd.Manifest) (*crd.Manifest, error) Name() string // contains filtered or unexported methods }
func BuildManifest ¶
type NS ¶
type NS interface { Create() (*corev1.Namespace, error) Update(obj *corev1.Namespace) (*corev1.Namespace, error) // contains filtered or unexported methods }
func BuildNS ¶
func BuildNS(settings Settings, deployment IClusterDeployment) NS
type NetPol ¶
type NetPol interface { Create() ([]*netv1.NetworkPolicy, error) Update(obj *netv1.NetworkPolicy) (*netv1.NetworkPolicy, error) // contains filtered or unexported methods }
func BuildNetPol ¶
func BuildNetPol(settings Settings, deployment IClusterDeployment) NetPol
type Service ¶
type Service interface { Create() (*corev1.Service, error) Update(obj *corev1.Service) (*corev1.Service, error) Any() bool // contains filtered or unexported methods }
func BuildService ¶
type ServiceCredentials ¶
type ServiceCredentials interface { NS() string Name() string Create() (*corev1.Secret, error) Update(obj *corev1.Secret) (*corev1.Secret, error) }
func NewServiceCredentials ¶
func NewServiceCredentials(ns string, serviceName string, credentials *mani.ServiceImageCredentials) ServiceCredentials
type Settings ¶
type Settings struct { // gcp: NodePort // others: ClusterIP DeploymentServiceType corev1.ServiceType // gcp: false // others: true DeploymentIngressStaticHosts bool // Ingress domain to map deployments to DeploymentIngressDomain string // Return load balancer host in lease status command ? // gcp: true // others: optional DeploymentIngressExposeLBHosts bool // Global hostname for arbitrary ports ClusterPublicHostname string // NetworkPoliciesEnabled determines if NetworkPolicies should be installed. NetworkPoliciesEnabled bool CPUCommitLevel float64 GPUCommitLevel float64 MemoryCommitLevel float64 StorageCommitLevel float64 DeploymentRuntimeClass string // Name of the image pull secret to use in pod spec DockerImagePullSecretsName string }
Settings configures k8s object generation such that it is customized to the cluster environment that is being used. For instance, GCP requires a different service type than minikube.
func NewDefaultSettings ¶
func NewDefaultSettings() Settings
type StatefulSet ¶
type StatefulSet interface { Create() (*appsv1.StatefulSet, error) Update(obj *appsv1.StatefulSet) (*appsv1.StatefulSet, error) // contains filtered or unexported methods }
func BuildStatefulSet ¶
func BuildStatefulSet(workload Workload) StatefulSet
type Workload ¶
type Workload struct {
// contains filtered or unexported fields
}
func NewWorkloadBuilder ¶
Click to show internal directories.
Click to hide internal directories.