system

package
v2.11.26 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	// NamespaceEnvKey is the environment variable that holds kf's namespace.
	NamespaceEnvKey = "SYSTEM_NAMESPACE"
)

Variables

This section is empty.

Functions

func ClusterIngressSelector

func ClusterIngressSelector() labels.Selector

ClusterIngressSelector matches the set of labels expected to select the cluster ingress. This matches the selector found in config/202-external-gateway.yaml.

func ExtractProxyIngressFromList

func ExtractProxyIngressFromList(ingresses []corev1.LoadBalancerIngress) (string, error)

ExtractProxyIngressFromList is a utility function that extracts a single routable ingress from the list.

func GetClusterIngresses

func GetClusterIngresses(lister ServiceLister) ([]corev1.LoadBalancerIngress, error)

GetClusterIngresses extracts LoadBalancerIngresses from the services matching the ClusterIngressSelector.

func Namespace

func Namespace() string

Namespace holds the K8s namespace where our serving system components run.

Example
package main

import (
	"fmt"

	"github.com/google/kf/v2/pkg/system"
	_ "github.com/google/kf/v2/pkg/system/testing"
)

func main() {
	fmt.Println(system.Namespace())

}
Output:

kf-testing

Types

type ServiceLister

type ServiceLister interface {
	List(selector labels.Selector) (ret []*corev1.Service, err error)
}

ServiceLister is the subset of functions on v1.ServiceLister used by GetClusterIngress.

Directories

Path Synopsis
Package testing sets environment variables for server tests.
Package testing sets environment variables for server tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL