kubernetes

package
v0.0.0-...-74dfd9c Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// KubednsConfigmap is the header used for defining the kube-dns configmap
	KubednsConfigmap = `apiVersion: v1
kind: ConfigMap
metadata:
  name: kube-dns
  namespace: kube-system
data:
`

	// ExampleNet is an example upstream zone file
	ExampleNet = `` /* 178-byte string literal not displayed */

	CoreDNSLabel   = "k8s-app=kube-dns"
	APIServerLabel = "component=kube-apiserver"
)

configmap is the header used for defining the coredns configmap

Variables

This section is empty.

Functions

func CoreDNSPodIPs

func CoreDNSPodIPs() ([]string, error)

CoreDNSPodIPs return the ips of all coredns pods

func CorednsLogs

func CorednsLogs() string

CorednsLogs returns the current coredns log

func DoIntegrationTest

func DoIntegrationTest(tc test.Case, namespace string) (*dns.Msg, error)

DoIntegrationTest executes a test case

func DoIntegrationTests

func DoIntegrationTests(t *testing.T, testCases []test.Case, namespace string)

DoIntegrationTests executes test cases

func FetchDockerContainerID

func FetchDockerContainerID(containerName string) (string, error)

FetchDockerContainerID fetches the docker container ID from the container name

func HasResourceRestarted

func HasResourceRestarted(label string) (bool, error)

HasResourceRestarted verifies if any of the specified containers in the kube-system namespace has restarted.

func Kubectl

func Kubectl(args string) (result string, err error)

Kubectl executes the kubectl command with the given arguments

func LoadCorefile

func LoadCorefile(corefile string) error

LoadCorefile calls loadCorefileAndZonefile without a zone file

func LoadCorefileAndZonefile

func LoadCorefileAndZonefile(corefile, zonefile string, restart bool) error

LoadCorefileAndZonefile constructs a configmap defining files for the corefile and zone, If restart is true, restarts the coredns pod to load the new configmap, and waits for the coredns pod to be ready.

func LoadKubednsConfigmap

func LoadKubednsConfigmap(stubdata, upstreamdata string) error

func ParseDigResponse

func ParseDigResponse(r string) ([]*dns.Msg, error)

ParseDigResponse parses dig-like command output and returns a dns.Msg

func ScrapeMetrics

func ScrapeMetrics(t *testing.T) []byte

func StartClientPod

func StartClientPod(namespace string) error

StartClientPod starts a dns client pod in the namespace

func UpstreamServer

func UpstreamServer(t *testing.T, zone, zoneFile string) (func(), *caddy.Instance, string)

UpstreamServer starts a local instance of coredns with the given zone file

func WaitForClientPodRecord

func WaitForClientPodRecord(namespace string) error

WaitForClientPodRecord waits for the client pod A record to be served by CoreDNS

func WaitNReady

func WaitNReady(maxWait, n int) error

WaitReady waits for n corednses to be ready or times out after maxWait seconds with an error

func WaitReady

func WaitReady(maxWait int) error

WaitReady waits for 1 coredns to be ready or times out after maxWait seconds with an error

Types

This section is empty.

Jump to

Keyboard shortcuts

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