Documentation ¶
Index ¶
- Constants
- Variables
- func CreateClient(kubeconfig *string) (*kubernetes.Clientset, error)
- func CreateEnvironmentSurvey(out io.Writer, batchMode bool, authConfigSvc auth.AuthConfigService, ...) (gits.GitProvider, error)
- func CurrentContext(config *api.Config) *api.Context
- func CurrentNamespace(config *api.Config) string
- func CurrentServer(config *api.Config) string
- func EnsureDevEnvironmentSetup(jxClient *versioned.Clientset, ns string) (*v1.Environment, error)
- func EnsureEnvironmentNamespaceSetup(kubeClient *kubernetes.Clientset, jxClient *versioned.Clientset, ...) error
- func EnsureNamespaceCreated(kubeClient *kubernetes.Clientset, name string, labels map[string]string, ...) error
- func FindServiceURL(client *kubernetes.Clientset, namespace string, name string) (string, error)
- func GetCommitSha(r *metav1.ObjectMeta) string
- func GetCommitURL(r *metav1.ObjectMeta) string
- func GetDeploymentNames(client *kubernetes.Clientset, ns string, filter string) ([]string, error)
- func GetDeploymentPods(client *kubernetes.Clientset, name, namespace string) ([]v1.Pod, error)
- func GetDeployments(kubeClient *kubernetes.Clientset, ns string) (map[string]v1beta2.Deployment, error)
- func GetDevNamespace(kubeClient *kubernetes.Clientset, ns string) (string, string, error)
- func GetEnvironmentNames(jxClient *versioned.Clientset, ns string) ([]string, error)
- func GetEnvironments(jxClient *versioned.Clientset, ns string) (map[string]*v1.Environment, []string, error)
- func GetName(r *metav1.ObjectMeta) string
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodMetrics(client *metricsclient.Clientset, ns string) (*metricsv1beta1.PodMetricsList, error)
- func GetPodNames(client *kubernetes.Clientset, ns string, filter string) ([]string, error)
- func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
- func GetPodVersion(pod *corev1.Pod, appName string) string
- func GetReadyPodNames(client *kubernetes.Clientset, ns string, filter string) ([]string, error)
- func GetServiceNames(client *kubernetes.Clientset, ns string, filter string) ([]string, error)
- func GetVersion(r *metav1.ObjectMeta) string
- func HasExternalAddress(svc *v1.Service) bool
- func IsDeploymentRunning(client *kubernetes.Clientset, name, namespace string) (bool, error)
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- func LoadConfig() (*api.Config, *clientcmd.PathOptions, error)
- func PickEnvironment(envNames []string, defaultEnv string) (string, error)
- func RegisterEnvironmentCRD(apiClient *apiextensionsclientset.Clientset) error
- func Server(config *api.Config, context *api.Context) string
- func SortEnvironments(environments []v1.Environment)
- func ValidNameOption(option string, value string) error
- func ValidSubDomainOption(option string, value string) error
- func ValidateEnvironmentDoesNotExist(jxClient *versioned.Clientset, ns string, str string) error
- func ValidateName(val interface{}) error
- func ValidateSubDomain(val interface{}) error
- func WaitForAllDeploymentsToBeReady(client *kubernetes.Clientset, namespace string, timeoutPerDeploy time.Duration) error
- func WaitForDeploymentToBeReady(client *kubernetes.Clientset, name, namespace string, timeout time.Duration) error
- func WaitForExternalIP(client *kubernetes.Clientset, name, namespace string, timeout time.Duration) error
- func WaitForPodToBeReady(client *kubernetes.Clientset, selector labels.Selector, namespace string, ...) error
- type ByOrder
- type HeapterConfig
- type ServiceURL
Constants ¶
const ( // ChartGitea the default name of the gitea chart ChartGitea = "jenkins-x/gitea" // ServiceJenkins is the name of the Jenkins Service ServiceJenkins = "jenkins" // ServiceChartMuseum the service name of the Helm Chart Museum service ServiceChartMuseum = "jenkins-x-chartmuseum" // the git credentials secret SecretJenkinsGitCredentials = "jenkins-git-credentials" // LocalHelmRepoName is the default name of the local chart repository where CI / CD releases go to LocalHelmRepoName = "releases" DefaultEnvironmentGitRepoURL = "https://github.com/jenkins-x/default-environment-charts.git" )
const ( LabelValueDevEnvironment = "dev" LabelTeam = "team" LabelEnvironment = "env" )
const ( OptionName = "name" OptionNamespace = "namespace" )
const (
DefaultNamespace = "default"
)
const (
ExposeURLAnnotation = "fabric8.io/exposeUrl"
)
Variables ¶
var ( AddonCharts = map[string]string{ "gitea": ChartGitea, "prometheus": "stable/prometheus", "grafana": "stable/grafana", } )
Functions ¶
func CreateClient ¶
func CreateClient(kubeconfig *string) (*kubernetes.Clientset, error)
CreateClient creates a new kubernetes client
func CreateEnvironmentSurvey ¶
func CreateEnvironmentSurvey(out io.Writer, batchMode bool, authConfigSvc auth.AuthConfigService, devEnv *v1.Environment, data *v1.Environment, config *v1.Environment, forkEnvGitURL string, ns string, jxClient *versioned.Clientset, envDir string, gitRepoOptions gits.GitRepositoryOptions) (gits.GitProvider, error)
CreateEnvironmentSurvey creates a Survey on the given environment using the default options from the CLI
func CurrentContext ¶
CurrentContext returns the current context
func CurrentNamespace ¶
CurrentNamespace returns the current namespace in the context
func CurrentServer ¶
CurrentServer returns the current context's server
func EnsureDevEnvironmentSetup ¶
EnsureDevEnvironmentSetup ensures that the Environment is created in the given namespace
func EnsureEnvironmentNamespaceSetup ¶
func EnsureEnvironmentNamespaceSetup(kubeClient *kubernetes.Clientset, jxClient *versioned.Clientset, env *v1.Environment, ns string) error
func EnsureNamespaceCreated ¶
func EnsureNamespaceCreated(kubeClient *kubernetes.Clientset, name string, labels map[string]string, annotations map[string]string) error
Ensure that the namespace exists for the given name
func FindServiceURL ¶
func GetCommitSha ¶
func GetCommitSha(r *metav1.ObjectMeta) string
GetCommitSha returns the git commit sha
func GetCommitURL ¶
func GetCommitURL(r *metav1.ObjectMeta) string
GetCommitURL returns the git commit URL
func GetDeploymentNames ¶
func GetDeploymentPods ¶
func GetDeployments ¶
func GetDeployments(kubeClient *kubernetes.Clientset, ns string) (map[string]v1beta2.Deployment, error)
func GetDevNamespace ¶
GetDevNamespace returns the developer environment namespace which is the namespace that contains the Environments and the developer tools like Jenkins
func GetEnvironmentNames ¶
GetEnvironmentNames returns the sorted list of environment names
func GetEnvironments ¶
func GetEnvironments(jxClient *versioned.Clientset, ns string) (map[string]*v1.Environment, []string, error)
GetEnvironments returns a map of the enviroments along with a sorted list of names
func GetPodCondition ¶
func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.
func GetPodMetrics ¶
func GetPodMetrics(client *metricsclient.Clientset, ns string) (*metricsv1beta1.PodMetricsList, error)
func GetPodNames ¶
func GetPodReadyCondition ¶
func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go Extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.
func GetPodVersion ¶
GetPodVersion returns the version for the given app name
func GetReadyPodNames ¶
func GetServiceNames ¶
func GetVersion ¶
func GetVersion(r *metav1.ObjectMeta) string
GetVersion returns the version from the labels on the deployment if it can be deduced
func HasExternalAddress ¶
func IsDeploymentRunning ¶
func IsDeploymentRunning(client *kubernetes.Clientset, name, namespace string) (bool, error)
func IsPodReady ¶
credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go IsPodReady returns true if a pod is ready; false otherwise.
func IsPodReadyConditionTrue ¶
credit https://github.com/kubernetes/kubernetes/blob/8719b4a/pkg/api/v1/pod/util.go IsPodReady retruns true if a pod is ready; false otherwise.
func LoadConfig ¶
func LoadConfig() (*api.Config, *clientcmd.PathOptions, error)
LoadConfig loads the kubernetes configuration
func RegisterEnvironmentCRD ¶
func RegisterEnvironmentCRD(apiClient *apiextensionsclientset.Clientset) error
RegisterEnvironmentCRD ensures that the CRD is registered for Environments
func SortEnvironments ¶
func SortEnvironments(environments []v1.Environment)
func ValidNameOption ¶
func ValidSubDomainOption ¶
func ValidateName ¶
func ValidateName(val interface{}) error
func ValidateSubDomain ¶
func ValidateSubDomain(val interface{}) error
func WaitForDeploymentToBeReady ¶
func WaitForDeploymentToBeReady(client *kubernetes.Clientset, name, namespace string, timeout time.Duration) error
waits for the pods of a deployment to become ready
func WaitForExternalIP ¶
func WaitForExternalIP(client *kubernetes.Clientset, name, namespace string, timeout time.Duration) error
waits for the pods of a deployment to become ready
func WaitForPodToBeReady ¶
func WaitForPodToBeReady(client *kubernetes.Clientset, selector labels.Selector, namespace string, timeout time.Duration) error
waits for the pod to become ready using label selector to match the pod
Types ¶
type ByOrder ¶
type ByOrder []v1.Environment
type HeapterConfig ¶
type ServiceURL ¶
func FindServiceURLs ¶
func FindServiceURLs(client *kubernetes.Clientset, namespace string) ([]ServiceURL, error)