mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-10 10:55:46 +00:00
Add the notion of a "service container" to play kube. A service container is started before the pods in play kube and is (reverse) linked to them. The service container is stopped/removed *after* all pods it is associated with are stopped/removed. In other words, a service container tracks the entire life cycle of a service started via `podman play kube`. This is required to enable `play kube` in a systemd unit file. The service container is only used when the `--service-container` flag is set on the CLI. This flag has been marked as hidden as it is not meant to be used outside the context of `play kube`. It is further not supported on the remote client. The wiring with systemd will be done in a later commit. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
100 lines
3.2 KiB
Go
100 lines
3.2 KiB
Go
package entities
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/containers/image/v5/types"
|
|
)
|
|
|
|
// PlayKubeOptions controls playing kube YAML files.
|
|
type PlayKubeOptions struct {
|
|
// Annotations - Annotations to add to Pods
|
|
Annotations map[string]string
|
|
// Authfile - path to an authentication file.
|
|
Authfile string
|
|
// Indicator to build all images with Containerfile or Dockerfile
|
|
Build types.OptionalBool
|
|
// CertDir - to a directory containing TLS certifications and keys.
|
|
CertDir string
|
|
// ContextDir - directory containing image contexts used for Build
|
|
ContextDir string
|
|
// Down indicates whether to bring contents of a yaml file "down"
|
|
// as in stop
|
|
Down bool
|
|
// Replace indicates whether to delete and recreate a yaml file
|
|
Replace bool
|
|
// Do not create /etc/hosts within the pod's containers,
|
|
// instead use the version from the image
|
|
NoHosts bool
|
|
// Username for authenticating against the registry.
|
|
Username string
|
|
// Password for authenticating against the registry.
|
|
Password string
|
|
// Networks - name of the network to connect to.
|
|
Networks []string
|
|
// Quiet - suppress output when pulling images.
|
|
Quiet bool
|
|
// SignaturePolicy - path to a signature-policy file.
|
|
SignaturePolicy string
|
|
// SkipTLSVerify - skip https and certificate validation when
|
|
// contacting container registries.
|
|
SkipTLSVerify types.OptionalBool
|
|
// SeccompProfileRoot - path to a directory containing seccomp
|
|
// profiles.
|
|
SeccompProfileRoot string
|
|
// StaticIPs - Static IP address used by the pod(s).
|
|
StaticIPs []net.IP
|
|
// StaticMACs - Static MAC address used by the pod(s).
|
|
StaticMACs []net.HardwareAddr
|
|
// ConfigMaps - slice of pathnames to kubernetes configmap YAMLs.
|
|
ConfigMaps []string
|
|
// LogDriver for the container. For example: journald
|
|
LogDriver string
|
|
// LogOptions for the log driver for the container.
|
|
LogOptions []string
|
|
// Start - don't start the pod if false
|
|
Start types.OptionalBool
|
|
// ServiceContainer - creates a service container that is started before and is stopped after all pods.
|
|
ServiceContainer bool
|
|
// Userns - define the user namespace to use.
|
|
Userns string
|
|
}
|
|
|
|
// PlayKubePod represents a single pod and associated containers created by play kube
|
|
type PlayKubePod struct {
|
|
// ID - ID of the pod created as a result of play kube.
|
|
ID string
|
|
// Containers - the IDs of the containers running in the created pod.
|
|
Containers []string
|
|
// InitContainers - the IDs of the init containers to be run in the created pod.
|
|
InitContainers []string
|
|
// Logs - non-fatal errors and log messages while processing.
|
|
Logs []string
|
|
// ContainerErrors - any errors that occurred while starting containers
|
|
// in the pod.
|
|
ContainerErrors []string
|
|
}
|
|
|
|
// PlayKubeVolume represents a single volume created by play kube.
|
|
type PlayKubeVolume struct {
|
|
// Name - Name of the volume created by play kube.
|
|
Name string
|
|
}
|
|
|
|
// PlayKubeReport contains the results of running play kube.
|
|
type PlayKubeReport struct {
|
|
// Pods - pods created by play kube.
|
|
Pods []PlayKubePod
|
|
// Volumes - volumes created by play kube.
|
|
Volumes []PlayKubeVolume
|
|
PlayKubeTeardown
|
|
}
|
|
|
|
// PlayKubeDownOptions are options for tearing down pods
|
|
type PlayKubeDownOptions struct{}
|
|
|
|
// PlayKubeDownReport contains the results of tearing down play kube
|
|
type PlayKubeTeardown struct {
|
|
StopReport []*PodStopReport
|
|
RmReport []*PodRmReport
|
|
}
|