Documentation ¶
Overview ¶
Copyright 2020 The metaGraf 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.
Index ¶
- Variables
- func ConfigSecretName(c *metagraf.Config) string
- func CreateEmptySecret(name string, labels map[string]string) corev1.Secret
- func DeleteBuildConfig(name string)
- func DeleteConfigMap(name string)
- func DeleteConfigMaps(mg *metagraf.MetaGraf)
- func DeleteDeploymentConfig(name string)
- func DeleteImageStream(name string)
- func DeleteRoute(name string)
- func DeleteSecret(name string)
- func DeleteSecrets(mg *metagraf.MetaGraf)
- func DeleteService(name string)
- func DeleteServiceMonitor(name string)
- func DownwardAPIEnvVars() []corev1.EnvVar
- func FindMetagrafConfigMaps(mg *metagraf.MetaGraf) map[string]string
- func FindSecrets(mg *metagraf.MetaGraf) map[string]string
- func FindServiceMonitorPath(mg *metagraf.MetaGraf) string
- func FindServiceMonitorPort(mg *metagraf.MetaGraf) int32
- func GenApplication(mg *metagraf.MetaGraf)
- func GenArgoApplication(mg *metagraf.MetaGraf) argoapp.Application
- func GenBuildConfig(mg *metagraf.MetaGraf)
- func GenConfigMaps(mg *metagraf.MetaGraf)
- func GenDeployment(mg *metagraf.MetaGraf, namespace string)
- func GenDeploymentConfig(mg *metagraf.MetaGraf)
- func GenDotFromPath(cpath string)
- func GenEnvVar_JVM_SYS_PROP(mgp metagraf.MGProperties, name string) corev1.EnvVar
- func GenImageStream(mg *metagraf.MetaGraf, namespace string)
- func GenIstioServiceEntry(mg *metagraf.MetaGraf)
- func GenIstioVirtualService(mg *metagraf.MetaGraf)
- func GenRef(mg *metagraf.MetaGraf)
- func GenRoute(mg *metagraf.MetaGraf)
- func GenSecrets(mg *metagraf.MetaGraf)
- func GenService(mg *metagraf.MetaGraf)
- func GenServiceMonitor(mg *metagraf.MetaGraf)
- func GenServiceMonitorAndService(mg *metagraf.MetaGraf)
- func GetArgoCDApplicationNamespace() string
- func GetArgoCDApplicationSyncPolicy() *argoapp.SyncPolicy
- func GetArgoCDSourceDirectory() *argoapp.ApplicationSourceDirectory
- func GetBuildEnvVars(mg *metagraf.MetaGraf, mgp metagraf.MGProperties) []corev1.EnvVar
- func GetConfigMap(name string) (*corev1.ConfigMap, error)
- func GetEnvVars(mg *metagraf.MetaGraf, inputprops metagraf.MGProperties) []corev1.EnvVar
- func GetGlobalConfigMapVolumes(mg *metagraf.MetaGraf, Volumes *[]corev1.Volume, ...)
- func GetMGEnvVars(mg *metagraf.MetaGraf) []corev1.EnvVar
- func GetMetagrafConfigsByType(mg *metagraf.MetaGraf, ctype string) []metagraf.Config
- func GetSecret(name string) (*corev1.Secret, error)
- func GetServicePorts(mg *metagraf.MetaGraf, imageports []corev1.ServicePort) []corev1.ServicePort
- func HasJVM_SYS_PROP(mg *metagraf.MetaGraf) bool
- func InspectConfigMaps(mg *metagraf.MetaGraf)
- func InspectSecrets(mg *metagraf.MetaGraf)
- func Labels(name string, input map[string]string) map[string]string
- func MGAppName(mg *metagraf.MetaGraf) string
- func MarshalObject(obj runtime.Object)
- func Name(mg *metagraf.MetaGraf) string
- func OutputArgoCDApplication(obj argoapp.Application)
- func ResourceSecretName(r *metagraf.Resource) string
- func SpecName(mg *metagraf.MetaGraf) string
- func StoreApplication(obj kapp.Application)
- func StoreArgoCDApplication(obj argoapp.Application)
- func StoreBuildConfig(obj buildv1.BuildConfig)
- func StoreConfigMap(m corev1.ConfigMap)
- func StoreDeployment(obj appsv1.Deployment)
- func StoreDeploymentConfig(obj appsv1.DeploymentConfig)
- func StoreImageStream(obj imagev1.ImageStream)
- func StoreRoute(obj routev1.Route)
- func StoreSecret(obj corev1.Secret)
- func StoreService(obj corev1.Service)
- func StoreServiceMonitor(obj monitoringv1.ServiceMonitor)
- func TriggerLocalBuild(mg metagraf.MetaGraf)
- func ValueFromEnv(key string) bool
Constants ¶
This section is empty.
Variables ¶
var ( NameSpace string // Used to pass namespace from cmd to module to avoid import cycle. Output bool // Flag passing hack Version string // Flag passing hack Dryrun bool // Flag passing hack BaseEnvs bool //Flag passing hack Defaults bool //Flag passing hack Format string // Flag passing hack Template string // Flag passing hack Suffix string // Flag passing hack ImageNS string Registry string Tag string OName string Context string // Application context root from FlagPassingHack. CreateGlobals bool // Sets the default pull policy for all metagraf modules PullPolicy corev1.PullPolicy = corev1.PullIfNotPresent )
This is a complete hack. todo: fix this shit, restructure packages
var EnvBlacklistFilter []string = []string{
"path",
"home",
"bash",
"env",
"sti",
"openshift",
}
Slice of strings that we wash environment variables with from the base image when creating a deploymentconfig
var LabelBlacklistFilter []string = []string{
"openshift",
"s2i",
"license",
"k8s",
}
Slice of strings that we wash labels from baseimage with when creating a deploymentconfig
var TmplBasePath = "/usr/share/metagraf/templates"
todo this should be made a configuration option, distribution of templates are also "unsolved"
var Variables metagraf.MGProperties
Functions ¶
func ConfigSecretName ¶ added in v0.0.6
func CreateEmptySecret ¶ added in v0.1.0
func DeleteBuildConfig ¶ added in v0.0.30
func DeleteBuildConfig(name string)
func DeleteConfigMap ¶ added in v0.0.30
func DeleteConfigMap(name string)
func DeleteConfigMaps ¶ added in v0.0.30
func DeleteDeploymentConfig ¶ added in v0.0.30
func DeleteDeploymentConfig(name string)
func DeleteImageStream ¶ added in v0.0.30
func DeleteImageStream(name string)
func DeleteRoute ¶ added in v0.0.30
func DeleteRoute(name string)
func DeleteSecret ¶ added in v0.0.30
func DeleteSecret(name string)
func DeleteSecrets ¶ added in v0.0.30
func DeleteService ¶ added in v0.0.30
func DeleteService(name string)
func DeleteServiceMonitor ¶ added in v0.1.0
func DeleteServiceMonitor(name string)
func DownwardAPIEnvVars ¶ added in v0.1.0
Builds and returns slice of Kubernetes EnvVars for common values extracted from DownwardAPI.
func FindMetagrafConfigMaps ¶ added in v0.0.12
This function will inspect the metaGraf specification for which configmaps it will need to create and their type in a map.
func FindServiceMonitorPath ¶ added in v0.1.0
Parses metaGraf specification to look for annotation to control scrape path for ServiceMonitor resource.
func FindServiceMonitorPort ¶ added in v0.1.0
Parses metaGraf specification to look for annotation to control scrape port when generating ServiceMonitor resource.
func GenApplication ¶ added in v0.1.0
func GenArgoApplication ¶ added in v0.1.0
func GenArgoApplication(mg *metagraf.MetaGraf) argoapp.Application
func GenBuildConfig ¶
func GenConfigMaps ¶
Entry function for creating a slew of configmaps, this will be somewhat specific to NT internal workings for now.
func GenDeployment ¶
func GenDeploymentConfig ¶
Todo: Still needs to be split up, but some refactoring has been done.
func GenDotFromPath ¶
func GenDotFromPath(cpath string)
func GenEnvVar_JVM_SYS_PROP ¶ added in v0.0.31
func GenEnvVar_JVM_SYS_PROP(mgp metagraf.MGProperties, name string) corev1.EnvVar
Generate an EnvVar for a config section. SecretFrom or EnvFrom will not be processed.
func GenImageStream ¶
func GenIstioServiceEntry ¶ added in v0.1.0
func GenIstioVirtualService ¶ added in v0.1.0
func GenSecrets ¶
func GenService ¶
func GenServiceMonitor ¶ added in v0.1.0
func GenServiceMonitorAndService ¶ added in v0.1.0
func GetArgoCDApplicationNamespace ¶ added in v0.1.0
func GetArgoCDApplicationNamespace() string
func GetArgoCDApplicationSyncPolicy ¶ added in v0.1.0
func GetArgoCDApplicationSyncPolicy() *argoapp.SyncPolicy
func GetArgoCDSourceDirectory ¶ added in v0.1.0
func GetArgoCDSourceDirectory() *argoapp.ApplicationSourceDirectory
func GetBuildEnvVars ¶ added in v0.1.0
func GetConfigMap ¶ added in v0.0.12
Fetch a ConfigMap resource the connected kubernetes cluster.
func GetEnvVars ¶ added in v0.1.0
func GetGlobalConfigMapVolumes ¶ added in v0.1.0
func GetMGEnvVars ¶ added in v0.1.0
Returns a slice of metagraf convention informative k8s EnvVar{}'s
func GetMetagrafConfigsByType ¶ added in v0.1.0
Returns a slice of metagraf Config structs that match specific ctype string
func GetServicePorts ¶ added in v0.1.0
func GetServicePorts(mg *metagraf.MetaGraf, imageports []corev1.ServicePort) []corev1.ServicePort
Applies protocol and port conventions for generating standardized Kubernetes Service resource. Defaults to 80->8080 mapping if no annotations or image port configuration is found.
func HasJVM_SYS_PROP ¶ added in v0.0.31
Identify if a metagraf specification has a JVM_SYS_PROP configuration type. This is a special type for handling system properties in the java space that your application might not know about.
func InspectConfigMaps ¶
func InspectSecrets ¶
func OutputArgoCDApplication ¶ added in v0.1.0
func OutputArgoCDApplication(obj argoapp.Application)
func ResourceSecretName ¶
Returns a name for a secret for a resource based on convention as follows.
func SpecName ¶ added in v0.0.19
Return a specification name for a resource base on convention. Does not adhere to override flags.
func StoreApplication ¶ added in v0.1.0
func StoreApplication(obj kapp.Application)
func StoreArgoCDApplication ¶ added in v0.1.0
func StoreArgoCDApplication(obj argoapp.Application)
func StoreBuildConfig ¶
func StoreBuildConfig(obj buildv1.BuildConfig)
func StoreConfigMap ¶
func StoreDeployment ¶ added in v0.0.32
func StoreDeployment(obj appsv1.Deployment)
func StoreDeploymentConfig ¶
func StoreDeploymentConfig(obj appsv1.DeploymentConfig)
func StoreImageStream ¶
func StoreImageStream(obj imagev1.ImageStream)
func StoreRoute ¶
func StoreSecret ¶
func StoreService ¶
func StoreServiceMonitor ¶ added in v0.1.0
func StoreServiceMonitor(obj monitoringv1.ServiceMonitor)
func TriggerLocalBuild ¶ added in v0.1.0
func ValueFromEnv ¶
Types ¶
This section is empty.