constants

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 0 Imported by: 8

Documentation

Index

Constants

View Source
const (
	LabelKubernetesComponent = "app.kubernetes.io/component"
	LabelKubernetesInstance  = "app.kubernetes.io/instance"
	LabelKubernetesName      = "app.kubernetes.io/name"
	LabelKubernetesManagedBy = "app.kubernetes.io/managed-by"
	LabelKubernetesRoleGroup = "app.kubernetes.io/role-group"
	LabelKubernetesVersion   = "app.kubernetes.io/version"

	ZncdataDomain = "zncdata.dev"
)

k8s recommended labels for app https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/ https://kubernetes.io/docs/reference/labels-annotations-taints/

View Source
const (
	ListenerOperatorGroup string = "listeners." + ZncdataDomain
	ListenerStorageClass  string = ListenerOperatorGroup
)
View Source
const (
	// Specify which network listening rules to use, it is REQUIRED.
	// It can be one of the following values:
	//	- cluster-internal
	//	- external-unstable
	//	- external-stable
	//	- <other user defined class name>
	AnnotationListenersClass string = listenerOperatorGroupPrefix + "class"
	// The listener name is used to identify the listener, it is OPTIONAL.
	// If not set, the listener name will be the same as the pod name.
	AnnotationListenerName string = listenerOperatorGroupPrefix + "listenerName"
)

Zncdata defined annotations for PVCTemplate. Then csi driver can extract annotations from PVC to prepare the listener for pod.

View Source
const (
	SecretOperatorGroup string = "secrets." + ZncdataDomain
	SecretStorageClass  string = SecretOperatorGroup
)
View Source
const (
	LabelSecretsNode    string = secretOperatorGroupPrefix + "node"
	LabelSecretsPod     string = secretOperatorGroupPrefix + "/pod"
	LabelSecretsService string = secretOperatorGroupPrefix + "service"
)

Labels for k8s search secret k8s search secret obj by filter one or more labels

View Source
const (
	AnnotationSecretsClass string = secretOperatorGroupPrefix + "class"

	// Scope is the scope of the secret.
	// It can be one of the following values:
	//	- pod
	//	- node
	//	- service
	//	- listener-volume
	//
	// Example:
	//	- "secrets.zncdata.dev/scope": "pod"
	//	- "secrets.zncdata.dev/scope": "node"
	//	- "secrets.zncdata.dev/scope": "service=foo"
	//	- "secrets.zncdata.dev/scope": "listener-volume=foo"
	//	- "secrets.zncdata.dev/scope": "pod,service=foo,bar,listner-volume=xyz"
	AnnotationSecretsScope string = secretOperatorGroupPrefix + "scope"

	// Format is mounted format of the secret.
	// It can be one of the following values:
	//	- tls-pem  A PEM-encoded TLS certificate, include "tls.crt", "tls.key", "ca.crt".
	//	- tls-p12 A PKCS#12 archive, include "keystore.p12", "truststore.p12".
	//	- kerberos A Kerberos keytab, include "keytab", "krb5.conf".
	AnnotationSecretsFormat string = secretOperatorGroupPrefix + "format"

	// PKCS12 format password, it will be used truststore and keystore password.
	AnnotationSecretsPKCS12Password string = secretOperatorGroupPrefix + "tlsPKCS12Password"
	// golang time.Duration string, it will be used to create certificate expiration time.
	AnnotationSecretCertLifeTime      string = secretOperatorGroupPrefix + "autoTlsCertLifetime"
	AnnotationSecretsCertJitterFactor string = secretOperatorGroupPrefix + "autoTlsCertJitterFactor"

	// KerberosServiceNames is the list of Kerberos service names.
	// It is a comma separated list of Kerberos realms.
	//
	// If this filed value is "HTTP,NN,DN", and scope is specified a service name: "service=<k8s-service>".
	// It is used to create kerberos realm.
	// 	- HTTP -> HTTP/<k8s-service>.<k8s-namespace>.cluster.local@REALM
	// 	- NN -> nn/<k8s-service>.<k8s-namespace>.cluster.local@REALM
	// 	- DN -> dn/<k8s-service>.<k8s-namespace>.cluster.local@REALM
	//
	// If this field value is "NN", and scope is "pod"
	// It is used to create kerberos realm:
	// 	- nn/<pod-name>.<pod-subdomain>.<k8s-namespace>.cluster.local@REALM		# https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pods
	//
	// If this field value is "DN", and scope is "node"
	// It is used to create kerberos realm:
	// 	- dn/<node-name>.<k8s-namespace>.cluster.local@REALM
	//
	// If this field value is "HTTP", and scope is "listener-volume=foo"
	// It is used to create kerberos realm:
	// 	- HTTP/<the-service-of-listener-foo>.<k8s-namespace>.cluster.local@REALM
	AnnotationSecretsKerberosServiceNames string = secretOperatorGroupPrefix + "kerberosServiceNames"
)

Zncdata defined annotations for PVCTemplate. Then csi driver can extract annotations from PVC to prepare the secret for pod.

View Source
const (
	CommonDelimiter               string = ","
	ListenerVolumeDelimiter       string = CommonDelimiter
	KerberosServiceNamesDelimiter string = CommonDelimiter
)
View Source
const (
	SecretZncdataExpirationTimeName string = secretOperatorGroupPrefix + "expirationTime"
)

Annotation for expiration time of zncdata secret for pod. When the secret is created, the expiration time is set to the current time plus the lifetime. Then we can clean up the secret after expiration time

Variables

This section is empty.

Functions

func ListenerStorageClassPtr

func ListenerStorageClassPtr() *string

func MatchingLabelsNames

func MatchingLabelsNames() []string

func SecretStorageClassPtr

func SecretStorageClassPtr() *string

Types

type SecretFormat

type SecretFormat string
const (
	TLSPEM   SecretFormat = "tls-pem"
	TLSP12   SecretFormat = "tls-p12"
	Kerberos SecretFormat = "kerberos"
)

type SecretScope

type SecretScope string
const (
	PodScope            SecretScope = "pod"
	NodeScope           SecretScope = "node"
	ServiceScope        SecretScope = "service"
	ListenerVolumeScope SecretScope = "listener-volume"
)

Jump to

Keyboard shortcuts

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