Skip to content

Commit

Permalink
Use restricted namespace for opensource apiserver (#3489)
Browse files Browse the repository at this point in the history
* use restricted namespace for opensource apiserver

* when hostNetwork is required, use PSSPrivileged namespace label
  • Loading branch information
mihivagyok committed Oct 2, 2024
1 parent 3c92482 commit 112f043
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/render/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,13 @@ func (c *apiServerComponent) Objects() ([]client.Object, []client.Object) {
namespacedEnterpriseObjects = append(namespacedEnterpriseObjects, c.cfg.TrustedBundle.ConfigMap(QueryserverNamespace))
}

podSecurityNamespaceLabel := PodSecurityStandard(PSSRestricted)
if c.hostNetwork() {
podSecurityNamespaceLabel = PSSPrivileged
}
// Global OSS-only objects.
globalCalicoObjects := []client.Object{
CreateNamespace(rmeta.APIServerNamespace(operatorv1.Calico), c.cfg.Installation.KubernetesProvider, PSSPrivileged),
CreateNamespace(rmeta.APIServerNamespace(operatorv1.Calico), c.cfg.Installation.KubernetesProvider, podSecurityNamespaceLabel),
}

// Compile the final arrays based on the variant.
Expand Down

0 comments on commit 112f043

Please sign in to comment.