Skip to content

Instantly share code, notes, and snippets.

@fenar
Created August 27, 2024 16:11
Show Gist options
  • Save fenar/132b8d51e41e531d88463c07b9080d32 to your computer and use it in GitHub Desktop.
Save fenar/132b8d51e41e531d88463c07b9080d32 to your computer and use it in GitHub Desktop.
#Issue: fenar@macpro71 elastic % oc logs -n openshift-logging elasticsearch-cdm-9p1cy8c7-1-655b488ddd-hcnds --all-containers
cp: cannot create regular file '/etc/elasticsearch/elasticsearch.yml': Permission denied
cp: cannot create regular file '/etc/elasticsearch/log4j2.properties': Permission denied
#check your scc in use for the proplem pod
% oc get pod elasticsearch-cdm-9p1cy8c7-1-655b488ddd-hcnds -o yaml | grep scc
openshift.io/scc: anyuid
#edit your scc RunAsUser to MustRunAsRange OR use a different SCC with RUNASUSER set to MustRunAsRange
% oc edit scc anyuid
> Change RUNASUSER to a value of MustRunAsRange
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment