-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1511 from VedRatan/user-debug-docs
docs: Added guide for the error which occurs during installation of Kubearmor
- Loading branch information
Showing
3 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
labels: | ||
kubearmor-app: updater | ||
name: updater | ||
namespace: kubearmor | ||
spec: | ||
revisionHistoryLimit: 10 | ||
selector: | ||
matchLabels: | ||
kubearmor-app: updater | ||
template: | ||
metadata: | ||
labels: | ||
kubearmor-app: updater | ||
spec: | ||
containers: | ||
- args: | ||
- | | ||
grep "bpf" /rootfs/sys/kernel/security/lsm >/dev/null | ||
[[ $? -eq 0 ]] && echo "sysfs already has BPF enabled" && sleep infinity | ||
grep "GRUB_CMDLINE_LINUX.*bpf" /rootfs/etc/default/grub >/dev/null | ||
[[ $? -eq 0 ]] && echo "grub already has BPF enabled" && sleep infinity | ||
cat <<EOF >/rootfs/updater.sh | ||
#!/bin/bash | ||
lsmlist=\$(cat /sys/kernel/security/lsm) | ||
echo "current lsmlist=\$lsmlist" | ||
sed -i "s/^GRUB_CMDLINE_LINUX=.*$/GRUB_CMDLINE_LINUX=\"lsm=\$lsmlist,bpf\"/g" /etc/default/grub | ||
command -v grub2-mkconfig >/dev/null 2>&1 && grub2-mkconfig -o /boot/grub2.cfg | ||
command -v grub-mkconfig >/dev/null 2>&1 && grub-mkconfig -o /boot/grub.cfg | ||
command -v aa-status >/dev/null 2>&1 || yum install apparmor-utils -y | ||
command -v update-grub >/dev/null 2>&1 && update-grub | ||
command -v update-grub2 >/dev/null 2>&1 && update-grub2 | ||
reboot | ||
EOF | ||
cat /rootfs/updater.sh | ||
chmod +x /rootfs/updater.sh | ||
chroot /rootfs/ /bin/bash /updater.sh | ||
image: debian | ||
command: | ||
- "bash" | ||
- "-c" | ||
imagePullPolicy: Always | ||
name: updater | ||
resources: {} | ||
securityContext: | ||
privileged: true | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
volumeMounts: | ||
- mountPath: /rootfs | ||
mountPropagation: HostToContainer | ||
name: rootfs | ||
readOnly: false | ||
dnsPolicy: ClusterFirstWithHostNet | ||
hostNetwork: true | ||
hostPID: true | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
restartPolicy: Always | ||
schedulerName: default-scheduler | ||
securityContext: {} | ||
terminationGracePeriodSeconds: 30 | ||
tolerations: | ||
- operator: Exists | ||
volumes: | ||
- hostPath: | ||
path: / | ||
type: DirectoryOrCreate | ||
name: rootfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters