forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add k8s makefile targets (open-telemetry#32349)
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> First attempt for open-telemetry#32348. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#32348 **Testing:** <Describe what testing was performed and which tests were added.> **Documentation:** <Describe the documentation added.> --------- Signed-off-by: ChrsMark <[email protected]>
- Loading branch information
Showing
3 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
mode: daemonset | ||
|
||
image: | ||
repository: otelcontribcol-dev | ||
tag: "0.0.1" | ||
pullPolicy: IfNotPresent | ||
|
||
command: | ||
name: otelcontribcol | ||
|
||
extraEnvs: | ||
- name: K8S_NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
|
||
clusterRole: | ||
create: true | ||
rules: | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- 'pods' | ||
- 'nodes' | ||
verbs: | ||
- 'get' | ||
- 'list' | ||
- 'watch' | ||
- apiGroups: [ "" ] | ||
resources: [ "nodes/stats", "nodes/proxy"] | ||
verbs: [ "get" ] | ||
|
||
|
||
config: | ||
exporters: | ||
debug: | ||
verbosity: detailed | ||
receivers: | ||
kubeletstats: | ||
collection_interval: 10s | ||
auth_type: 'serviceAccount' | ||
endpoint: '${env:K8S_NODE_NAME}:10250' | ||
insecure_skip_verify: true | ||
k8s_api_config: | ||
auth_type: serviceAccount | ||
metrics: | ||
container.cpu.utilization: | ||
enabled: true | ||
container.cpu.time: | ||
enabled: true | ||
container.cpu.usage: | ||
enabled: true | ||
k8s.container.cpu_limit_utilization: | ||
enabled: true | ||
|
||
service: | ||
pipelines: | ||
metrics: | ||
receivers: [kubeletstats] | ||
processors: [batch] | ||
exporters: [debug] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Running OpenTelemetry Collector from source on k8s | ||
|
||
Developing Collector's features that target to run on a Kubernetes environment require some special handling | ||
for building and running the patches locally. | ||
|
||
|
||
In order to build the Collector from source and deploy it on a local kind cluster | ||
(a kind cluster is required to be installed already) use the following Makefile targets: | ||
|
||
#### Build the Collector | ||
`make kind-build` | ||
|
||
#### Install the Collector as Daemonset | ||
`make kind-install-daemonset` | ||
|
||
This command will install the Collector using the [`daemonset-collector-dev.yaml`](./daemonset-collector-dev.yaml) | ||
configuration sample. | ||
This only stands as a sample configuration and users need to tune this according to their needs. | ||
|
||
#### Uninstall the Daemonset | ||
`make kind-uninstall-daemonset` |