Documentation
¶
Overview ¶
Package manifest builds, transforms, and validates Podmin's typed Kubernetes manifest subset.
Index ¶
- Constants
- func DeploymentIdentity(key string) (string, string, bool)
- func DeploymentKey(nodeGroup, name string) string
- func Digest(body []byte) string
- func Init(options InitConfig) ([]byte, error)
- func MarshalIndex(index Index) ([]byte, error)
- func MarshalPod(pod *corev1.Pod) ([]byte, error)
- func Name(input []byte) (string, error)
- func ParsePod(input []byte) (*corev1.Pod, error)
- func ServiceIdentity(key string) (string, string, string, bool)
- func Transform(input []byte, images []string, revision string) ([]byte, error)
- func TransformPod(input []byte, images []string, revision string) (*corev1.Pod, error)
- func ValidID(value string) bool
- func ValidNamespace(value string) bool
- type Deployment
- type Index
- type IndexDeployment
- type IndexObject
- type InitConfig
- type Service
- type ServicePort
Constants ¶
const ( // IdentityVolumeName is the reserved workload identity volume name. IdentityVolumeName = "podmin-identity" // IdentityMountPath is the standard workload identity mount path. IdentityMountPath = "/var/run/secrets/podmin.dev/tls" // IdentityHostRoot is the Podmin-owned tmpfs root containing workload identity files. IdentityHostRoot = "/run/podmin" // InstallAnnotation identifies a workload produced by a built-in install command. InstallAnnotation = "podmin.dev/install" )
Variables ¶
This section is empty.
Functions ¶
func DeploymentIdentity ¶
DeploymentIdentity parses a cluster-wide deployment key.
func DeploymentKey ¶
DeploymentKey returns the unique cluster-wide key for a nodegroup deployment.
func Init ¶
func Init(options InitConfig) ([]byte, error)
Init creates a minimal DaemonSet and optional Service targeting one NodeGroup.
func MarshalIndex ¶
MarshalIndex produces deterministic canonical JSON.
func MarshalPod ¶
MarshalPod serializes a typed Pod as deterministic YAML.
func ServiceIdentity ¶
ServiceIdentity validates a content-addressed Service key and returns its namespace, name, and combined identity.
func TransformPod ¶
TransformPod strictly decodes and transforms one typed Pod.
func ValidID ¶
ValidID reports whether value is a valid cluster, NodeGroup, workload, or container identifier.
func ValidNamespace ¶
ValidNamespace reports whether value is a Kubernetes DNS-label namespace.
Types ¶
type Deployment ¶
Deployment is one transformed Pod and its optional Service desired state.
func ParseDeployment ¶
func ParseDeployment(input []byte, images []string, revision, expectedName, nodeGroup string) (Deployment, error)
ParseDeployment extracts exactly one DaemonSet and at most one constrained Service.
type Index ¶
type Index map[string]IndexDeployment
Index is the single cluster-wide committed desired-state object.
func ParseIndex ¶
ParseIndex strictly parses and validates an index.
type IndexDeployment ¶
type IndexDeployment struct {
Pod IndexObject `json:"pod"`
Service IndexObject `json:"service,omitempty"`
}
IndexDeployment references one Pod and its optional Service payload.
type IndexObject ¶
type IndexObject string
IndexObject is the content-addressed path of an immutable payload.
func (IndexObject) Verify ¶
func (o IndexObject) Verify(body []byte) error
Verify checks that body is the referenced immutable payload.
type InitConfig ¶ added in v0.4.0
type InitConfig struct {
Name string
NodeGroup string
Namespace string
Images []string
Service bool
Env map[string]string
Ports []ServicePort
SecretKeys []string
SecretsProvider string
}
InitConfig describes a built-in manifest.
type Service ¶
type Service struct {
Name string
Namespace string
Selector map[string]string
Ports []ServicePort
}
Service is the supported, provider-neutral Service desired state.
func ParseService ¶
ParseService validates one standalone Service document for agent consumption.