The users can now set the pod spec for builder and fn pods via helm chart. Currently we have set some default securitycontext for the pods. Before there were no permissions set and the user would by default enter root when kubectl exec into pod. Now the permissions have been set and the user will not be able to access root directory in poolmgr and newdeploy pods.
156 lines
3.9 KiB
Go
156 lines
3.9 KiB
Go
/*
|
|
Copyright 2018 The Fission Authors.
|
|
|
|
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
|
|
|
|
http://www.apache.org/licenses/LICENSE-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 OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package v1
|
|
|
|
var (
|
|
MinimumKubernetesVersion = [3]int{1, 19, 0}
|
|
)
|
|
|
|
const (
|
|
EXECUTOR_INSTANCEID_LABEL string = "executorInstanceId"
|
|
DEFAULT_FUNCTION_TIMEOUT int = 60
|
|
)
|
|
|
|
const (
|
|
// ResourceVersionCount env variable is used for updating configmaps and secrets in pods
|
|
ResourceVersionCount string = "RESOURCE_VERSION_COUNT"
|
|
)
|
|
|
|
const (
|
|
ChecksumTypeSHA256 ChecksumType = "sha256"
|
|
)
|
|
|
|
const (
|
|
// ArchiveTypeLiteral means the package contents are specified in the Literal field of
|
|
// resource itself.
|
|
ArchiveTypeLiteral ArchiveType = "literal"
|
|
|
|
// ArchiveTypeUrl means the package contents are at the specified URL.
|
|
ArchiveTypeUrl ArchiveType = "url"
|
|
)
|
|
|
|
const (
|
|
BuildStatusPending = "pending"
|
|
BuildStatusRunning = "running"
|
|
BuildStatusSucceeded = "succeeded"
|
|
BuildStatusFailed = "failed"
|
|
BuildStatusNone = "none"
|
|
)
|
|
|
|
const (
|
|
AllowedFunctionsPerContainerSingle = "single"
|
|
AllowedFunctionsPerContainerInfinite = "infinite"
|
|
)
|
|
|
|
const (
|
|
ExecutorTypePoolmgr ExecutorType = "poolmgr"
|
|
ExecutorTypeNewdeploy ExecutorType = "newdeploy"
|
|
ExecutorTypeContainer ExecutorType = "container"
|
|
)
|
|
|
|
const (
|
|
StrategyTypeExecution = "execution"
|
|
)
|
|
|
|
const (
|
|
RuntimePodSpecConfigmap = "runtime-podspec-patch"
|
|
BuilderPodSpecConfigmap = "builder-podspec-patch"
|
|
)
|
|
|
|
const (
|
|
SharedVolumeUserfunc = "userfunc"
|
|
SharedVolumePackages = "packages"
|
|
SharedVolumeSecrets = "secrets"
|
|
SharedVolumeConfigmaps = "configmaps"
|
|
PodInfoVolume = "podinfo"
|
|
PodInfoMount = "/etc/podinfo"
|
|
)
|
|
|
|
const (
|
|
MessageQueueTypeKafka = "kafka"
|
|
)
|
|
|
|
const (
|
|
// FunctionReferenceFunctionName means that the function
|
|
// reference is simply by function name.
|
|
FunctionReferenceTypeFunctionName = "name"
|
|
|
|
FunctionReferenceTypeFunctionWeights = "function-weights"
|
|
|
|
// Other function reference types we'd like to support:
|
|
// Versioned function, latest version
|
|
// Versioned function. by semver "latest compatible"
|
|
// Set of function references (recursively), by percentage of traffic
|
|
)
|
|
|
|
const (
|
|
// failure type currently supported is http status code. This could be extended
|
|
// in the future.
|
|
FailureTypeStatusCode FailureType = "status-code"
|
|
|
|
// Status of canary config can be one of the following
|
|
CanaryConfigStatusPending = "pending"
|
|
CanaryConfigStatusSucceeded = "succeeded"
|
|
CanaryConfigStatusFailed = "failed"
|
|
CanaryConfigStatusAborted = "aborted"
|
|
|
|
// set a max number for iterations to prevent infinite processing of canary config
|
|
MaxIterationsForCanaryConfig = 10
|
|
)
|
|
|
|
const (
|
|
DefaultSpecializationTimeOut = 120
|
|
)
|
|
|
|
const (
|
|
FETCH_SOURCE = iota
|
|
FETCH_DEPLOYMENT
|
|
FETCH_URL
|
|
)
|
|
|
|
// executor kubernetes object label key
|
|
const (
|
|
ENVIRONMENT_NAMESPACE = "environmentNamespace"
|
|
ENVIRONMENT_NAME = "environmentName"
|
|
ENVIRONMENT_UID = "environmentUid"
|
|
FUNCTION_NAMESPACE = "functionNamespace"
|
|
FUNCTION_NAME = "functionName"
|
|
FUNCTION_UID = "functionUid"
|
|
FUNCTION_RESOURCE_VERSION = "functionResourceVersion"
|
|
EXECUTOR_TYPE = "executorType"
|
|
MANAGED = "managed"
|
|
)
|
|
|
|
const (
|
|
ANNOTATION_SVC_HOST = "svcHost"
|
|
)
|
|
|
|
const (
|
|
ArchiveLiteralSizeLimit int64 = 256 * 1024
|
|
)
|
|
|
|
const (
|
|
FissionBuilderSA = "fission-builder"
|
|
FissionFetcherSA = "fission-fetcher"
|
|
|
|
SecretConfigMapGetterRB = "secret-configmap-getter-binding"
|
|
|
|
PackageGetterRB = "package-getter-binding"
|
|
|
|
ClusterRole = "ClusterRole"
|
|
)
|