Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
7d6ef614
Unverified
Commit
7d6ef614
authored
5 years ago
by
Pasquale Toscano
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix metallb speaker when podsecuritypolicy_enabled=true (#5932) (#5933)
parent
6a7c3c6e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/metallb/roles/provision/tasks/main.yml
+17
-0
17 additions, 0 deletions
contrib/metallb/roles/provision/tasks/main.yml
contrib/metallb/roles/provision/templates/metallb.yml.j2
+42
-0
42 additions, 0 deletions
contrib/metallb/roles/provision/templates/metallb.yml.j2
with
59 additions
and
0 deletions
contrib/metallb/roles/provision/tasks/main.yml
+
17
−
0
View file @
7d6ef614
...
@@ -4,6 +4,22 @@
...
@@ -4,6 +4,22 @@
msg
:
"
MetalLB
require
kube_proxy_strict_arp
=
true,
see
https://github.com/danderson/metallb/issues/153#issuecomment-518651132"
msg
:
"
MetalLB
require
kube_proxy_strict_arp
=
true,
see
https://github.com/danderson/metallb/issues/153#issuecomment-518651132"
when
:
when
:
-
"
kube_proxy_mode
==
'ipvs'
and
not
kube_proxy_strict_arp"
-
"
kube_proxy_mode
==
'ipvs'
and
not
kube_proxy_strict_arp"
-
name
:
Kubernetes Apps | Check AppArmor status
command
:
which apparmor_parser
register
:
apparmor_status
when
:
-
podsecuritypolicy_enabled
-
inventory_hostname == groups['kube-master'][0]
failed_when
:
false
-
name
:
Kubernetes Apps | Set apparmor_enabled
set_fact
:
apparmor_enabled
:
"
{{
apparmor_status.rc
==
0
}}"
when
:
-
podsecuritypolicy_enabled
-
inventory_hostname == groups['kube-master'][0]
-
name
:
"
Kubernetes
Apps
|
Lay
Down
MetalLB"
-
name
:
"
Kubernetes
Apps
|
Lay
Down
MetalLB"
become
:
true
become
:
true
template
:
{
src
:
"
{{
item
}}.j2"
,
dest
:
"
{{
kube_config_dir
}}/{{
item
}}"
}
template
:
{
src
:
"
{{
item
}}.j2"
,
dest
:
"
{{
kube_config_dir
}}/{{
item
}}"
}
...
@@ -11,6 +27,7 @@
...
@@ -11,6 +27,7 @@
register
:
"
rendering"
register
:
"
rendering"
when
:
when
:
-
"
inventory_hostname
==
groups['kube-master'][0]"
-
"
inventory_hostname
==
groups['kube-master'][0]"
-
name
:
"
Kubernetes
Apps
|
Install
and
configure
MetalLB"
-
name
:
"
Kubernetes
Apps
|
Install
and
configure
MetalLB"
kube
:
kube
:
name
:
"
MetalLB"
name
:
"
MetalLB"
...
...
This diff is collapsed.
Click to expand it.
contrib/metallb/roles/provision/templates/metallb.yml.j2
+
42
−
0
View file @
7d6ef614
...
@@ -50,6 +50,48 @@ rules:
...
@@ -50,6 +50,48 @@ rules:
- apiGroups: [""]
- apiGroups: [""]
resources: ["services", "endpoints", "nodes"]
resources: ["services", "endpoints", "nodes"]
verbs: ["get", "list", "watch"]
verbs: ["get", "list", "watch"]
{% if podsecuritypolicy_enabled %}
- apiGroups: ["policy"]
resourceNames: ["metallb"]
resources: ["podsecuritypolicies"]
verbs: ["use"]
---
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: metallb
annotations:
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
{% if apparmor_enabled %}
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
{% endif %}
labels:
app: metallb
spec:
privileged: true
allowPrivilegeEscalation: false
allowedCapabilities:
- net_raw
volumes:
- secret
hostNetwork: true
hostPorts:
- min: {{ metallb.port }}
max: {{ metallb.port }}
hostIPC: false
hostPID: false
runAsUser:
rule: 'RunAsAny'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'RunAsAny'
fsGroup:
rule: 'RunAsAny'
readOnlyRootFilesystem: true
{% endif %}
---
---
apiVersion: rbac.authorization.k8s.io/v1
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
kind: Role
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment