|
| 1 | +# Deploy NetApp Neo on OpenShift |
| 2 | + |
| 3 | +This guide describes how to deploy this chart on OpenShift with the new security model: |
| 4 | + |
| 5 | +- Restricted-v2 baseline for the application |
| 6 | +- Mandatory privileged exceptions for `worker` and `extractor` to access remote file systems |
| 7 | +- Helm validation enforces this mode during render/install |
| 8 | + |
| 9 | +## 1. Prerequisites |
| 10 | + |
| 11 | +- OpenShift cluster access (`oc`) |
| 12 | +- Helm 3 |
| 13 | +- Cluster admin support for SCC binding (required for privileged worker/extractor mode) |
| 14 | +- Target namespace exists, example: `neo-poc` |
| 15 | + |
| 16 | +Select your target namespace: |
| 17 | + |
| 18 | +```bash |
| 19 | +oc project neo-poc |
| 20 | +``` |
| 21 | + |
| 22 | +Prepare OpenShift values override file: |
| 23 | + |
| 24 | +```bash |
| 25 | +cat > values-openshift.yaml <<'EOF' |
| 26 | +openshift: |
| 27 | + restrictedV2: |
| 28 | + enabled: true |
| 29 | + api: |
| 30 | + serviceAccount: |
| 31 | + create: true |
| 32 | + name: "" |
| 33 | + annotations: {} |
| 34 | + ui: |
| 35 | + serviceAccount: |
| 36 | + create: true |
| 37 | + name: "" |
| 38 | + annotations: {} |
| 39 | + privilegedWorkloads: |
| 40 | + worker: |
| 41 | + enabled: true |
| 42 | + serviceAccount: |
| 43 | + create: true |
| 44 | + name: "" |
| 45 | + annotations: {} |
| 46 | + extractor: |
| 47 | + enabled: true |
| 48 | + serviceAccount: |
| 49 | + create: true |
| 50 | + name: "" |
| 51 | + annotations: {} |
| 52 | +EOF |
| 53 | +``` |
| 54 | + |
| 55 | +## 2. Deployment Mode |
| 56 | + |
| 57 | +### Restricted-v2 + privileged exceptions (worker/extractor) |
| 58 | + |
| 59 | +This is the required deployment mode for this application because `worker` and `extractor` |
| 60 | +must mount filesystems inside the pod. |
| 61 | + |
| 62 | +Required chart behavior: |
| 63 | + |
| 64 | +- `openshift.restrictedV2.enabled=true` |
| 65 | +- `openshift.privilegedWorkloads.worker.enabled=true` |
| 66 | +- `openshift.privilegedWorkloads.extractor.enabled=true` |
| 67 | + |
| 68 | +These are enforced by chart validation. Helm will fail if any are set to `false`. |
| 69 | + |
| 70 | +Deploy: |
| 71 | + |
| 72 | +```bash |
| 73 | +helm upgrade --install netapp-neo innovation-labs/netapp-neo \ |
| 74 | + -n neo-poc \ |
| 75 | + -f ./netapp-neo/values.yaml \ |
| 76 | + -f ./values-openshift.yaml \ |
| 77 | + --wait --timeout 10m --rollback-on-failure |
| 78 | +``` |
| 79 | + |
| 80 | +If you maintain a platform-specific values file, keep this OpenShift block there. |
| 81 | + |
| 82 | +## 3. Bind SCC for Privileged Exception Service Accounts |
| 83 | + |
| 84 | +In this mode, the chart creates service accounts: |
| 85 | + |
| 86 | +- `netapp-neo-netapp-neo-api` |
| 87 | +- `netapp-neo-netapp-neo-ui` |
| 88 | +- `netapp-neo-netapp-neo-worker-privileged` |
| 89 | +- `netapp-neo-netapp-neo-extractor-privileged` |
| 90 | + |
| 91 | +Bind an SCC that permits required behavior (example shown with `privileged`; use a narrower custom SCC if possible): |
| 92 | + |
| 93 | +```bash |
| 94 | +oc adm policy add-scc-to-user privileged \ |
| 95 | + -z netapp-neo-netapp-neo-worker-privileged \ |
| 96 | + -n neo-poc |
| 97 | + |
| 98 | +oc adm policy add-scc-to-user privileged \ |
| 99 | + -z netapp-neo-netapp-neo-extractor-privileged \ |
| 100 | + -n neo-poc |
| 101 | +``` |
| 102 | + |
| 103 | +If you set custom service account names in values: |
| 104 | + |
| 105 | +- `openshift.api.serviceAccount.name` |
| 106 | +- `openshift.ui.serviceAccount.name` |
| 107 | +- `openshift.privilegedWorkloads.worker.serviceAccount.name` |
| 108 | +- `openshift.privilegedWorkloads.extractor.serviceAccount.name` |
| 109 | + |
| 110 | +use those names in the `oc adm policy` commands. |
| 111 | + |
| 112 | +If you set `serviceAccount.create=false`, ensure those service accounts already exist in the namespace. |
| 113 | + |
| 114 | +## 4. Verify Deployment |
| 115 | + |
| 116 | +Check pods: |
| 117 | + |
| 118 | +```bash |
| 119 | +oc get pods -n neo-poc |
| 120 | +``` |
| 121 | + |
| 122 | +Check service account used by api/ui/worker/extractor: |
| 123 | + |
| 124 | +```bash |
| 125 | +oc get deploy netapp-neo-netapp-neo-api -n neo-poc -o jsonpath='{.spec.template.spec.serviceAccountName}{"\n"}' |
| 126 | +oc get deploy netapp-neo-netapp-neo-ui -n neo-poc -o jsonpath='{.spec.template.spec.serviceAccountName}{"\n"}' |
| 127 | +oc get deploy netapp-neo-netapp-neo-worker -n neo-poc -o jsonpath='{.spec.template.spec.serviceAccountName}{"\n"}' |
| 128 | +oc get deploy netapp-neo-netapp-neo-extractor -n neo-poc -o jsonpath='{.spec.template.spec.serviceAccountName}{"\n"}' |
| 129 | +``` |
| 130 | + |
| 131 | +Check events for SCC admission issues: |
| 132 | + |
| 133 | +```bash |
| 134 | +oc get events -n neo-poc --sort-by=.lastTimestamp | tail -n 50 |
| 135 | +``` |
| 136 | + |
| 137 | +Confirm API deployment does not render forbidden fixed IDs or explicit seccomp: |
| 138 | + |
| 139 | +```bash |
| 140 | +oc get deploy netapp-neo-netapp-neo-api -n neo-poc -o yaml | grep -E "runAsUser|runAsGroup|fsGroup|seccompProfile" -n |
| 141 | +``` |
| 142 | + |
| 143 | +## 5. Troubleshooting |
| 144 | + |
| 145 | +If pods are blocked by SCC: |
| 146 | + |
| 147 | +- Confirm privileged exception flags are enabled as required. |
| 148 | +- Confirm SCC binding exists for the exact service account names. |
| 149 | +- Confirm namespace in `oc adm policy` matches deployment namespace. |
| 150 | +- Confirm api/ui/worker/extractor serviceAccountName values in the live deployment are the expected service accounts. |
| 151 | +- Confirm worker/extractor service accounts are the ones bound to SCC. |
| 152 | +- Re-run Helm with `--wait --rollback-on-failure` to catch rollout failures clearly. |
| 153 | + |
| 154 | +Example inspection: |
| 155 | + |
| 156 | +```bash |
| 157 | +oc describe rs -n neo-poc | grep -E "forbidden|security context constraint|SCC|restricted-v2" -i |
| 158 | +``` |
| 159 | + |
| 160 | +## 6. Recommended Operational Practice |
| 161 | + |
| 162 | +- Keep this single enforced mode for OpenShift deployments. |
| 163 | +- Keep API and UI on dedicated non-privileged service accounts. |
| 164 | +- Grant elevated SCC only to `worker` and `extractor` service accounts. |
| 165 | +- Prefer a custom least-privilege SCC over broad `privileged` SCC when feasible. |
0 commit comments