schedulerplugin

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 30 Imported by: 0

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.

* 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.

* 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.

* 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.

* 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.

* 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

This section is empty.

Variables

View Source
var (
	NoReplicas          = NotSupportedReleasePolicyError(errors.New("parent workload has no replicas"))
	NotStatefulWorkload = NotSupportedReleasePolicyError(
		errors.New("pod name doesn't match '.*-[0-9]*$', assume its parent is not a stateful workload"))
)

Functions

This section is empty.

Types

type Conf

type Conf struct {
	FloatingIPs           []*floatingip.FloatingIPPool `json:"floatingips,omitempty"`
	ResyncInterval        uint                         `json:"resyncInterval"`
	ConfigMapName         string                       `json:"configMapName"`
	ConfigMapNamespace    string                       `json:"configMapNamespace"`
	FloatingIPKey         string                       `json:"floatingipKey"` // configmap floatingip data key
	CloudProviderGRPCAddr string                       `json:"cloudProviderGrpcAddr"`
}

type CrdKey

type CrdKey interface {
	// GetGroupVersionResource returns the schema.GroupVersionResource for the stored app key prefix
	GetGroupVersionResource(appPrefix string) *schema.GroupVersionResource
}

CrdKey stores schema.GroupVersionResource for each crd workloads and offers query funcs to get schema.GroupVersionResource of a appPrefix

func NewCrdKey

func NewCrdKey(extensionLister extensionlister.CustomResourceDefinitionLister) CrdKey

NewCrdKey creates a CrdKey

type FloatingIPPlugin

type FloatingIPPlugin struct {
	*context.IPAMContext
	// contains filtered or unexported fields
}

FloatingIPPlugin Allocates Floating IP for deployments

func NewFloatingIPPlugin

func NewFloatingIPPlugin(conf Conf, ctx *context.IPAMContext) (*FloatingIPPlugin, error)

NewFloatingIPPlugin creates FloatingIPPlugin

func (*FloatingIPPlugin) AddPod

func (p *FloatingIPPlugin) AddPod(pod *corev1.Pod) error

AddPod does nothing

func (*FloatingIPPlugin) Bind

Bind binds a new floatingip or reuse an old one to pod

func (*FloatingIPPlugin) DeletePod

func (p *FloatingIPPlugin) DeletePod(pod *corev1.Pod) error

DeletePod unbinds pod from ipam

func (*FloatingIPPlugin) Filter

Filter marks nodes which have no available ips as FailedNodes If the given pod doesn't want floating IP, none failedNodes returns

func (*FloatingIPPlugin) GetIpam

func (p *FloatingIPPlugin) GetIpam() floatingip.IPAM

func (*FloatingIPPlugin) Init

func (p *FloatingIPPlugin) Init() error

Init retrieves floatingips from json config or config map and calls ipam to update

func (*FloatingIPPlugin) LockDpPool

func (p *FloatingIPPlugin) LockDpPool(poolName string) func()

func (*FloatingIPPlugin) Prioritize

func (p *FloatingIPPlugin) Prioritize(pod *corev1.Pod, nodes []corev1.Node) (*schedulerapi.HostPriorityList, error)

Prioritize can score each node, currently it does nothing

func (*FloatingIPPlugin) Release

func (p *FloatingIPPlugin) Release(r *ReleaseRequest) error

func (*FloatingIPPlugin) Run

func (p *FloatingIPPlugin) Run(stop chan struct{})

Run starts resyncing pod routine

func (*FloatingIPPlugin) UpdatePod

func (p *FloatingIPPlugin) UpdatePod(oldPod, newPod *corev1.Pod) error

UpdatePod syncs pod ip with ipam

type NotSupportedReleasePolicyError

type NotSupportedReleasePolicyError error

type ReleaseRequest

type ReleaseRequest struct {
	KeyObj *util.KeyObj
	IP     net.IP
}

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.
* 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