question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

daemonset splunk-kubernetes-logging not started on openshift

See original GitHub issue

What happened:

When deploying SCK v1.4.3 using helm the daemonset for logging is not starting due to privileged container security settings.

What you expected to happen:

daemonset need to be startet to collect container logsfiles.

How to reproduce it (as minimally and precisely as possible):

start openshift playground: https://learn.openshift.com/playgrounds/openshift44/

oc create ns splunk-logging
oc config set-context --current --namespace=splunk-logging

helm install -f config.yml my-splunk-connect https://github.com/splunk/splunk-connect-for-kubernetes/releases/download/1.4.3/splunk-connect-for-kubernetes-1.4.3.tgz --namespace=splunk-logging

oc describe daemonset/my-splunk-connect-splunk-kubernetes-logging --namespace=splunk-logging

Errorevents:

 Warning  FailedCreate  27s (x14 over 68s)  daemonset-controller  Error creating: pods "my-splunk-connect-splunk-kubernetes-logging-" is forbidden: unable to validate against any security context constraint: [spec.volumes[0]: Invalid value: "hostPath": hostPath volumes are not allowed to be used spec.volumes[1]: Invalid value: "hostPath": hostPath volumes are not allowed to be used spec.volumes[2]: Invalid value: "hostPath": hostPath volumes are not allowed to be used spec.containers[0].securityContext.securityContext.runAsUser: Invalid value: 0: must be in the ranges: [1000160000, 1000169999] spec.containers[0].securityContext.privileged: Invalid value: true: Privileged containers are not allowed]

Anything else we need to know?:

To get this work you need to create a SecurityContextConstraints for the SA User. Example: https://github.com/schose/splunk-connect-for-kubernetes/blob/openshift/helm-chart/splunk-connect-for-kubernetes/charts/splunk-kubernetes-logging/templates/ssc.yaml

unfortunately this breaks “helm install” functionality. “helm template” + “oc apply” is working…

Environment:

  • Kubernetes version (use kubectl version):
$ oc  version
Client Version: 4.4.0-202005290638-1960dd7
Server Version: 4.4.8
Kubernetes Version: v1.17.1+3f6f40d
  • Ruby version (use ruby --version):
  • OS (e.g: cat /etc/os-release):
  • Splunk version:
  • Others:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
shane-emerycommented, Jan 21, 2021

This got it working for me.

  1. readd line 49
  2. oc adm policy add-scc-to-user privileged system:serviceaccount:splunk-connect:splunk-kubernetes-logging
0reactions
github-actions[bot]commented, Dec 2, 2021

This issue was closed because it has been inactive for 14 days since being marked as stale.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Splunk Connect for OpenShift - Logging - Red Hat Hybrid Cloud
Splunk Kubernetes Logging uses the Kubernetes node logging agent to collect logs. Splunk deploys a daemonset on each of these nodes.
Read more >
Collect OpenShift metrics and logs with Splunk App for ...
Use the easy install script script to start collecting metrics and log data from an OpenShift cluster. When you run the script, you...
Read more >
How To Send OpenShift Logs and Events to Splunk
One DaemonSet on each OpenShift node for logs collection. The actual implementation will be as shown in the diagram below. openshift logging ...
Read more >
Running background tasks on nodes automatically with ...
Inconsistent pod behavior: Normal pods waiting to be scheduled are created and in Pending state, but daemon set pods are not created in...
Read more >
Setting up Splunk Connect for Kubernetes on Openshift 4.x ...
splunk-kubernetes-logging – this chart simply configures Splunk to read all container (stdout) logs, usually this is the only one you'll really ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found