Failure when installing sysdig agent from OSX into OCP
AMarti96 opened this issue · 3 comments
I have been trying to install sysdig agents in my OCP cluster running in IBMCloud via the following script: https://github.com/draios/sysdig-cloud-scripts/blob/master/agent_deploy/IBMCloud-Kubernetes-Service/install-agent-k8s.sh
Unfortunatelly, when running it from a macOS, I am facing the following issue. As a result, the agent installation does not finish and my cluster is not sending any metric at all.
Logs:
* Detecting operating system
* Downloading yamls files to the temp directory: /tmp/sysdig-agent-k8s.taQ1HL
* Downloading Sysdig cluster role yaml
* Downloading Sysdig config map yaml
* Downloading Sysdig daemonset v2 yaml
* Downloading Sysdig daemonset slim v2 yaml
* Downloading Sysdig kmod-thin-agent-slim daemonset
* Creating project: ibm-observe
oc adm new-project failed!
error: project ibm-observe already exists. Continuing...
* Creating sysdig-agent serviceaccount in project: ibm-observe
* Creating sysdig-agent clusterrole
clusterrole.rbac.authorization.k8s.io/sysdig-agent created
* Creating sysdig-agent access policies
* Creating sysdig-agent secret using the ACCESS_KEY provided
* Retrieving the Cluster ID and Cluster Name
* Setting cluster name as XXXX
* Setting ibm.containers-kubernetes.cluster.id XXXXXX
* Updating agent configmap and applying to cluster
* Setting tags
* Setting collector endpoint
* Adding additional configuration to dragent.yaml
* Enabling Prometheus
configmap/sysdig-agent created
Slim agent selected
sed: -e: No such file or directory
note the error with sed
at the end. I suspect it comes from this line here: https://github.com/draios/sysdig-cloud-scripts/blob/master/agent_deploy/IBMCloud-Kubernetes-Service/install-agent-k8s.sh#L391
but I haven't been able to find a workaround for it
Found it! In line https://github.com/draios/sysdig-cloud-scripts/blob/master/agent_deploy/IBMCloud-Kubernetes-Service/install-agent-k8s.sh#L398
to make it compatible with macOS it should be one of the following
sed -i.bak -e "s|\( *image: \).*sysdig/agent-slim\(.*\)|\1${REGISTRY}/${AGENT_SLIM_REPOSITORY}:${AGENT_VERSION}|g;s|\( *image: \).*sysdig/agent-kmodule\(.*\)|\1${REGISTRY}/${AGENT_KMOD_REPOSITORY}:${AGENT_VERSION}|g" "${DAEMONSET_FILE}"
or
sed -i.bak -e "s|\( *image: \).*sysdig/agent-slim\(.*\)|\1${REGISTRY}/${AGENT_SLIM_REPOSITORY}:${AGENT_VERSION}|g" $DAEMONSET_FILE
sed -i.bak -e "s|\( *image: \).*sysdig/agent-kmodule\(.*\)|\1${REGISTRY}/${AGENT_KMOD_REPOSITORY}:${AGENT_VERSION}|g" $DAEMONSET_FILE
Facing the same thing, can this get fixed please?