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

Support OpenShift #424

Open
12 of 13 tasks
ezbz opened this issue Feb 23, 2021 · 10 comments
Open
12 of 13 tasks

Support OpenShift #424

ezbz opened this issue Feb 23, 2021 · 10 comments
Labels
kind/epic Categorizes issue as an epic. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@ezbz
Copy link

ezbz commented Feb 23, 2021

Tasks

Preview Give feedback
  1. kind/feature priority/important-soon triage/accepted
    tnozicka
  2. kind/feature priority/important-soon
    tnozicka
  3. kind/bug priority/important-soon
    tnozicka
  4. kind/bug priority/important-soon
    tnozicka
  5. kind/feature priority/important-soon triage/accepted
    tnozicka
  6. kind/cleanup priority/important-soon
  7. kind/feature priority/important-soon triage/accepted
    rzetelskik
  8. kind/failing-test priority/important-soon
    zimnx
  9. kind/failing-test priority/important-soon
    zimnx
@ezbz ezbz added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 23, 2021
@ezbz ezbz added this to the 2.x milestone Feb 23, 2021
@cgruver
Copy link

cgruver commented Mar 6, 2021

I have an interim solution here, but it will need some work to conform to the higher security requirements of OpenShift.

  1. The operator needs to run with anyuid privileges because it wants to bind to port 443.
  2. Need to set scyllaclusters/finalizers with update privilege on the cluster member ROLE.
  3. The cluster service account needs to run with the privileged SCC so that it can access SYS_NICE.

You can find a working example here: https://github.com/lab-monkeys/home-library-tutorial under the Scylla folder.

It still needs more work, so I'll update with progress.

@cgruver
Copy link

cgruver commented Mar 7, 2021

I have ScyllaDB clusters running in OpenShift 4.6.

The Pod security still needs some work so that the Pods don't have to run as privileged containers, but it's a start.

The working example is here:

https://github.com/lab-monkeys/home-library-tutorial/tree/main/Scylla

oc apply -f cert-manager.yaml

oc apply -f operator.yaml
oc apply -f cluster-cql.yaml
oc apply -f cluster-dynamo.yaml

I'm running on a bare-metal cluster, so eventually I should be able to tune it for all of the performance tweaks that ScyllaDB needs.

@tnozicka
Copy link
Contributor

tnozicka commented Mar 8, 2021

The operator needs to run with anyuid privileges because it wants to bind to port 443.

We shouldn't listen on 443, the service should handle the redirection and we should listen on unprivileged port. Feel free to file a separate issue there, I think we could fix that sooner than we support OCP.

@cortopy
Copy link

cortopy commented Jul 4, 2021

I don't use Openshift, but I have a hardened cluster with strict security policies. For those that are in the same situation, this was enough for me. There are two lines that are the key:

apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
  name: scylla
  labels:
    {{- include "scylla-extras.labels" . | nindent 4 }}
  annotations:
    seccomp.security.alpha.kubernetes.io/allowedProfileNames: "docker/default,runtime/default"
    apparmor.security.beta.kubernetes.io/allowedProfileNames: "runtime/default"
    seccomp.security.alpha.kubernetes.io/defaultProfileName: "runtime/default"
    apparmor.security.beta.kubernetes.io/defaultProfileName: "runtime/default"
spec:
  allowPrivilegeEscalation: false
  allowedCapabilities:
    - SYS_NICE # Fix 1
  volumes:
    - "configMap"
    - "emptyDir"
    - "projected"
    - "secret"
    - "downwardAPI"
    - "persistentVolumeClaim"
  hostNetwork: false
  hostIPC: false
  hostPID: false
  runAsUser:
    rule: "RunAsAny" # Fix 2
  seLinux:
    rule: "RunAsAny"
  supplementalGroups:
    rule: "MustRunAs"
    ranges:
      - min: 1
        max: 65535
  fsGroup:
    rule: "MustRunAs"
    ranges:
      - min: 1

SYS_NICE (Fix 1) capability is understandable

However, I have to allow scylla pods to run as root (fix number 2), which feels like an overkill and a source of potential vulnerablities

@tnozicka
Copy link
Contributor

tnozicka commented Jul 7, 2021

I think the root privs are for tuning devices and setting sysctl which are done on scylla startup

@gautam-borkar
Copy link

I tried the step mentioned above and assigned privileged role for serviceaccount. But getting this error :-
image

Running the command gives below output :-

kubectl -n scylla get pods -l "app.kubernetes.io/name=scylla-incident-mgmt"
No resources found in scylla namespace.

@tnozicka
Copy link
Contributor

tnozicka commented Aug 24, 2022

Running the command gives below output :-

the label selector seems wrong - it should be "app.kubernetes.io/name=scylla", not "app.kubernetes.io/name=scylla-incident-mgmt"

Some actionable info would be say oc get events --sort-by=.metadata.creationTimestamp or the pod's yaml if it gets created or operator logs if there are failures.

But in this case, as it's a feature, this is primarily waiting for cycles from one of the team members to go and try when we decide to support the platform, I assume we'd be almost certain to hit all those issues as well.

@mykaul
Copy link
Contributor

mykaul commented Mar 14, 2023

Depends on #713

@tnozicka tnozicka removed this from the v2.x milestone Aug 16, 2023
@tnozicka tnozicka added kind/epic Categorizes issue as an epic. and removed kind/feature Categorizes issue or PR as related to a new feature. labels May 3, 2024
@tnozicka tnozicka added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Jun 25, 2024
@tnozicka tnozicka self-assigned this Jun 25, 2024
Copy link
Contributor

The Scylla Operator project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 30d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out

/lifecycle stale

@scylla-operator-bot scylla-operator-bot bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 29, 2024
@tnozicka
Copy link
Contributor

/remove-lifecycle stale
/triage accepted

@scylla-operator-bot scylla-operator-bot bot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/epic Categorizes issue as an epic. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

6 participants