|
| 1 | +--- |
| 2 | +title: Deploying the OpenTelemetry Collector in Kubernetes using a NameSpace |
| 3 | +linkTitle: Prep UI & Deploy the OTel Collector |
| 4 | +weight: 21 |
| 5 | +--- |
| 6 | +## 0. Switching to the new Kubernetes Navigator 2.0 UI |
| 7 | + |
| 8 | +As we are in the process of switched to the new generation of the Kubernetes Navigator please check if you are already on the new Kubernetes navigator. |
| 9 | + |
| 10 | +When you select `Kubernetes` as you focus, you should see a number of services panes for Kubernetes, similar like the ones below: |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +If you taken straight to the Kubernetes Navigator v1 after selecting `Kubernetes` in the right hand menu, you need to set the feature flag for the new Navigator yourself. |
| 15 | + |
| 16 | +To do this, please change the Url in your browser to match the following: |
| 17 | + |
| 18 | +https://app.[REALM].signalfx.com/#/Superpowers |
| 19 | + |
| 20 | +Were [REALM] needs to match the Realm we are running this workshop in. |
| 21 | + |
| 22 | +First make sure you have the Precognition flag set like the example below, this is one of the first options to set: |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +Then scroll down or search the list of features and find the option: `newKubernetesNavigators` and set it like below if it is not set already. |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +Once its set, you can refresh you page, and reselect kubernetes from the infrastructure navigator menu. |
| 31 | + |
| 32 | +{{% alert title="Note" color="info" %}} |
| 33 | +Be aware that your login may still be configured internally to use the original navigator on the underlying services. You will se that even with the new panes you still see parts of the old NAvigator. |
| 34 | + |
| 35 | +You can fix this by pressing the  button that will popup on the top right side of you screen if your still configured to use the old services. |
| 36 | + |
| 37 | +You may need to do this once per service type (Cluster/Nodes/Workloads). |
| 38 | +{{% /alert %}} |
| 39 | + |
| 40 | +## 1. Connect to EC2 instance |
| 41 | + |
| 42 | +You will be able to connect to the workshop instance by using SSH from your Mac, Linux or Windows device. |
| 43 | + |
| 44 | +To use SSH, open a terminal on your system and type `ssh [email protected]` (replacing x.x.x.x with the IP address assigned to you). |
| 45 | + |
| 46 | +{{% alert title="Note" color="info" %}} |
| 47 | +Your workshop instance has been pre-configured with the correct `ACCESS_TOKEN` and `REALM` for this workshop. There is no need for you to configure these. |
| 48 | +{{% /alert %}} |
| 49 | + |
| 50 | +## 2. Namespaces in Kubernetes |
| 51 | + |
| 52 | +Most of our customers will make use of some kind of private or public cloud service to run Kubernetes. They often choose to have only a few large Kubernetes clusters as it is easier to manage centrally. |
| 53 | + |
| 54 | +Namespaces are a way to organize these large Kubernetes clusters into virtual sub-clusters. This can be helpful when different teams or projects share a Kubernetes cluster as this will give them the easy ability to just see and work with their own stuff. |
| 55 | + |
| 56 | +Any number of namespaces are supported within a cluster, each logically separated from others but with the ability to communicate with each other. Components are only "visible" when selecting a namespace or when adding the `--all-namespaces` flag to `kubectl` instead of allowing you to view just the components relevant to your project by selecting your namespace. |
| 57 | + |
| 58 | +Most customers will want to install the Splunk OpenTelemetry Collector in a separate namespace. This workshop will follow that practice. |
| 59 | + |
| 60 | +## 3. Install Splunk OTel using Helm |
| 61 | + |
| 62 | +Install the OpenTelemetry Collector using the Splunk Helm chart. First, add the Splunk Helm chart repository and update. |
| 63 | + |
| 64 | +{{< tabpane >}} |
| 65 | +{{< tab header="Helm Repo Add" lang="text" >}} |
| 66 | +helm repo add splunk-otel-collector-chart https://signalfx.github.io/splunk-otel-collector-chart && helm repo update |
| 67 | +{{< /tab >}} |
| 68 | +{{< tab header="Helm Repo Add Output" lang="text" >}} |
| 69 | +Using ACCESS_TOKEN={REDACTED} |
| 70 | +Using REALM=eu0 |
| 71 | +"splunk-otel-collector-chart" has been added to your repositories |
| 72 | +Using ACCESS_TOKEN={REDACTED} |
| 73 | +Using REALM=eu0 |
| 74 | +Hang tight while we grab the latest from your chart repositories... |
| 75 | +...Successfully got an update from the "splunk-otel-collector-chart" chart repository |
| 76 | +Update Complete. ⎈Happy Helming!⎈ |
| 77 | +{{< /tab >}} |
| 78 | +{{< /tabpane >}} |
| 79 | + |
| 80 | +Install the OpenTelemetry Collector Helm chart into the `splunk` namespace with the following commands, do **NOT** edit this: |
| 81 | + |
| 82 | +{{< tabpane >}} |
| 83 | +{{< tab header="Helm Install" lang="text" >}} |
| 84 | +helm install splunk-otel-collector \ |
| 85 | +--version "0.68.0" \ |
| 86 | +--set="splunkObservability.realm=$REALM" \ |
| 87 | +--set="splunkObservability.accessToken=$ACCESS_TOKEN" \ |
| 88 | +--set="clusterName=$(hostname)-k3s-cluster" \ |
| 89 | +--set="splunkObservability.logsEnabled=true" \ |
| 90 | +--set="splunkObservability.infrastructureMonitoringEventsEnabled=true" \ |
| 91 | +splunk-otel-collector-chart/splunk-otel-collector \ |
| 92 | +--namespace splunk \ |
| 93 | +--create-namespace \ |
| 94 | +-f ~/splunk-defaults.yaml |
| 95 | + |
| 96 | +{{< /tab >}} |
| 97 | +{{< tab header="Helm Install Single Line" lang="bash" >}} |
| 98 | +helm install splunk-otel-collector --set="splunkObservability.realm=$REALM" --set="splunkObservability.accessToken=$ACCESS_TOKEN" --set="clusterName=$(hostname)-k3s-cluster" --set="splunkObservability.logsEnabled=true" --set="clusterReceiver.eventsEnabled=true" --set="splunkObservability.infrastructureMonitoringEventsEnabled=true" splunk-otel-collector-chart/splunk-otel-collector --namespace splunk --create-namespace |
| 99 | +{{< /tab >}} |
| 100 | +{{< /tabpane >}} |
| 101 | + |
| 102 | +## 4. Verify Deployment |
| 103 | + |
| 104 | +You can monitor the progress of the deployment by running `kubectl get pods` and adding `-n splunk` to the command to see the pods in the `splunk` NameSpace which should typically report that the new pods are up and running after about 30 seconds. |
| 105 | + |
| 106 | +Ensure the status is reported as Running before continuing. |
| 107 | + |
| 108 | +{{< tabpane >}} |
| 109 | +{{< tab header="Kubectl Get Pods" lang="bash" >}} |
| 110 | +kubectl get pods -n splunk |
| 111 | +{{< /tab >}} |
| 112 | +{{< tab header="Kubectl Get Pods Output" lang="text" >}} |
| 113 | +NAME READY STATUS RESTARTS AGE |
| 114 | +splunk-otel-collector-agent-2sk6k 0/1 Running 0 10s |
| 115 | +splunk-otel-collector-k8s-cluster-receiver-6956d4446f-gwnd7 0/1 Running 0 10s |
| 116 | +{{< /tab >}} |
| 117 | +{{< /tabpane >}} |
| 118 | + |
| 119 | +{{% alert title="Note" color="info" %}} |
| 120 | + |
| 121 | +If you are using the Kubernetes Integration setup from the Data Management page from the O11y UI , you find that the guide will use |
| 122 | +`--generate-name splunk-otel-collector-chart/splunk-otel-collector` instead of just `splunk-otel-collector-chart/splunk-otel-collector` as we do in the above example. |
| 123 | + |
| 124 | +This will generate an unique name/label for the collector install and Pods by adding a unique number at the end of the object name, allowing you to install multiple collectors in your Kubernetes environment with different configurations. |
| 125 | + |
| 126 | +Just make sure you use the correct label that is generated by the helm chart if you wish to use the `helm` and `kubectl` commands from this workshop on an install done with the `--generate-name` option. |
| 127 | +{{% /alert %}} |
| 128 | + |
| 129 | +Use the label set by the `helm` install to tail logs (You will need to press `ctrl + c` to exit). Or use the installed `k9s` terminal UI. |
| 130 | + |
| 131 | +{{< tabpane >}} |
| 132 | +{{< tab header="Kubectl Logs" lang="bash" >}} |
| 133 | +kubectl logs -l app=splunk-otel-collector -f --container otel-collector -n splunk |
| 134 | +{{< /tab >}} |
| 135 | +{{< /tabpane >}} |
| 136 | + |
| 137 | +{{% alert title="Deleting a failed installation" color="warning" %}} |
| 138 | +If you make an error installing the Splunk OpenTelemetry Collector you can start over by deleting the installation using: |
| 139 | + |
| 140 | +``` bash |
| 141 | +helm delete splunk-otel-collector -n splunk |
| 142 | +``` |
| 143 | + |
| 144 | +{{% /alert %}} |
| 145 | + |
| 146 | + |
0 commit comments