constant

package

Documentation

Overview

* Tencent is pleased to support the open source community by making TKEStack available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use * this file except in compliance with the License. You may obtain a copy of the * License at * * https://opensource.org/licenses/Apache-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.

* Tencent is pleased to support the open source community by making TKEStack available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use * this file except in compliance with the License. You may obtain a copy of the * License at * * https://opensource.org/licenses/Apache-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// cni args in pod's annotation
	ExtendedCNIArgsAnnotation = "k8s.v1.cni.galaxy.io/args"

	MultusCNIAnnotation = "k8s.v1.cni.cncf.io/networks"

	// For fip crd object which has this label, it's reserved by admin manually. IPAM will not allocate it to pods.
	ReserveFIPLabel = "reserved"

	IPInfosKey = "ipinfos"
)
View Source
const (
	ReleasePolicyAnnotation = "k8s.v1.cni.galaxy.io/release-policy"
	Immutable               = "immutable" // Release IP Only when deleting or scale down App
	Never                   = "never"     // Never Release IP
)
View Source
const (
	ResourceKind = "FloatingIP"
	ApiVersion   = "galaxy.k8s.io/v1alpha1"
	NameSpace    = "floating-ip"
)
View Source
const (
	IPPoolAnnotation = "tke.cloud.tencent.com/eni-ip-pool"
	ResourceName     = "tke.cloud.tencent.com/eni-ip"
)

Variables

This section is empty.

Functions

func GetPool

func GetPool(annotations map[string]string) string

func MarshalCniArgs

func MarshalCniArgs(ipInfos []IPInfo) (string, error)

MarshalCniArgs marshal cni args of the given ipInfos

func PolicyStr

func PolicyStr(policy ReleasePolicy) string

Types

type CniArgs

type CniArgs struct {
	// RequestIPRange is the requested ip candidates to allocate, one ip per []nets.IPRange
	RequestIPRange [][]nets.IPRange `json:"request_ip_range,omitempty"`
	// Common is the common args for cni plugins to setup network
	Common CommonCniArgs `json:"common"`
}

CniArgs is the cni args in pod annotation

func UnmarshalCniArgs

func UnmarshalCniArgs(str string) (*CniArgs, error)

UnmarshalCniArgs unmarshal cni args from input str

type CommonCniArgs

type CommonCniArgs struct {
	IPInfos []IPInfo `json:"ipinfos,omitempty"`
}

type IPInfo

type IPInfo struct {
	IP      *nets.IPNet `json:"ip"`
	Vlan    uint16      `json:"vlan"`
	Gateway net.IP      `json:"gateway"`
}

IPInfo is the container ip info

type ReleasePolicy

type ReleasePolicy uint16

ReleasePolicy defines floatingip release policy

const (
	ReleasePolicyPodDelete ReleasePolicy = iota // release ip as soon as possible
	ReleasePolicyImmutable
	ReleasePolicyNever
)

func ConvertReleasePolicy

func ConvertReleasePolicy(policyStr string) ReleasePolicy

Source Files

Directories

Path Synopsis
* Tencent is pleased to support the open source community by making TKEStack available.
* Tencent is pleased to support the open source community by making TKEStack available.

Jump to

Keyboard shortcuts

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