Support appArmor and seLinux options to gitaly security context

What does this MR do?

This MR adds the possibility to specify seLinuxOptions labels and appArmorProfile in gitaly deployment.

I put this issue as related since this is somehow related to the cgroups configuration.

For systems like OpenShift, the following configuration is possible:

No need for io.kubernetes.cri-o.cgroup2-mount-hierarchy-rw annotation at the host level (or configured via a machine config)

init-cgroups init container configuration:

initContainers:
- name: init-cgroups
  securityContext:
    runAsGroup: 0
    runAsUser: 0
    seLinuxOptions:
      type: spc_t
...

gitaly container configuration:

containers:
  name: gitaly
  securityContext:
    allowPrivilegeEscalation: false
    capabilities:
      drop:
      - ALL
    runAsNonRoot: true
    runAsUser: 1000
    seLinuxOptions:
      type: spc_t
...

Therefore, adding the possibility to configure seLinuxOptions in the gitaly chart is convenient (it may serve for other purposes).

Author checklist

For general guidance, please follow our Contributing guide.

Required

For anything in this list which will not be completed, please provide a reason in the MR discussion.

  • Merge Request Title and Description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • MR has a green pipeline.
  • Documentation created/updated.
  • Tests added/updated, and test plan for scenarios not covered by automated tests.
  • Equivalent MR/issue for omnibus-gitlab opened.

Reviewers checklist

Edited by Clemens Beck

Merge request reports

Loading
Loading