k8s

package
v0.167.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation ¶

Overview ¶

Package k8s provisions muster instances onto a Kubernetes cluster by rendering its own minimal manifests.

# 🔴 IT RENDERS MANIFESTS RATHER THAN INSTALLING A CHART, AND THAT IS THE CENTRAL DESIGN DECISION HERE

The project muster was extracted from installed a vendored 1,402-line Helm chart. Shipping that chart was measured to be impossible: it carried a hardcoded third-party service URL reachable only on one private network, five calls to a consumer chat API's send-message endpoint, `alpine:latest` and `busybox:1.36` as literal images, a maintainer email address, and a Helm `fail` whose text asserts which CNI the author's cluster runs. Vendoring it unchanged would have shipped somebody's private service URL and a chat integration into a stranger's cluster.

The second measurement is what makes rendering cheap rather than a rewrite: that project used roughly THIRTY of the chart's values. Everything below is the manifest set those thirty values actually produced —

  • a Namespace, when the driver owns one per instance;
  • a RoleBinding of muster's own ServiceAccount in that namespace, written before anything else there, when the least-privilege RBAC layout is on (Config.NamespaceRoleBinding, rolebinding.go);
  • a ServiceAccount, which is the identity a policy grant attaches to;
  • a Secret for confidential environment, and a SEPARATE one for confidential files — separate because the first is consumed with `envFrom`, which exports every key of it as an environment variable, so a file sharing that object would be in the process environment;
  • a ConfigMap for the rest of the files;
  • a PersistentVolumeClaim, only when a persistent workspace was asked for;
  • a Deployment with exactly ONE container, plus an init container when the spec has imperative steps;
  • a Service, when the spec declares ports;
  • a NetworkPolicy, only when the spec asks for network isolation and the driver was configured to render one (see network.go).

— and nothing else. It also removes a build-time `go:embed` of a chart directory from the release path, and the chart-sync tooling that went with it, whose known trap was that its verification step silently tested the wrong tree unless a sibling checkout had been synced first.

What this driver does NOT do ¶

  • 🔴 IT DOES NOT CLONE THE REPOSITORY. Spec.Repo is declared to the instance as environment; the checkout is the instance runtime's job or an explicit Init step. The chart this replaces cloned it about 250 lines BEFORE init commands ran, which is the whole reason that project's git credential handling had to work in two different environments at once.
  • 🔴 IT DOES NOT RESTRICT EGRESS BY DNS NAME. That is the control that addresses exfiltration by a prompt-injected model, and this driver does not implement it. Saying so is the point: a driver that rendered an address-range policy and called it egress control would report a mitigation nobody has. It DOES now render an address-range policy, for a spec that asks for network isolation — and what that buys is narrower and is named for what it is (Capabilities.NetworkIsolation): the policy admits no pod but muster's, and allows no destination in a private address range other than the cluster's DNS pods on port 53. Whether that puts the cluster's API, its other namespaces and the network around it out of reach depends on their addresses being private, which this driver does not check (network.go, nonPublicIPv4). The instance can still send anything it holds to any public host on the allowed ports — and can still resolve names, which is a channel of its own.
  • 🔴 IT DOES NOT ENFORCE THE NetworkPolicy IT WRITES. The cluster's network plugin does, or does not, and nothing here can tell which.
  • It does not run sidecars. One container, plus an init container. The chart it replaces could run three log tailers, which were structurally invisible to that project anyway — its log reads never named a container, so they always read the first one.
  • It does not manage ingress, TLS, autoscaling or pod disruption budgets.

Index ¶

Constants ¶

View Source
const AnnotationPort = "muster.dev/port"

AnnotationPort records the resolved reachable port, for the same reason as annEndpoint: so Endpoint() can answer later without the spec.

🔴 IT IS ON THE **DEPLOYMENT OBJECT**, NOT ON THE POD TEMPLATE, AND THIS COMMENT IS THE ONE PLACE THAT FACT IS STATED. renderDeployment puts renderAnnotations(spec) on the Deployment's own ObjectMeta; the pod template gets annFingerprint ALONE. Endpoint() reads `dep.Annotations[AnnotationPort]`, i.e. the Deployment, so these two kubectl paths are not interchangeable — measured off one rendered object in one run:

.spec.template.metadata.annotations["muster.dev/port"]  ->  ""
.metadata.annotations["muster.dev/port"]                ->  "18789"

🔴 WHICH IS WHY IT IS EXPORTED, AND THE EXPORT IS THE POINT RATHER THAN CONVENIENCE. The fact was open-coded in SIX places — a boot log line, three comments and two runnable `kubectl -o jsonpath=` recipes — and was wrong in the same direction in every one of them: they all named the pod template. A correctly-provisioned instance therefore printed EMPTY for the recipe that was supposed to confirm it, under an instruction to STOP if the output was empty. One predicate open-coded at N sites is usually wrong at N-1; this one was wrong at N. Anything that needs to name this annotation names THIS constant, and TestTheRecipesNameTheAnnotationEndpointActuallyReads in cmd/muster-server pins the jsonpath in the prose against a rendered object.

View Source
const DefaultDNSNamespace = "kube-system"

The cluster DNS selector used when NetworkPolicyConfig names none: the namespace and label CoreDNS carries on kubeadm, k3s and most managed clusters.

⚠ A POLICY PORT IS MATCHED AGAINST THE DNS POD'S OWN PORT, not the Service's (the rule is evaluated after the Service address is translated), and this renders 53. A cluster whose DNS pods listen elsewhere, or that resolves through a node-local cache on a link-local address, gets an instance that cannot resolve a name — a loud failure, in the closed direction.

View Source
const DefaultEndpointTemplate = "{{.Name}}.{{.Group}}.svc"

DefaultEndpointTemplate is the in-cluster address of an instance's Service.

It is a DEFAULT, not a constant in the code path: Config.EndpointTemplate replaces it wholesale and Spec.Endpoint overrides it per instance. The string it replaces in the original project was reachable from nowhere.

⚠ IT STOPS AT `.svc` DELIBERATELY. A pod's own resolv.conf search path supplies the cluster's DNS domain, whatever that cluster was configured with, so `name.namespace.svc` resolves in-cluster everywhere. Spelling the default domain in full would resolve only on a cluster that kept the default, and neither form resolves from outside the cluster at all — so the short one loses nothing and survives a cluster whose clusterDomain was changed.

View Source
const DefaultWorkspacePath = "/data/workspace"

DefaultWorkspacePath is where a workspace is mounted when the spec does not say.

View Source
const NamespaceRoleBindingName = "muster-provisioner"

NamespaceRoleBindingName is the name of the RoleBinding muster writes into each per-instance namespace.

Variables ¶

View Source
var DefaultDNSPodLabels = map[string]string{"k8s-app": "kube-dns"}

DefaultDNSPodLabels is the pod half of the default DNS selector.

View Source
var NamespaceRoleBindingClusterRBAC = map[string][]string{
	"namespaces":   {"get", "list", "create", "delete"},
	"rolebindings": {"get", "create"},
	"clusterroles": {"bind"},
}

NamespaceRoleBindingClusterRBAC is the whole CLUSTER-WIDE grant the driver needs once NamespaceRoleBinding is set, as ClusterRole rules (resource -> verbs). `bind` is restricted by resourceNames to the configured ClusterRole.

  • namespaces: get, list, create, delete — ensureNamespace, Destroy, and List's enumeration of the per-instance namespaces;
  • rolebindings.rbac.authorization.k8s.io: get, create — the binding itself (no delete: a stale one is refused, not replaced; see ensureRoleBinding);
  • clusterroles.rbac.authorization.k8s.io: bind, resourceNames [ClusterRole].

TestTheNarrowClusterGrantCoversAnInstancesWholeLife measures it off an instance's whole life against an RBAC-enforcing fake.

View Source
var NetworkPolicyRBACPrerequisite = []string{"get", "create", "update", "delete"}

NetworkPolicyRBACPrerequisite is every verb the muster ServiceAccount must hold on `networkpolicies.networking.k8s.io` for an isolated instance to be created, reconciled and destroyed. It is the set of calls this driver makes on that resource — applyNetworkPolicy's here, and Destroy's get and delete in driver.go — and nothing else: no list, no watch, no patch. TestTheRBACPrerequisiteIsTheVerbsTheDriverCalls measures it off an instance's whole life.

âš  ON A DRIVER CONFIGURED FOR ISOLATION, `get` IS NEEDED TO DESTROY ANY INSTANCE, isolated or not. See Destroy.

As a ClusterRole rule:

  • apiGroups: ["networking.k8s.io"] resources: ["networkpolicies"] verbs: ["get", "create", "update", "delete"]
View Source
var PodExecRBACPrerequisite = []string{"create"}

PodExecRBACPrerequisite is every verb the muster ServiceAccount must hold on the `pods/exec` subresource for Exec and ExecTTY to work. Both open the exec stream with an SPDY upgrade, which is a POST, and the apiserver authorises a POST to a subresource as `create` — nothing else is called on it. TestTheExecRBACPrerequisiteIsTheVerbTheDriverSends pins it to the method the driver actually sends.

âš  A WEBSOCKET exec (kubectl's default since 1.30) is a GET, authorised as `get` on older apiservers and as `create` where the AuthorizePodWebsocketUpgradeCreatePermission gate is on. This driver does not use it, so `get` is not part of the prerequisite; adding the WebSocket executor would change that, and this list with it.

As a ClusterRole rule:

  • apiGroups: [""] resources: ["pods/exec"] verbs: ["create"]

Functions ¶

This section is empty.

Types ¶

type Config ¶

type Config struct {
	// Client is the cluster API client. REQUIRED.
	//
	// It is an interface rather than a concrete clientset so a fake can be
	// injected, which is what makes every test in this package runnable without
	// a cluster.
	Client kubernetes.Interface

	// RESTConfig enables Exec. Optional: nil means Capabilities.Exec is false
	// and provision.Exec refuses, rather than the call failing later with a
	// transport error nobody can attribute.
	RESTConfig *rest.Config

	// NamespacePerInstance gives each instance its own namespace, named
	// NamespacePrefix+Name. It raises Capabilities.Isolation to
	// IsolationNamespace, and it adds two steps to Destroy: an ownership
	// PRE-FLIGHT over the namespace before anything is deleted (see
	// checkNamespaceOwned), and the namespace deletion at the end.
	//
	// âš  IT DOES NOT REPLACE THE OBJECT-BY-OBJECT TEARDOWN, and this comment
	// used to say it did ("what makes Destroy a namespace deletion rather than
	// an object enumeration"). Destroy enumerates and removes every object it
	// created under BOTH layouts; the namespace delete is an extra step here.
	// Reading it the old way is what left namespaced RBAC behind in a shared
	// namespace, where no namespace is ever deleted.
	NamespacePerInstance bool

	// NamespacePrefix prefixes per-instance namespaces. Empty means "muster-".
	NamespacePrefix string

	// Namespace is where instances go when NamespacePerInstance is false.
	// REQUIRED in that case.
	Namespace string

	// EndpointTemplate overrides DefaultEndpointTemplate. It is rendered with
	// provision.EndpointVars.
	EndpointTemplate string

	// EndpointScheme is the scheme Endpoint reports. Empty means "http".
	EndpointScheme string

	// WorkspaceStorageClass is the StorageClass for persistent workspaces.
	//
	//   nil -> this driver reports Capabilities.Persistence FALSE and refuses a
	//          spec asking for a persistent workspace.
	//   ""  -> use the cluster's default StorageClass.
	//   "x" -> use class x.
	WorkspaceStorageClass *string

	// NetworkPolicy enables Capabilities.NetworkIsolation: with it set, a spec
	// asking for [provision.Network] isolation gets a per-instance NetworkPolicy,
	// written BEFORE the instance's Deployment.
	//
	//   nil -> the driver reports NetworkIsolation FALSE, refuses such a spec, and
	//          makes no networking.k8s.io call for any instance.
	//
	// âš  SETTING IT MAKES THE DRIVER NEED RBAC ON NetworkPolicies
	// (NetworkPolicyRBACPrerequisite), AND NOT ONLY FOR ISOLATED INSTANCES.
	// Without it an isolated instance is refused at apply time, naming the missing
	// verb — see networkPolicyForbidden. And with this set, Destroy reads
	// networkpolicies for EVERY instance, isolated or not, so without `get` the
	// destroy of any instance fails after its Deployment is removed. See Destroy.
	NetworkPolicy *NetworkPolicyConfig

	// SecretSourceNamespace, when set, is where the Secrets a key holder mounts
	// (provision.SecretMount) are kept — muster's own namespace — and apply
	// copies each into the instance's namespace before the pod (secretcopy.go).
	// Empty: the operator places them in the instance's namespace, unchanged.
	SecretSourceNamespace string

	// NamespaceRoleBinding, when set, is the least-privilege RBAC layout: muster
	// binds its own ServiceAccount to a named ClusterRole inside each
	// per-instance namespace, right after creating it, so the cluster-wide grant
	// shrinks to namespaces and RoleBindings (NamespaceRoleBindingClusterRBAC).
	// nil: no RoleBinding is written and the driver needs its namespaced rights
	// cluster-wide, as before. Requires NamespacePerInstance. See rolebinding.go.
	NamespaceRoleBinding *NamespaceRoleBindingConfig

	// Logger is optional.
	Logger *log.Logger
}

Config is how the Kubernetes driver is configured.

🔴 TWO FIELDS ARE POINTERS BECAUSE "UNSET" AND "EMPTY" ARE DIFFERENT ANSWERS, AND NOTHING IN THE PROJECT THIS CAME FROM COULD TELL THEM APART — it used os.Getenv exclusively, os.LookupEnv appeared zero times repo-wide, and the consequence was a required image repository defaulting to the empty string and producing an incomprehensible pull failure instead of "you did not configure an agent image". WorkspaceStorageClass distinguishes "this cluster has no storage I may use" (nil) from "use the cluster's default class" ("").

type Driver ¶

type Driver struct {
	// contains filtered or unexported fields
}

Driver provisions onto Kubernetes. See the package doc for what it renders and what it deliberately does not do.

func New ¶

func New(cfg Config) (*Driver, error)

New builds the driver, validating the configuration up front so a bad endpoint template is a startup failure naming itself rather than a per-request error naming DNS.

func (*Driver) Capabilities ¶

func (d *Driver) Capabilities() provision.Capabilities

Capabilities implements provision.Provisioner.

🔴 TWO LOSSES THIS DRIVER HAS ARE NOT ON THIS TYPE, AND HAVE TO BE READ HERE:

  • IT RESTRICTS NO EGRESS BY DNS NAME. That is the control that addresses exfiltration by a prompt-injected model, and NetworkIsolation true is NOT it: the NetworkPolicy this driver renders for an isolated instance (network.go) is an ADDRESS-RANGE policy — DNS plus the spec's ports on public addresses — so an isolated instance can still reach any public host on those ports. What it keeps the instance off is every address in nonPublicIPv4 EXCEPT THE CLUSTER'S DNS PODS (reachable on port 53, which is itself a channel) — so the cluster and the LAN WHERE THOSE ARE PRIVATE ADDRESSES, which is a property of the cluster and not something this driver checks (see that variable's âš ). It does not keep data in. And an instance whose spec declares no isolation gets no NetworkPolicy at all.
  • IT RUNS NO SIDECARS. One container plus an init container. The chart this replaces could run three log tailers, and they were structurally invisible to that project's own log reads anyway.

Both were once Capabilities fields. They were deleted because nothing branched on them and no Spec field could ever ask for either, so they announced a loss to a caller that had no decision to make — which is a statement for humans, and it belongs in prose like this.

func (*Driver) Create ¶

func (d *Driver) Create(ctx context.Context, spec provision.Spec) error

Create implements provision.Provisioner.

func (*Driver) Destroy ¶

func (d *Driver) Destroy(ctx context.Context, ref provision.Ref) error

Destroy implements provision.Provisioner.

🔴 THE nil IS VERIFIED, NOT ASSUMED. After the deletes, the Deployment is re-read: if it is still there, this returns an error rather than a nil that means "I issued some requests". The contract says nil means removed or already absent, and this is what makes that a measurement.

🔴 EVERY DELETE IS OWNERSHIP-CHECKED, AND THE DEPLOYMENT IS CHECKED FIRST. The objects are named after the instance, and a name is not an identity: in a shared namespace a Service, a ConfigMap or a ServiceAccount already holding the instance's name belongs to whoever made it. Deleting by name alone destroys a stranger's objects and reports success. A foreign DEPLOYMENT stops the teardown entirely rather than being skipped, because proceeding would tidy up around a workload muster does not own.

🔴 A FOREIGN OBJECT'S REFUSAL IS provision.ErrNotManaged AND DELIBERATELY NOT ErrNotFound, so `if err != nil && !errors.Is(err, provision.ErrNotFound)` — the idiom this contract invites — cannot discard it. The refusal for the DEPLOYMENT and the refusal for the per-instance NAMESPACE now agree; they did not, and checkNamespaceOwned says what changed and why the co-named satellites are a different case.

🔴 BOTH IDENTITY ANCHORS ARE CHECKED BEFORE ANYTHING IS DELETED, so a refusal and a teardown are never the same call. Either muster owns the name and removes everything under it, or it refuses and removes NOTHING; there is no third outcome where the instance is gone AND the call reports a permanent failure. That third outcome is what a late namespace check produced, it was measured over three consecutive Destroys, and a caller could not converge out of it. The ErrNotManaged branch is terminal by design: it is a refusal about the cluster's state, and retrying it will return the same answer until an operator relabels or removes the object in the way.

⚠ ONE CASE ESCAPES THAT GUARANTEE, AND IT IS NAMED RATHER THAN PAPERED OVER: if the namespace is REPLACED between the pre-flight and the delete, the re-read in destroyNamespace refuses after the objects are gone — the state genuinely changed under us, so the report is accurate, but a caller sees the removed-then-refused shape again. Closing it needs a delete precondition on the object's UID, which the fake clientset cannot enforce (see deleteIfOwned), so it would be code no test here could exercise. It is a race window, not the ordinary path the measurement above found.

âš  WHAT IT DOES NOT CLAIM: that everything has finished TERMINATING. A namespace deletion is asynchronous and pods linger. nil means the API has accepted removal and the Deployment is gone from the API's view.

func (*Driver) Driver ¶

func (d *Driver) Driver() string

Driver implements provision.Provisioner.

func (*Driver) Endpoint ¶

func (d *Driver) Endpoint(ctx context.Context, ref provision.Ref) (provision.Endpoint, error)

Endpoint implements provision.Provisioner, honouring the per-instance override recorded at create time.

func (*Driver) Exec ¶

func (d *Driver) Exec(ctx context.Context, ref provision.Ref, cmd []string, stdin io.Reader, stdout, stderr io.Writer) error

Exec implements provision.Execer.

⚠ ITS STREAM IS COVERED NOW, BY THE SAME IN-PROCESS EXEC SERVER AS ExecTTY's (exec_stream_test.go), WHICH SPEAKS THE APISERVER'S SPDY PROTOCOL. This doc used to say the method was uncovered because client-go's fake clientset does not serve the subresource — true of the fake, and the reason the request is now built from RESTConfig rather than from Config.Client: the fake's REST client is nil, so a request built from it could not be pointed at a test server at all. What is still NOT covered is a real apiserver and kubelet.

⚠ A RELATED TRAP, RECORDED BECAUSE IT COST A WHOLE INVESTIGATION IN THE PROJECT THIS CAME FROM: `kubectl auth can-i get pods/log` answered YES for a service account whose real request then got 403. Do not verify exec or log access with an access review — make the call with the real token.

func (*Driver) ExecContainer ¶ added in v0.110.0

func (d *Driver) ExecContainer(ctx context.Context, ref provision.Ref, container string, cmd []string, stdin io.Reader, stdout, stderr io.Writer) error

ExecContainer implements provision.ContainerExecer: Exec, into the named container of the instance's pod (a key holder's) rather than its own.

func (*Driver) ExecTTY ¶

func (d *Driver) ExecTTY(ctx context.Context, ref provision.Ref, cmd []string, stdin io.Reader, stdout io.Writer, resize <-chan provision.TermSize) error

ExecTTY implements provision.TTYExecer: the command runs on a pseudo-terminal in the instance's container, with stderr merged into stdout by the terminal and every size from resize applied to it.

🔴 stdin IS ALWAYS ATTACHED, EVEN WHEN THE CALLER NEVER WRITES TO IT. A read-only viewer still needs a terminal whose input is open, because a process that sees its stdin close may exit (tmux's client does), and the caller decides what reaches stdin — not this method.

func (*Driver) Get ¶

func (d *Driver) Get(ctx context.Context, ref provision.Ref) (provision.Instance, error)

Get implements provision.Provisioner.

🔴 IT REFUSES A WORKLOAD THIS DRIVER DID NOT CREATE, rather than describing it as an instance. A Deployment is fetched BY NAME, so without the ownership check inside getOwnedDeployment any workload sharing an instance's name — a chart release, somebody else's app — comes back as a muster Instance, with a phase, a pod name and a restart count that belong to a stranger.

func (*Driver) List ¶

func (d *Driver) List(ctx context.Context) ([]provision.Instance, error)

List implements provision.Provisioner.

🔴 IT RETURNS AN ERROR, NEVER AN EMPTY SLICE, WHEN THE API CANNOT BE REACHED. Both reads below go through blind(). The caller's fallback to stored status depends on being able to tell "nothing is running" from "I cannot see".

func (*Driver) Scale ¶

func (d *Driver) Scale(ctx context.Context, ref provision.Ref, replicas int) error

Scale implements provision.Provisioner.

func (*Driver) StreamLogs ¶

func (d *Driver) StreamLogs(ctx context.Context, ref provision.Ref, emit func(string)) error

StreamLogs implements provision.Provisioner.

An instance with no pod yet streams nothing and returns no error: "there is nothing to read yet" is not a failure. An instance that does not exist is ErrNotFound.

func (*Driver) Update ¶

func (d *Driver) Update(ctx context.Context, spec provision.Spec) error

Update implements provision.Provisioner.

âš  IT CREATES WHEN ABSENT, BUT IT DOES NOT ADOPT. A Deployment already holding this name that muster did not create is refused before anything is written: "make it look like this" is not a licence to take over somebody else's workload, and apply's first write would otherwise land before the Deployment upsert refused.

type NamespaceRoleBindingConfig ¶ added in v0.123.0

type NamespaceRoleBindingConfig struct {
	// ClusterRole is the ClusterRole bound inside each per-instance namespace.
	ClusterRole string
	// ServiceAccountNamespace and ServiceAccountName are muster's own
	// ServiceAccount — the RoleBinding's one subject.
	ServiceAccountNamespace string
	ServiceAccountName      string
}

NamespaceRoleBindingConfig turns on the least-privilege RBAC layout: instead of holding cluster-wide rights on every object it creates, muster's ServiceAccount holds cluster-wide rights on NAMESPACES and on RoleBindings only, plus `bind` on ONE named ClusterRole, and grants itself that ClusterRole inside each per-instance namespace with a RoleBinding — written immediately after the namespace and before any other object in it.

The cluster-wide grant a deployment then needs is NamespaceRoleBindingClusterRBAC; the ClusterRole named here holds the namespaced verbs (serviceaccounts, secrets, configmaps, services, PVCs, deployments, pods, pods/log, pods/exec, networkpolicies).

🔴 IT REQUIRES Config.NamespacePerInstance. In the shared layout there is no namespace muster creates, so there is nowhere for it to bind itself; the operator grants a Role in the shared namespace directly. New refuses the combination.

⚠ WHAT THE NARROW GRANT STILL ALLOWS, NAMED SO IT IS NOT READ AS MORE: `create` on rolebindings is cluster-wide (the namespaces are dynamic), so the ServiceAccount can bind ITSELF to ClusterRole inside ANY namespace — kube-system included — and so reach that namespace's Secrets in two deliberate, audited steps instead of one standing permission. Kubernetes RBAC cannot scope a grant by namespace-name pattern; closing that needs an admission policy that restricts this ServiceAccount's RoleBindings to namespaces under the prefix (docs/provisioner.md carries an example).

type NetworkPolicyConfig ¶

type NetworkPolicyConfig struct {
	// ControllerNamespace is the namespace muster itself runs in — the ONLY
	// namespace an isolated instance accepts connections from. REQUIRED.
	ControllerNamespace string
	// ControllerPodLabels select muster's own pods inside that namespace.
	// REQUIRED and non-empty: an empty pod selector selects EVERY pod in the
	// namespace, which would admit muster's database and its backup jobs as
	// callers of an agent.
	ControllerPodLabels map[string]string
	// DNSNamespace and DNSPodLabels select the cluster's DNS pods. Empty means
	// [DefaultDNSNamespace] and [DefaultDNSPodLabels].
	DNSNamespace string
	DNSPodLabels map[string]string
}

NetworkPolicyConfig is what the driver needs to know about the CLUSTER to turn a provision.Network into a NetworkPolicy. Its presence on Config is what raises Capabilities.NetworkIsolation.

🔴 A NetworkPolicy IS A DECLARATION, AND THIS DRIVER DOES NOT ENFORCE IT. The cluster's network plugin does, or does not: on a cluster whose plugin implements no NetworkPolicy the object below is accepted by the apiserver and changes nothing. Nothing in this package can observe which cluster it is on. Setting this field is the operator's statement that the plugin enforces.

Jump to

Keyboard shortcuts

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