Documentation ¶
Index ¶
- Constants
- Variables
- func CompileEnvironmentVariables(allEnv []corev1.EnvVar, operatorEnv map[string]string) []corev1.EnvVar
- func ConfigMapName(trench *meridiov1.Trench) string
- func FEServiceAccountName() string
- func GetContainerResourceRequirements(containerName, templateName string) (*corev1.ResourceRequirements, error)
- func GetDaemonsetModel(f string) (*appsv1.DaemonSet, error)
- func GetDeploymentModel(f string) (*appsv1.Deployment, error)
- func GetGRPCProbeRPCTimeout() string
- func GetIPFamily(cr *meridiov1.Trench) string
- func GetImagePullSecrets() []corev1.LocalObjectReference
- func GetLoadBalancerSysCtl(cr *meridiov1.Trench) string
- func GetLogLevel() string
- func GetNSMRegistryService() string
- func GetPodDisruptionBudgetModel(f string) (*policyv1.PodDisruptionBudget, error)
- func GetPodDisruptionBudgetVersion(client client.Client) (string, error)
- func GetPrefixedName(resourceName string) string
- func GetProbe(timer probeTimer, command []string) *corev1.Probe
- func GetProbeCommand(spiffe bool, addr, svc string) []string
- func GetProxySysCtl(cr *meridiov1.Trench) string
- func GetResourceRequirementAnnotation(from *metav1.ObjectMeta) (string, bool)
- func GetRoleBindingModel(f string) (*rbacv1.RoleBinding, error)
- func GetRoleModel(f string) (*rbacv1.Role, error)
- func GetServiceAccountModel(f string) (*corev1.ServiceAccount, error)
- func GetServiceModel(f string) (*corev1.Service, error)
- func GetStatefulSetModel(f string) (*appsv1.StatefulSet, error)
- func GetSuffixedName(resourceName, suffix string) string
- func GetTrenchBySelector(e *Executor, selector client.ObjectKey) (*meridiov1.Trench, error)
- func IPAMServiceName(trench *meridiov1.Trench) string
- func IPAMServiceWithPort(cr *meridiov1.Trench) string
- func IPAMStatefulSetName(trench *meridiov1.Trench) string
- func LbFeDeploymentName(attractor *meridiov1.Attractor) string
- func LoadBalancerNsName(conduit, trench, namespace string) string
- func MakeNetworkAttachmentSpecMap(list []*NetworkAttachmentSelector) map[NetworkAttachmentSelector]*NetworkAttachmentSelector
- func NSEDeploymentName(attractor *meridiov1.Attractor) string
- func NSPServiceAccountName() string
- func NSPServiceName(trench *meridiov1.Trench) string
- func NSPServiceWithPort(cr *meridiov1.Trench) string
- func NSPStatefulSetName(trench *meridiov1.Trench) string
- func NsName(meta metav1.ObjectMeta) string
- func PDBName(attractir *meridiov1.Attractor) string
- func PdbV1Beta1ToV1(pdb *policyv1beta1.PodDisruptionBudget) *policyv1.PodDisruptionBudget
- func PdbV1ToV1Beta1(pdb *policyv1.PodDisruptionBudget) *policyv1beta1.PodDisruptionBudget
- func ProxyDeploymentName(conduit *meridiov1.Conduit) string
- func ProxyNtwkSvcNsName(cr *meridiov1.Conduit) string
- func SetContainerResourceRequirements(from *metav1.ObjectMeta, container *corev1.Container) error
- func SetResourceRequirementAnnotation(from *metav1.ObjectMeta, into *metav1.ObjectMeta)
- func VlanNtwkSvcName(attractorCr *meridiov1.Attractor, trenchCr *meridiov1.Trench) string
- type Action
- type Executions
- type Executor
- func (e *Executor) AddCreateAction(obj client.Object)
- func (e *Executor) AddUpdateAction(obj client.Object)
- func (e *Executor) AddUpdateStatusAction(obj client.Object)
- func (e *Executor) GetObject(selector client.ObjectKey, obj client.Object) error
- func (e *Executor) GetOwner() client.Object
- func (e *Executor) ListObject(obj client.ObjectList, opts ...client.ListOption) error
- func (e *Executor) LogError(err error, msg string)
- func (e *Executor) LogInfo(msg string)
- func (e *Executor) RunActions() error
- func (e *Executor) SetControllerReference(obj client.Object) error
- func (e *Executor) SetOwner(cr client.Object)
- func (e *Executor) SetOwnerReference(obj client.Object, owners ...client.Object) error
- type NamedResourceRequirements
- type NetworkAttachmentSelector
- type ResourceRequirementTemplates
Constants ¶
const ( ResourceNamePrefixEnv = "RESOURCE_NAME_PREFIX" ImagePullSecretEnv = "IMAGE_PULL_SECRET" NSMRegistryServiceEnv = "NSM_REGISTRY_SERVICE" LogLevelEnv = "LOG_LEVEL" NspServiceAccountEnv = "NSP_SERVICE_ACCOUNT" FeServiceAccountEnv = "FE_SERVICE_ACCOUNT" GRPCHealthRPCTimeoutEnv = "GRPC_PROBE_RPC_TIMEOUT" // RPC timeout of grpc_health_probes run from code Registry = "registry.nordix.org" Organization = "cloud-native/meridio" OrganizationNsm = "cloud-native/nsm" Tag = "latest" BusyboxImage = "busybox" BusyboxTag = "1.29" SubnetPoolIpv4 = "172.16.0.0/16" SubnetPoolIpv6 = "fd00::/48" ConduitPrefixLengthIpv4 = "20" ConduitPrefixLengthIpv6 = "56" NodePrefixLengthIpv4 = "24" NodePrefixLengthIpv6 = "64" NspPort = 7778 NspTargetPort = 7778 IpamPort = 7777 IpamTargetPort = 7777 VlanNsePort = 5003 IpamSvcName = "ipam-service" NspSvcName = "nsp-service" PodDisruptionBudgetName = "pdb" LBName = "stateless-lb-frontend" ProxyName = "proxy" IpamName = "ipam" NseName = "nse-vlan" NspName = "nsp" NspServiceAccountName = "meridio-sa" CMName = "meridio-configuration" NetworkServiceName = "external-vlan" ResourceRequirementKey = "resource-template" ResourceRequirementTemplatePath = "template/resource" )
const (
NetworkAttachmentAnnot = "k8s.v1.cni.cncf.io/networks"
)
Variables ¶
var ( LivenessTimer = probeTimer{ // contains filtered or unexported fields } ReadinessTimer = probeTimer{ // contains filtered or unexported fields } StartUpTimer = probeTimer{ // contains filtered or unexported fields } )
Functions ¶
func ConfigMapName ¶
func FEServiceAccountName ¶
func FEServiceAccountName() string
func GetContainerResourceRequirements ¶
func GetContainerResourceRequirements(containerName, templateName string) (*corev1.ResourceRequirements, error)
GetContainerResourceRequirements - Reads and searches template resource requirements for container. (A template resource requirement with param 'templateName' must exist for a match)
func GetDeploymentModel ¶
func GetDeploymentModel(f string) (*appsv1.Deployment, error)
func GetGRPCProbeRPCTimeout ¶ added in v1.0.6
func GetGRPCProbeRPCTimeout() string
func GetIPFamily ¶
func GetImagePullSecrets ¶
func GetImagePullSecrets() []corev1.LocalObjectReference
func GetLoadBalancerSysCtl ¶
func GetLogLevel ¶
func GetLogLevel() string
func GetNSMRegistryService ¶
func GetNSMRegistryService() string
func GetPodDisruptionBudgetModel ¶
func GetPodDisruptionBudgetModel(f string) (*policyv1.PodDisruptionBudget, error)
func GetPrefixedName ¶
func GetProbeCommand ¶
func GetProxySysCtl ¶
func GetResourceRequirementAnnotation ¶
func GetResourceRequirementAnnotation(from *metav1.ObjectMeta) (string, bool)
GetResourceRequirementAnnotation - Gets ResourceRequirementKey annotation based on param 'from'
func GetRoleBindingModel ¶
func GetRoleBindingModel(f string) (*rbacv1.RoleBinding, error)
func GetServiceAccountModel ¶
func GetServiceAccountModel(f string) (*corev1.ServiceAccount, error)
func GetStatefulSetModel ¶
func GetStatefulSetModel(f string) (*appsv1.StatefulSet, error)
func GetSuffixedName ¶
func GetTrenchBySelector ¶
func IPAMServiceName ¶
func IPAMServiceWithPort ¶
func IPAMStatefulSetName ¶
func LbFeDeploymentName ¶
func LoadBalancerNsName ¶
func MakeNetworkAttachmentSpecMap ¶ added in v1.0.0
func MakeNetworkAttachmentSpecMap(list []*NetworkAttachmentSelector) map[NetworkAttachmentSelector]*NetworkAttachmentSelector
MakeNetworkAttachmentSpecMap - Creates a map from list of NetworkAttachmentSelectors.
func NSEDeploymentName ¶
func NSPServiceAccountName ¶
func NSPServiceAccountName() string
func NSPServiceName ¶
func NSPServiceWithPort ¶
func NSPStatefulSetName ¶
func NsName ¶
func NsName(meta metav1.ObjectMeta) string
func PdbV1Beta1ToV1 ¶
func PdbV1Beta1ToV1(pdb *policyv1beta1.PodDisruptionBudget) *policyv1.PodDisruptionBudget
func PdbV1ToV1Beta1 ¶
func PdbV1ToV1Beta1(pdb *policyv1.PodDisruptionBudget) *policyv1beta1.PodDisruptionBudget
func ProxyDeploymentName ¶
func ProxyNtwkSvcNsName ¶
func SetContainerResourceRequirements ¶
func SetContainerResourceRequirements(from *metav1.ObjectMeta, container *corev1.Container) error
SetContainerResourceRequirements - Finds and sets resource requirements for container.
func SetResourceRequirementAnnotation ¶
func SetResourceRequirementAnnotation(from *metav1.ObjectMeta, into *metav1.ObjectMeta)
SetResourceRequirementAnnotation - Sets ResourceRequirementKey annotation based on param 'from'.
Types ¶
type Action ¶
func AppendActions ¶
type Executions ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
func (*Executor) AddCreateAction ¶
func (*Executor) AddUpdateAction ¶
func (*Executor) AddUpdateStatusAction ¶
func (*Executor) ListObject ¶
func (e *Executor) ListObject(obj client.ObjectList, opts ...client.ListOption) error
func (*Executor) RunActions ¶
func (*Executor) SetControllerReference ¶
type NamedResourceRequirements ¶
type NamedResourceRequirements struct { Name string `json:"name" protobuf:"bytes,1,opt,name=name"` Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,2,opt,name=resources"` }
type NetworkAttachmentSelector ¶ added in v1.0.0
type NetworkAttachmentSelector struct { Name string `json:"name,omitempty"` Namespace string `json:"namespace,omitempty"` InterfaceRequest string `json:"interface,omitempty"` }
NetworkAttachmentSelector - Represents a selector for a json formattad Network Attachment Annotation. (Not using meridiov1alpha1 NetworkAttachmentSpec to keep compatibility even if the meridio API gets extended/changed in the future.)
If required, can be replaced with e.g. 3rd party NetworkSelectionElement: https://github.com/k8snetworkplumbingwg/network-attachment-definition-client/blob/master/pkg/apis/k8s.cni.cncf.io/v1/types.go#L135
func GetNetworkAnnotation ¶ added in v1.0.0
func GetNetworkAnnotation(networks, defaultNamespace string) ([]*NetworkAttachmentSelector, error)
GetNetworkAnnotation - Parses k8s.v1.cni.cncf.io/networks annotations, and fills in the namespace information if missing with defaultNamespace. Understands both json and <namespace>/<network name>@<ifname> format.
type ResourceRequirementTemplates ¶
type ResourceRequirementTemplates struct {
Templates []NamedResourceRequirements `json:"templates,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,1,rep,name=templates"`
}
ResourceRequirementTemplates - Describes the data layout of a resource requirement template file