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.
Index ¶
Constants ¶
const ( DeploymentPrefixKey = "dp_" StatefulsetPrefixKey = "sts_" NoRefAppName = "NULL" NoRefAppTypePrefix = "NULL_" )
Variables ¶
This section is empty.
Functions ¶
func GetAppType ¶
GetAppType formats appTypePrefix to appType
func GetAppTypePrefix ¶
GetAppTypePrefix formats an appTypePrefix for the given resource kind
Types ¶
type KeyObj ¶
type KeyObj struct { // stores the key format in IPAM // for deployment dp_namespace_deploymentName_podName, // for pool pool__poolName_dp_namespace_deploymentName_podName, for statefulset // sts_namespace_statefulsetName_podName // If deployment name is 63 bytes, e.g. dp1234567890dp1234567890dp1234567890dp1234567890dp1234567890dp1 // deployment pod name will be 63 bytes with modified suffix, e.g. // dp1234567890dp1234567890dp1234567890dp1234567890dp1234567848p74 // So we can't get deployment name from pod name and have to store deployment name with pod name KeyInDB string AppName string AppTypePrefix string PodName string Namespace string // the annotation value if pod has pool annotation PoolName string }
func (*KeyObj) Deployment ¶
func (*KeyObj) PoolAppPrefix ¶
func (*KeyObj) PoolPrefix ¶
PoolPrefix returns the common key prefix in IPAM, for deployment dp_namespace_deploymentName_ for pool pool__poolName_, for statefulset sts_namespace_statefulsetName_ For now, if it is a statefulset pod, PoolPrefix is useless since we reserve ip by full pod name PoolPrefix is used by pool and deployment only.