Documentation ¶
Index ¶
- Constants
- func ChangeDiff(currentSpec, newSpec *cluster.Spec) *types.ChangeDiff
- func CheckDaemonSetReady(daemonSet *v1.DaemonSet) error
- func CheckDeploymentReady(deployment *v1.Deployment) error
- func CheckPreflightDaemonSetReady(ciliumDaemonSet, preflightDaemonSet *v1.DaemonSet) error
- type Cilium
- type Client
- type ComponentUpgradePlan
- type Helm
- type Installation
- type ManifestConfig
- type ManifestOpt
- type Templater
- func (t *Templater) GenerateManifest(ctx context.Context, spec *cluster.Spec, opts ...ManifestOpt) ([]byte, error)
- func (t *Templater) GenerateNetworkPolicyManifest(spec *cluster.Spec, namespaces []string) ([]byte, error)
- func (t *Templater) GenerateUpgradePreflightManifest(ctx context.Context, spec *cluster.Spec) ([]byte, error)
- type UpgradePlan
- type Upgrader
Constants ¶
const ( DaemonSetName = "cilium" PreflightDaemonSetName = "cilium-pre-flight-check" DeploymentName = "cilium-operator" PreflightDeploymentName = "cilium-pre-flight-check" )
Variables ¶
This section is empty.
Functions ¶
func ChangeDiff ¶
func ChangeDiff(currentSpec, newSpec *cluster.Spec) *types.ChangeDiff
func CheckDaemonSetReady ¶ added in v0.11.0
func CheckDeploymentReady ¶ added in v0.11.0
func CheckDeploymentReady(deployment *v1.Deployment) error
func CheckPreflightDaemonSetReady ¶ added in v0.11.0
Types ¶
type Client ¶
type Client interface { ApplyKubeSpecFromBytes(ctx context.Context, cluster *types.Cluster, data []byte) error DeleteKubeSpecFromBytes(ctx context.Context, cluster *types.Cluster, data []byte) error GetDaemonSet(ctx context.Context, name, namespace, kubeconfig string) (*v1.DaemonSet, error) GetDeployment(ctx context.Context, name, namespace, kubeconfig string) (*v1.Deployment, error) RolloutRestartDaemonSet(ctx context.Context, name, namespace, kubeconfig string) error }
type ComponentUpgradePlan ¶ added in v0.11.0
ComponentUpgradePlan contains upgrade information for a Cilium component
func (ComponentUpgradePlan) Needed ¶ added in v0.11.0
func (c ComponentUpgradePlan) Needed() bool
Needed determines if an upgrade is needed or not
type Installation ¶ added in v0.11.0
type Installation struct { DaemonSet *appsv1.DaemonSet Operator *appsv1.Deployment }
Installation represents the Cilium components installed in a cluster
func (Installation) Installed ¶ added in v0.11.0
func (i Installation) Installed() bool
Installed determines if all Cilium components are present
type ManifestConfig ¶ added in v0.11.0
type ManifestConfig struct {
// contains filtered or unexported fields
}
type ManifestOpt ¶ added in v0.11.0
type ManifestOpt func(*ManifestConfig)
ManifestOpt allows to modify options for a cilium manifest
func WithKubeVersion ¶ added in v0.11.0
func WithKubeVersion(kubeVersion string) ManifestOpt
WithKubeVersion allows to generate the Cilium manifest for a different kubernetes version than the one specified in the cluster spec. Useful for upgrades scenarios where Cilium is upgraded before the kubernetes components
func WithPolicyAllowedNamespaces ¶ added in v0.11.0
func WithPolicyAllowedNamespaces(namespaces []string) ManifestOpt
WithPolicyAllowedNamespaces allows to specify which namespaces traffic should be allowed when using and "Always" policy enforcement mode
func WithRetrier ¶ added in v0.11.2
func WithRetrier(retrier *retrier.Retrier) ManifestOpt
WithRetrier introduced for optimizing unit tests
func WithUpgradeFromVersion ¶ added in v0.11.0
func WithUpgradeFromVersion(version semver.Version) ManifestOpt
WithUpgradeFromVersion allows to specify the compatibility Cilium version to use in the manifest. This is necessary for Cilium upgrades
type Templater ¶
type Templater struct {
// contains filtered or unexported fields
}
func NewTemplater ¶
func (*Templater) GenerateManifest ¶
func (*Templater) GenerateNetworkPolicyManifest ¶ added in v0.8.0
type UpgradePlan ¶ added in v0.11.0
type UpgradePlan struct { DaemonSet ComponentUpgradePlan Operator ComponentUpgradePlan }
UpgradePlan contains information about a Cilium installation upgrade
func BuildUpgradePlan ¶ added in v0.11.0
func BuildUpgradePlan(installation *Installation, clusterSpec *cluster.Spec) UpgradePlan
BuildUpgradePlan generates the upgrade plan information for a cilium installation by comparing it with a desired cluster Spec
func (UpgradePlan) Needed ¶ added in v0.11.0
func (c UpgradePlan) Needed() bool
Needed determines if an upgrade is needed or not Returns true if any of the installation components needs an upgrade
func (UpgradePlan) Reason ¶ added in v0.11.0
func (c UpgradePlan) Reason() string
Reason returns the reason why an upgrade might be needed If no upgrade needed, returns empty string For multiple components with needed upgrades, it composes their reasons into one
type Upgrader ¶
type Upgrader struct {
// contains filtered or unexported fields
}