Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make NET_ADMIN check a warning, add PSP check #2958

Merged
merged 1 commit into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions pkg/healthcheck/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,13 @@ func (hc *HealthChecker) allCategories() []category {
return hc.checkCanCreate("", "apiextensions.k8s.io", "v1beta1", "customresourcedefinitions")
},
},
{
description: "can create PodSecurityPolicies",
hintAnchor: "pre-k8s",
check: func(context.Context) error {
return hc.checkCanCreate(hc.ControlPlaneNamespace, "policy", "v1beta1", "podsecuritypolicies")
},
},
{
description: "can create ServiceAccounts",
hintAnchor: "pre-k8s",
Expand Down Expand Up @@ -352,6 +359,7 @@ func (hc *HealthChecker) allCategories() []category {
{
description: "has NET_ADMIN capability",
hintAnchor: "pre-k8s-cluster-net-admin",
warning: true,
check: func(context.Context) error {
return hc.checkNetAdmin()
},
Expand Down Expand Up @@ -408,7 +416,7 @@ func (hc *HealthChecker) allCategories() []category {
checkers: []checker{
{
description: "control plane components ready",
hintAnchor: "l5d-existence-psp",
hintAnchor: "l5d-existence-psp", // needs https://github.com/linkerd/website/issues/272
fatal: true,
check: func(context.Context) error {
controlPlaneReplicaSet, err := hc.kubeAPI.GetReplicaSets(hc.ControlPlaneNamespace)
Expand All @@ -420,7 +428,7 @@ func (hc *HealthChecker) allCategories() []category {
},
{
description: "no unschedulable pods",
hintAnchor: "l5d-existence-unschedulable-pods",
hintAnchor: "l5d-existence-unschedulable-pods", // needs https://github.com/linkerd/website/issues/272
fatal: true,
check: func(context.Context) error {
// do not save this into hc.controlPlanePods, as this check may
Expand Down Expand Up @@ -1005,7 +1013,7 @@ func (hc *HealthChecker) checkNetAdmin() error {
}
}

return fmt.Errorf("found %d PodSecurityPolicies, but none provide NET_ADMIN", len(pspList.Items))
return fmt.Errorf("found %d PodSecurityPolicies, but none provide NET_ADMIN, proxy injection will fail if the PSP admission controller is running", len(pspList.Items))
}

func (hc *HealthChecker) checkClockSkew() error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/healthcheck/healthcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ spec:
requiredDropCapabilities:
- ALL`,
},
fmt.Errorf("found 1 PodSecurityPolicies, but none provide NET_ADMIN"),
fmt.Errorf("found 1 PodSecurityPolicies, but none provide NET_ADMIN, proxy injection will fail if the PSP admission controller is running"),
},
}

Expand Down
1 change: 1 addition & 0 deletions test/testdata/check.pre.golden
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pre-kubernetes-setup
√ can create ClusterRoles
√ can create ClusterRoleBindings
√ can create CustomResourceDefinitions
√ can create PodSecurityPolicies
√ can create ServiceAccounts
√ can create Services
√ can create Deployments
Expand Down