├── .changelog
└── changelog_template.jinja
├── .envrc
├── .github
├── CODEOWNERS
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── feature_request.md
│ └── question.md
├── dependabot.yml
├── labeler.yml
├── pr-title-checker-config.json
├── pull_request_template.md
└── workflows
│ ├── backport_bot.yaml
│ ├── changelog.yaml
│ ├── check_dependencies.yaml
│ ├── check_pr_labels.yaml
│ ├── close-jira-task.yaml
│ ├── create-jira-task.yml
│ ├── dev_builds.yml
│ ├── pr_labeler.yaml
│ ├── pull_requests.yml
│ ├── release_builds.yml
│ ├── sync-repositories.yaml
│ ├── sync-repository.yaml
│ ├── workflow-integration-tests.yaml
│ └── workflow-sync-repositories.yaml
├── .gitignore
├── .markdown_link_check.json
├── .markdownlint.jsonc
├── .prettierignore
├── .prettierrc.yaml
├── .vscode
├── extensions.json
└── snippets.code-snippets
├── .yamllint.yaml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── Makefile
├── README.md
├── ROADMAP.md
├── Vagrantfile
├── ci
├── _build_functions.sh
├── add-changelog-entry.sh
├── check_configuration_keys.py
├── check_configuration_keys_test.py
├── check_dependencies
│ ├── .gitignore
│ ├── README.md
│ ├── aks.py
│ ├── common.py
│ ├── eks.py
│ ├── gke.py
│ ├── helm_charts.py
│ ├── issue_header.md
│ ├── kops.py
│ ├── kubernetes_collection.py
│ ├── main.py
│ ├── openshift.py
│ └── requirements.txt
├── check_unused_templates.sh
├── jsonnet-mixin.tmpl
├── markdown_link_check.sh
├── markdown_links_lint.sh
├── push-helm-chart.sh
├── shellcheck.sh
├── sync-repository.sh
└── update-otc.sh
├── deploy
├── README.md
└── helm
│ └── sumologic
│ ├── .helmignore
│ ├── Chart.yaml
│ ├── README.md
│ ├── conf
│ ├── cleanup
│ │ └── cleanup.sh
│ ├── events
│ │ └── otelcol
│ │ │ └── config.yaml
│ ├── instrumentation
│ │ ├── otelcol.instrumentation.conf.yaml
│ │ ├── traces.gateway.conf.yaml
│ │ └── traces.sampler.conf.yaml
│ ├── logs
│ │ ├── collector
│ │ │ ├── common
│ │ │ │ └── filelog_receiver.yaml
│ │ │ ├── otelcloudwatch
│ │ │ │ └── config.yaml
│ │ │ ├── otelcol
│ │ │ │ └── config.yaml
│ │ │ └── otellogswindows
│ │ │ │ └── config.yaml
│ │ └── otelcol
│ │ │ └── config.yaml
│ ├── metrics
│ │ ├── collector
│ │ │ └── otelcol
│ │ │ │ └── config.yaml
│ │ ├── otelcol
│ │ │ ├── config.yaml
│ │ │ ├── default-filters.yaml
│ │ │ ├── exporters.yaml
│ │ │ ├── pipeline.yaml
│ │ │ └── processors.yaml
│ │ └── remote-write-proxy
│ │ │ └── remote-write-proxy.conf
│ ├── opentelemetry-operator
│ │ └── instrumentation.cr.yaml
│ ├── pvc-cleaner
│ │ └── pvc-cleaner.sh
│ └── setup
│ │ ├── custom.sh
│ │ ├── dashboards.sh
│ │ ├── fields.tf
│ │ ├── main.tf
│ │ ├── monitors.sh
│ │ ├── providers.tf.json
│ │ ├── resources.tf
│ │ ├── setup.sh
│ │ ├── sources.tf.json
│ │ ├── terraform.tfvars.json
│ │ └── variables.tf
│ ├── crds
│ ├── crd-opentelemetry.io_opampbridges.yaml
│ ├── crd-opentelemetrycollector.yaml
│ └── crd-opentelemetryinstrumentation.yaml
│ ├── templates
│ ├── NOTES.txt
│ ├── _helpers
│ │ ├── _api_versions.tpl
│ │ ├── _common.tpl
│ │ ├── _events.tpl
│ │ ├── _logs.tpl
│ │ ├── _metrics.tpl
│ │ ├── _setup.tpl
│ │ ├── _sumologic_mock.tpl
│ │ └── _traces.tpl
│ ├── chart-configmap.yaml
│ ├── checks.txt
│ ├── cleanup
│ │ ├── configmap.yaml
│ │ ├── job.yaml
│ │ ├── role.yaml
│ │ ├── rolebinding.yaml
│ │ ├── secret.yaml
│ │ └── serviceaccount.yaml
│ ├── clusterrole.yaml
│ ├── clusterrolebinding.yaml
│ ├── events
│ │ ├── common
│ │ │ ├── service-headless.yaml
│ │ │ └── service.yaml
│ │ └── otelcol
│ │ │ ├── configmap.yaml
│ │ │ └── statefulset.yaml
│ ├── instrumentation
│ │ ├── otelcol-instrumentation
│ │ │ ├── configmap.yaml
│ │ │ ├── hpa.yaml
│ │ │ ├── service-deprecated-otelcol.yaml
│ │ │ ├── service-otelagent.yaml
│ │ │ └── statefulset.yaml
│ │ ├── traces-gateway
│ │ │ ├── configmap.yaml
│ │ │ ├── deployment.yaml
│ │ │ ├── hpa.yaml
│ │ │ └── service.yaml
│ │ └── traces-sampler
│ │ │ ├── configmap.yaml
│ │ │ ├── deployment.yaml
│ │ │ └── service-headless.yaml
│ ├── logs
│ │ ├── collector
│ │ │ ├── common
│ │ │ │ ├── service.yaml
│ │ │ │ └── serviceaccount.yaml
│ │ │ ├── otelcol-cloudwatch
│ │ │ │ ├── configmap.yaml
│ │ │ │ ├── serviceaccount.yaml
│ │ │ │ └── statefulset.yaml
│ │ │ ├── otelcol
│ │ │ │ ├── configmap.yaml
│ │ │ │ └── daemonset.yaml
│ │ │ └── otellogswindows
│ │ │ │ ├── configmap.yaml
│ │ │ │ └── daemonset.yaml
│ │ ├── common
│ │ │ ├── hpa.yaml
│ │ │ ├── pdb.yaml
│ │ │ ├── service-headless.yaml
│ │ │ └── service.yaml
│ │ └── otelcol
│ │ │ ├── configmap.yaml
│ │ │ └── statefulset.yaml
│ ├── machineconfig
│ │ ├── master.yaml
│ │ └── worker.yaml
│ ├── metrics
│ │ ├── collector
│ │ │ └── otelcol
│ │ │ │ ├── clusterrole.yaml
│ │ │ │ ├── clusterrolebinding.yaml
│ │ │ │ ├── opentelemetrycollector.yaml
│ │ │ │ ├── serviceaccount-targetallocator.yaml
│ │ │ │ ├── serviceaccount.yaml
│ │ │ │ ├── targetallocator-clusterrole.yaml
│ │ │ │ └── targetallocator-clusterrolebinding.yaml
│ │ ├── common
│ │ │ ├── hpa.yaml
│ │ │ ├── pdb.yaml
│ │ │ ├── service-headless.yaml
│ │ │ └── service.yaml
│ │ ├── otelcol
│ │ │ ├── configmap.yaml
│ │ │ └── statefulset.yaml
│ │ ├── prometheus
│ │ │ └── servicemonitors.yaml
│ │ └── remote-write-proxy
│ │ │ ├── configmap.yaml
│ │ │ ├── deployment.yaml
│ │ │ └── service.yaml
│ ├── opentelemetry-operator
│ │ ├── configmap-instrumentation-cr.yaml
│ │ └── job-instrumentation-cr.yaml
│ ├── priorityclass.yaml
│ ├── pvc-cleaner
│ │ ├── configmap.yaml
│ │ ├── cron-job-logs.yaml
│ │ ├── cron-job-metrics.yaml
│ │ └── serviceaccount.yaml
│ ├── scc.yaml
│ ├── serviceaccount.yaml
│ ├── setup
│ │ ├── configmap.yaml
│ │ ├── crds-configmap.yaml
│ │ ├── custom-configmap.yaml
│ │ ├── job.yaml
│ │ ├── role.yaml
│ │ ├── rolebinding.yaml
│ │ ├── scc.yaml
│ │ ├── secret.yaml
│ │ └── serviceaccount.yaml
│ └── sumologic-mock
│ │ ├── deployment.yaml
│ │ ├── service.yaml
│ │ └── serviceaccount.yaml
│ └── values.yaml
├── docs
├── README.md
├── best-practices.md
├── collecting-application-metrics.md
├── collecting-container-logs.md
├── collecting-kubernetes-events.md
├── collecting-kubernetes-metrics.md
├── collecting-systemd-logs.md
├── configuration-examples.md
├── dev.md
├── fargate.md
├── filtering.md
├── fluentbit-otc-comparison.md
├── installation.md
├── installing-behind-proxy.md
├── kube-prometheus.md
├── monitoring-lag.md
├── opentelemetry-collector
│ ├── README.md
│ ├── events.md
│ ├── logs.md
│ ├── metrics.md
│ └── traces.md
├── otlp-source.md
├── performance.md
├── prometheus.md
├── release.md
├── scraped-metrics.md
├── security-best-practices.md
├── support.md
├── terraform.md
├── troubleshoot-collection.md
├── v3-migration-doc.md
├── v4-migration-doc.md
├── windows.md
└── working-with-container-registries.md
├── examples
├── fargate
│ └── install-metrics.sh
├── instrumentation
│ ├── custom-values-cascading-filter.yaml
│ └── multiple-cascading-filter-sampler-instances.yaml
└── kube_prometheus_stack
│ ├── values-prometheus.yaml
│ └── values.yaml
├── images
├── events.png
├── helm_chart_installed.png
├── logs.png
├── metrics.png
├── metrics
│ ├── prometheus-query.png
│ ├── prometheus-targets-error.png
│ ├── prometheus-targets-ok.png
│ └── prometheus-ui.png
├── overview-v4.png
├── src
│ ├── events.drawio.xml
│ ├── logs.drawio.xml
│ └── metrics.drawio.xml
├── sumo_k8s_dashboard.png
└── sumo_logic_logo.png
├── override.output.yaml
├── shell.nix
├── tests
├── go.mod
├── go.sum
├── helm
│ ├── .golangci.yaml
│ ├── Makefile
│ ├── README.md
│ ├── common_test.go
│ ├── const.go
│ ├── events_test.go
│ ├── goldenfile_test.go
│ ├── logs_test.go
│ ├── metrics_test.go
│ ├── otellogs_metrics_test.go
│ ├── prometheus_test.go
│ ├── remotewrite_validation_test.go
│ ├── testdata
│ │ ├── custom-global-config-attributes.yaml
│ │ ├── everything-enabled.yaml
│ │ ├── fipsmode.yaml
│ │ ├── goldenfile
│ │ │ ├── cleanup
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── sumologic-mock-no-secret.input.yaml
│ │ │ │ ├── sumologic-mock-no-secret.output.yaml
│ │ │ │ ├── sumologic-mock-secret.input.yaml
│ │ │ │ ├── sumologic-mock-secret.output.yaml
│ │ │ │ ├── sumologic-mock.input.yaml
│ │ │ │ └── sumologic-mock.output.yaml
│ │ │ ├── common
│ │ │ │ ├── clusterrole.input.yaml
│ │ │ │ └── clusterrole.output.yaml
│ │ │ ├── events_otc
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── options.input.yaml
│ │ │ │ ├── options.output.yaml
│ │ │ │ ├── sumologic-mock.input.yaml
│ │ │ │ └── sumologic-mock.output.yaml
│ │ │ ├── events_otc_statefulset
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── common.input.yaml
│ │ │ │ ├── common.output.yaml
│ │ │ │ ├── custom.input.yaml
│ │ │ │ ├── custom.output.yaml
│ │ │ │ ├── proxy.input.yaml
│ │ │ │ └── proxy.output.yaml
│ │ │ ├── kube-prometheus-stack
│ │ │ │ └── servicemonitors
│ │ │ │ │ ├── basic-sumo.input.yaml
│ │ │ │ │ └── basic-sumo.output.yaml
│ │ │ ├── logs_otc
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── debug.input.yaml
│ │ │ │ ├── debug.output.yaml
│ │ │ │ ├── options.input.yaml
│ │ │ │ └── options.output.yaml
│ │ │ ├── logs_otc_cloudwatch
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── custom.input.yaml
│ │ │ │ └── custom.output.yaml
│ │ │ ├── logs_otc_daemonset
│ │ │ │ ├── additional-complex.input.yaml
│ │ │ │ ├── additional-complex.output.yaml
│ │ │ │ ├── additional.input.yaml
│ │ │ │ ├── additional.output.yaml
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── complex.input.yaml
│ │ │ │ ├── complex.output.yaml
│ │ │ │ ├── multiple_multiline.input.yaml
│ │ │ │ └── multiple_multiline.output.yaml
│ │ │ ├── logs_otc_serviceaccount
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── image_pull_secrets.input.yaml
│ │ │ │ └── image_pull_secrets.output.yaml
│ │ │ ├── logs_otc_windows
│ │ │ │ ├── configmap
│ │ │ │ │ ├── basic.input.yaml
│ │ │ │ │ ├── basic.output.yaml
│ │ │ │ │ ├── debug.input.yaml
│ │ │ │ │ ├── debug.output.yaml
│ │ │ │ │ ├── options.input.yaml
│ │ │ │ │ └── options.output.yaml
│ │ │ │ └── daemonset
│ │ │ │ │ ├── additional-complex.input.yaml
│ │ │ │ │ ├── additional-complex.output.yaml
│ │ │ │ │ ├── additional.input.yaml
│ │ │ │ │ ├── additional.output.yaml
│ │ │ │ │ ├── basic.input.yaml
│ │ │ │ │ ├── basic.output.yaml
│ │ │ │ │ ├── complex.input.yaml
│ │ │ │ │ ├── complex.output.yaml
│ │ │ │ │ ├── multiple_multiline.input.yaml
│ │ │ │ │ └── multiple_multiline.output.yaml
│ │ │ ├── metadata_logs_otc
│ │ │ │ ├── debug.input.yaml
│ │ │ │ ├── debug.output.yaml
│ │ │ │ ├── debug_with_sumologic_mock.input.yaml
│ │ │ │ ├── debug_with_sumologic_mock.output.yaml
│ │ │ │ ├── debug_with_sumologic_mock_http.input.yaml
│ │ │ │ ├── debug_with_sumologic_mock_http.output.yaml
│ │ │ │ ├── extra_exporter.input.yaml
│ │ │ │ ├── extra_exporter.output.yaml
│ │ │ │ ├── k8sattributes.input.yaml
│ │ │ │ ├── k8sattributes.output.yaml
│ │ │ │ ├── otel.input.yaml
│ │ │ │ ├── otel.output.yaml
│ │ │ │ ├── routing.input.yaml
│ │ │ │ ├── routing.output.yaml
│ │ │ │ ├── routing_with_defaults.input.yaml
│ │ │ │ ├── routing_with_defaults.output.yaml
│ │ │ │ ├── routing_with_defaults_http.input.yaml
│ │ │ │ ├── routing_with_defaults_http.output.yaml
│ │ │ │ ├── templates.input.yaml
│ │ │ │ └── templates.output.yaml
│ │ │ ├── metadata_logs_otc_statefulset
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── custom.input.yaml
│ │ │ │ ├── custom.output.yaml
│ │ │ │ ├── pvcpolicyenabled.input.yaml
│ │ │ │ └── pvcpolicyenabled.output.yaml
│ │ │ ├── metadata_metrics_otc
│ │ │ │ ├── additional_endpoints.input.yaml
│ │ │ │ ├── additional_endpoints.output.yaml
│ │ │ │ ├── allow_histograms.input.yaml
│ │ │ │ ├── allow_histograms.output.yaml
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── custom.input.yaml
│ │ │ │ ├── custom.output.yaml
│ │ │ │ ├── debug.input.yaml
│ │ │ │ ├── debug.output.yaml
│ │ │ │ ├── debug_with_sumologic_mock.input.yaml
│ │ │ │ ├── debug_with_sumologic_mock.output.yaml
│ │ │ │ ├── debug_with_sumologic_mock_http.input.yaml
│ │ │ │ ├── debug_with_sumologic_mock_http.output.yaml
│ │ │ │ ├── filtered_app_metrics.input.yaml
│ │ │ │ └── filtered_app_metrics.output.yaml
│ │ │ ├── metadata_metrics_otc_statefulset
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── custom.input.yaml
│ │ │ │ ├── custom.output.yaml
│ │ │ │ ├── pvcpolicyenabled.input.yaml
│ │ │ │ └── pvcpolicyenabled.output.yaml
│ │ │ ├── metrics-server
│ │ │ │ ├── basic.input.yaml
│ │ │ │ └── basic.output.yaml
│ │ │ ├── metrics_additional_service_monitors
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── custom.input.yaml
│ │ │ │ └── custom.output.yaml
│ │ │ ├── metrics_collector_otc
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── custom.input.yaml
│ │ │ │ ├── custom.output.yaml
│ │ │ │ ├── debug.input.yaml
│ │ │ │ ├── debug.output.yaml
│ │ │ │ ├── kubelet.input.yaml
│ │ │ │ └── kubelet.output.yaml
│ │ │ ├── opentelemetry_operator_instrumentation_cr_configmap
│ │ │ │ ├── instrumentation.additionalenvs.input.yaml
│ │ │ │ ├── instrumentation.additionalenvs.output.yaml
│ │ │ │ ├── instrumentation.input.yaml
│ │ │ │ ├── instrumentation.output.yaml
│ │ │ │ ├── instrumentation.repository.input.yaml
│ │ │ │ └── instrumentation.repository.output.yaml
│ │ │ ├── opentelemetry_operator_instrumentation_cr_job
│ │ │ │ ├── job.input.yaml
│ │ │ │ └── job.output.yaml
│ │ │ ├── otelcol-instrumentation-config
│ │ │ │ ├── config-from-merge.input.yaml
│ │ │ │ ├── config-from-merge.output.yaml
│ │ │ │ ├── config-from-override.input.yaml
│ │ │ │ ├── config-from-override.output.yaml
│ │ │ │ ├── config-from-values-backward-compatibility.input.yaml
│ │ │ │ ├── config-from-values-backward-compatibility.output.yaml
│ │ │ │ ├── traces-gateway-disabled.input.yaml
│ │ │ │ ├── traces-gateway-disabled.output.yaml
│ │ │ │ ├── traces-gateway-disabled.sumologic-mock.input.yaml
│ │ │ │ ├── traces-gateway-disabled.sumologic-mock.output.yaml
│ │ │ │ ├── traces-gateway-enabled.input.yaml
│ │ │ │ ├── traces-gateway-enabled.output.yaml
│ │ │ │ ├── traces-gateway-enabled.sumologic-mock.input.yaml
│ │ │ │ └── traces-gateway-enabled.sumologic-mock.output.yaml
│ │ │ ├── otelcol-instrumentation-hpa
│ │ │ │ ├── basic.input.yaml
│ │ │ │ └── basic.output.yaml
│ │ │ ├── otelcol-instrumentation-statefulset
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── custom.input.yaml
│ │ │ │ └── custom.output.yaml
│ │ │ ├── otellogs_metrics
│ │ │ │ ├── enabled.input.yaml
│ │ │ │ └── enabled.output.yaml
│ │ │ ├── pvc-cleaner
│ │ │ │ ├── full_config_logs.input.yaml
│ │ │ │ ├── full_config_logs.output.yaml
│ │ │ │ ├── full_config_metrics.input.yaml
│ │ │ │ └── full_config_metrics.output.yaml
│ │ │ ├── remote_write_proxy
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── full_config.input.yaml
│ │ │ │ ├── full_config.output.yaml
│ │ │ │ ├── full_configmap.input.yaml
│ │ │ │ └── full_configmap.output.yaml
│ │ │ ├── services_with_service_monitor_labels
│ │ │ │ └── services_with_service_monitor_labels
│ │ │ │ │ ├── default.input.yaml
│ │ │ │ │ └── default.output.yaml
│ │ │ ├── setup
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── monitors_with_email_notifications.input.yaml
│ │ │ │ ├── monitors_with_email_notifications.output.yaml
│ │ │ │ ├── monitors_with_single_email.input.yaml
│ │ │ │ ├── monitors_with_single_email.output.yaml
│ │ │ │ ├── sumologic-mock-no-secret.input.yaml
│ │ │ │ ├── sumologic-mock-no-secret.output.yaml
│ │ │ │ ├── sumologic-mock-secret.input.yaml
│ │ │ │ ├── sumologic-mock-secret.output.yaml
│ │ │ │ ├── sumologic-mock.input.yaml
│ │ │ │ └── sumologic-mock.output.yaml
│ │ │ ├── sumologic-mock
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── complex.input.yaml
│ │ │ │ └── complex.output.yaml
│ │ │ ├── terraform
│ │ │ │ ├── all_fields.input.yaml
│ │ │ │ ├── all_fields.output.yaml
│ │ │ │ ├── collector_fields.input.yaml
│ │ │ │ ├── collector_fields.output.yaml
│ │ │ │ ├── conditional_sources.input.yaml
│ │ │ │ ├── conditional_sources.output.yaml
│ │ │ │ ├── custom.input.yaml
│ │ │ │ ├── custom.output.yaml
│ │ │ │ ├── default.input.yaml
│ │ │ │ ├── default.output.yaml
│ │ │ │ ├── disable_default_metrics.input.yaml
│ │ │ │ ├── disable_default_metrics.output.yaml
│ │ │ │ ├── disabled_dashboards.input.yaml
│ │ │ │ ├── disabled_dashboards.output.yaml
│ │ │ │ ├── disabled_monitors.input.yaml
│ │ │ │ ├── disabled_monitors.output.yaml
│ │ │ │ ├── logs_fields.input.yaml
│ │ │ │ ├── logs_fields.output.yaml
│ │ │ │ ├── monitors_with_email_notifications.input.yaml
│ │ │ │ ├── monitors_with_email_notifications.output.yaml
│ │ │ │ ├── monitors_with_single_email.input.yaml
│ │ │ │ ├── monitors_with_single_email.output.yaml
│ │ │ │ ├── strip_extrapolation.input.yaml
│ │ │ │ ├── strip_extrapolation.output.yaml
│ │ │ │ ├── traces.input.yaml
│ │ │ │ ├── traces.output.yaml
│ │ │ │ ├── tracing-metrics-disabled.input.yaml
│ │ │ │ └── tracing-metrics-disabled.output.yaml
│ │ │ ├── terraform_custom
│ │ │ │ ├── custom.input.yaml
│ │ │ │ ├── custom.output.yaml
│ │ │ │ ├── empty.input.yaml
│ │ │ │ └── empty.output.yaml
│ │ │ ├── traces-gateway-deployment
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── custom.input.yaml
│ │ │ │ └── custom.output.yaml
│ │ │ ├── traces-gateway-hpa
│ │ │ │ ├── basic.input.yaml
│ │ │ │ └── basic.output.yaml
│ │ │ ├── traces-gateway-loadbalancing
│ │ │ │ ├── config-from-merge.input.yaml
│ │ │ │ ├── config-from-merge.output.yaml
│ │ │ │ ├── config-from-override.input.yaml
│ │ │ │ ├── config-from-override.output.yaml
│ │ │ │ ├── config-from-values-backward-compatibility.input.yaml
│ │ │ │ ├── config-from-values-backward-compatibility.output.yaml
│ │ │ │ ├── sumologic-mock.input.yaml
│ │ │ │ ├── sumologic-mock.output.yaml
│ │ │ │ ├── traces-gateway-true.input.yaml
│ │ │ │ └── traces-gateway-true.output.yaml
│ │ │ ├── traces-sampler-deployment
│ │ │ │ ├── basic.input.yaml
│ │ │ │ ├── basic.output.yaml
│ │ │ │ ├── custom.input.yaml
│ │ │ │ ├── custom.output.yaml
│ │ │ │ ├── persistence-enabled.input.yaml
│ │ │ │ └── persistence-enabled.output.yaml
│ │ │ └── traces-sampler
│ │ │ │ ├── config-from-merge.input.yaml
│ │ │ │ ├── config-from-merge.output.yaml
│ │ │ │ ├── config-from-override.input.yaml
│ │ │ │ ├── config-from-override.output.yaml
│ │ │ │ ├── config-from-values-backward-compatibility.input.yaml
│ │ │ │ ├── config-from-values-backward-compatibility.output.yaml
│ │ │ │ ├── httpendpoint.input.yaml
│ │ │ │ ├── httpendpoint.output.yaml
│ │ │ │ ├── persistence-enabled.input.yaml
│ │ │ │ ├── persistence-enabled.output.yaml
│ │ │ │ ├── simple.input.yaml
│ │ │ │ ├── simple.output.yaml
│ │ │ │ ├── sumologic-mock.input.yaml
│ │ │ │ └── sumologic-mock.output.yaml
│ │ ├── node-selector.yaml
│ │ ├── opentelemetry-metrics-extra-processors.yaml
│ │ ├── operator-crds-disabled.yaml
│ │ └── remotewrite
│ │ │ ├── metrics-disabled.yaml
│ │ │ ├── remotewrites-defined-prometheus-disabled.yaml
│ │ │ └── remotewrites-defined-prometheus-enabled.yaml
│ └── utils.go
└── integration
│ ├── .gitignore
│ ├── .golangci.yaml
│ ├── Makefile
│ ├── README.md
│ ├── create-image-archive.sh
│ ├── features.go
│ ├── helm_annotations_test.go
│ ├── helm_http_source_test.go
│ ├── helm_k8s_processor_test.go
│ ├── helm_namespace_annotations_test.go
│ ├── helm_opentelemetry_operator_enabled_test.go
│ ├── helm_opentelemetry_operator_instr_test.go
│ ├── helm_ot_default_namespaceoverride_test.go
│ ├── helm_ot_default_test.go
│ ├── helm_ot_histograms_test.go
│ ├── helm_ot_routing_additional_partially_test.go
│ ├── helm_ot_routing_partial_test.go
│ ├── helm_ot_routing_test.go
│ ├── helm_otc_fips_metadata_installation_test.go
│ ├── helm_prometheus_metrics_test.go
│ ├── helm_pvc_cleaner_test.go
│ ├── helm_tailing_sidecar_test.go
│ ├── helm_traces_gateway_disabled_test.go
│ ├── instrumentation
│ ├── dotnet-deployment.yaml
│ ├── dotnet-service.yaml
│ ├── java-deployment.yaml
│ ├── java-service.yaml
│ ├── nodejs-deployment.yaml
│ ├── nodejs-service.yaml
│ ├── python-deployment.yaml
│ └── python-service.yaml
│ ├── internal
│ ├── constants.go
│ ├── ctxopts
│ │ └── context_opts.go
│ ├── curlapp
│ │ └── curlapp.go
│ ├── k8s
│ │ ├── pods.go
│ │ └── tunnel.go
│ ├── logsgenerator
│ │ └── logsgenerator.go
│ ├── stepfuncs
│ │ ├── adapters.go
│ │ ├── assess_funcs.go
│ │ ├── autoscaler.go
│ │ ├── curlapp.go
│ │ ├── debug.go
│ │ ├── helm.go
│ │ ├── kubectl.go
│ │ ├── logs.go
│ │ ├── options.go
│ │ └── traces.go
│ ├── strings
│ │ ├── strings.go
│ │ └── strings_test.go
│ ├── sumologicmock
│ │ ├── labels.go
│ │ └── receiver_mock.go
│ ├── tracesgenerator
│ │ └── tracesgenerator.go
│ └── types.go
│ ├── kind_images.json
│ ├── main_test.go
│ ├── values
│ ├── values_common.yaml
│ ├── values_helm_annotations.yaml
│ ├── values_helm_default_ot.yaml
│ ├── values_helm_default_ot_fips.yaml
│ ├── values_helm_default_ot_namespaceoverride.yaml
│ ├── values_helm_http_source.yaml
│ ├── values_helm_k8s_processor.yaml
│ ├── values_helm_namespace_annotations.yaml
│ ├── values_helm_opentelemetry_operator_enabled.yaml
│ ├── values_helm_ot_histograms.yaml
│ ├── values_helm_otellogs_metrics_disabled.yaml
│ ├── values_helm_prometheus_metrics.yaml
│ ├── values_helm_pvc_cleaner.yaml
│ ├── values_helm_routing_additional_partially.yaml
│ ├── values_helm_routing_ot.yaml
│ ├── values_helm_routing_partial.yaml
│ ├── values_helm_tailing_sidecar.yaml
│ ├── values_helm_traces_gateway_disabled.yaml
│ └── values_opentelemetry_operator_instrumentation.yaml
│ └── yamls
│ ├── additional-sumologic-mock.yaml
│ ├── annotations-test.yaml
│ ├── cluster.yaml
│ ├── multiline-logs-generator.yaml
│ ├── namespace-annotations-test.yaml
│ ├── nginx.yaml
│ └── tailing-sidecar-test.yaml
├── towncrier.toml
└── vagrant
├── .gitignore
├── Makefile
├── README.md
├── dashboards
├── performance.json
└── receiver-summary.json
├── forwarding
├── forward-dashboard.sh
└── forward-prometheus.sh
├── k8s
├── application_metrics
│ ├── jmx
│ │ ├── jmxexporter
│ │ │ └── docker
│ │ │ │ ├── configmap.yaml
│ │ │ │ └── statefulset.yaml
│ │ └── jolokia
│ │ │ ├── agent
│ │ │ └── statefulset.yaml
│ │ │ └── docker
│ │ │ └── statefulset.yaml
│ ├── nginx
│ │ ├── docker
│ │ │ ├── configmap.yaml
│ │ │ ├── statefulset.yaml
│ │ │ └── values.yaml
│ │ └── ingress_official
│ │ │ ├── values.prometheus.yaml
│ │ │ └── values.telegraf.yaml
│ └── redis
│ │ ├── bitnami
│ │ ├── values.prometheus.yaml
│ │ └── values.telegraf.yaml
│ │ └── docker
│ │ └── statefulset.yaml
├── argo.yaml
├── avalanche.yaml
├── customer-trace-tester.yaml
├── istio-peer-authentication.yaml
├── istio-receiver-mock.yaml
├── istio-service-monitors.yaml
├── logs-generator.yaml
├── logs-keeper.yaml
├── prometheus-adapter.yaml
├── receiver-mock.yaml
├── service-monitors.yaml
└── sumologic.yaml
├── logs-keeper
└── logs-keeper.py
├── opentelemetry-collector.yaml
├── provision.sh
├── scripts
├── README.md
├── diff_values.py
├── generate-local-config.sh
├── get-dashboard-token.sh
├── get-kubeconfig.sh
├── perf-test.sh
├── prometheus-rules-getter.py
├── sumo-make-completion.sh
├── sumo-make.sh
└── yq
│ └── avalanche-remote-write.yaml
├── values.istio.yaml
└── values.yaml
/.changelog/changelog_template.jinja:
--------------------------------------------------------------------------------
1 | {% if sections[""] -%}
2 |
3 | ### Released {{ versiondata.date }}
4 |
5 | {% for category, val in definitions.items() if category in sections[""] -%}
6 |
7 | ### {{ definitions[category]['name'] }}
8 |
9 | {% for text, values in sections[""][category].items() %}
10 | {%- set lines = text.split('\n') -%}
11 | - {{ lines[0] }} {{ values|join(', ') }}
12 | {{- lines[1:] | join('\n') }}
13 | {% endfor %}
14 |
15 | {% endfor %}
16 | {% else %}
17 | No significant changes.
18 |
19 |
20 | {% endif %}
21 |
22 | {%- set all_values = [] %}
23 | {%- for category, val in definitions.items() if category in sections[""] %}
24 | {% for text, values in sections[""][category].items() %}
25 | {% for value in values %}
26 | {{ all_values.append(value) or "" -}}
27 | {% endfor %}
28 | {% endfor %}
29 | {% endfor %}
30 | {%- for value in all_values | unique %}
31 | {{ value }}: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/{{ value | trim('[]#') }}
32 | {% endfor %}
33 | [v{{ versiondata.version }}]: https://github.com/SumoLogic/sumologic-kubernetes-collection/releases/v{{
34 | versiondata.version }}
--------------------------------------------------------------------------------
/.envrc:
--------------------------------------------------------------------------------
1 | use_nix
2 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # Learn about CODEOWNERS file format:
2 | # https://help.github.com/en/articles/about-code-owners
3 |
4 | * @SumoLogic/open-source-collection-team
5 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ""
5 | labels: enhancement
6 | assignees: ""
7 | ---
8 |
9 | **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always
10 | frustrated when [...]
11 |
12 | **Describe the solution you'd like** A clear and concise description of what you want to happen.
13 |
14 | **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered.
15 |
16 | **Additional context** Add any other context or screenshots about the feature request here.
17 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Question
3 | about: Ask a question
4 | title: ""
5 | labels: question
6 | assignees: ""
7 | ---
8 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "github-actions"
4 | directory: "/"
5 | schedule:
6 | interval: "daily"
7 |
8 | labels:
9 | - skip-changelog
10 |
11 | - package-ecosystem: "gomod"
12 | directory: "/tests/"
13 | schedule:
14 | interval: "weekly"
15 | groups:
16 | kubernetes:
17 | patterns:
18 | - "k8s.io/*"
19 | - "sigs.k8s.io/*"
20 |
21 | labels:
22 | - skip-changelog
23 |
--------------------------------------------------------------------------------
/.github/labeler.yml:
--------------------------------------------------------------------------------
1 | # Add 'documentation' label to any change to *.md files
2 | documentation:
3 | - any: ["**/*.md"]
4 |
5 | # Add 'ci' label to any change in .github/ directory
6 | ci:
7 | - any: [".github/**/*"]
8 |
9 | # Add 'integration-tests' label to any change in tests/integration/ directory
10 | integration-tests:
11 | - any: ["tests/integration/**"]
12 |
--------------------------------------------------------------------------------
/.github/pr-title-checker-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "LABEL": {
3 | "name": "title needs formatting",
4 | "color": "EEEEEE"
5 | },
6 | "CHECKS": {
7 | "prefixes": [],
8 | "regexp": "^(Revert \"|\\[Backport [^ ]+\\] |)(docs|fix|feat|test|deps|chore|ci)(\\(.+\\)|)(\\!|): ",
9 | "regexpFlags": "i",
10 | "ignoreLabels" : []
11 | },
12 | "MESSAGES": {
13 | "success": "All OK",
14 | "failure": "Please rename PR to be compliant with conventional commits",
15 | "notice": ""
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
4 |
5 | ### Checklist
6 |
7 |
13 |
14 | - [ ] Changelog updated or skip changelog label added
15 | - [ ] Documentation updated
16 | - [ ] Template tests added for new features
17 | - [ ] Integration tests added or modified for major features
18 |
--------------------------------------------------------------------------------
/.github/workflows/backport_bot.yaml:
--------------------------------------------------------------------------------
1 | name: Backport
2 | on:
3 | pull_request_target:
4 | types:
5 | - closed
6 | - labeled
7 |
8 | jobs:
9 | backport:
10 | if: github.event.pull_request.merged == true
11 | runs-on: ubuntu-22.04
12 | name: Backport
13 | steps:
14 | - name: Generate token
15 | id: generate_token
16 | uses: tibdex/github-app-token@v2
17 | with:
18 | app_id: ${{ secrets.BACKPORT_APP_ID }}
19 | private_key: ${{ secrets.BACKPORT_PRIVATE_KEY }}
20 | # Optional (defaults to the current repository).
21 | # repository: owner/repo
22 |
23 | - name: Backport
24 | uses: tibdex/backport@v2
25 | with:
26 | github_token: ${{ steps.generate_token.outputs.token }}
27 |
--------------------------------------------------------------------------------
/.github/workflows/changelog.yaml:
--------------------------------------------------------------------------------
1 | # This action requires that any PR targeting the main branch should touch at
2 | # least one CHANGELOG file. If a CHANGELOG entry is not required, add the "skip-changelog"
3 | # label to disable this action.
4 |
5 | name: changelog
6 |
7 | on:
8 | pull_request:
9 | types: [opened, synchronize, reopened, labeled, unlabeled]
10 | branches:
11 | - main
12 | jobs:
13 | changelog:
14 | runs-on: ubuntu-latest
15 | if: "!contains(github.event.pull_request.labels.*.name, 'skip-changelog')"
16 | env:
17 | TOWNCRIER_VERSION: 23.11.0
18 | PR_NUMBER: ${{ github.event.number }}
19 | steps:
20 | - uses: actions/checkout@v4
21 | with:
22 | fetch-depth: 50
23 | - name: Add PR base ref
24 | run: |
25 | git fetch origin ${{ github.base_ref }} --depth=50
26 | - name: install towncrier
27 | run: pip install towncrier==${{ env.TOWNCRIER_VERSION }}
28 | - name: Check if new CHANGELOG entries added
29 | run: |
30 | make check-changelog
31 | - name: Check if new CHANGELOG entries reference the correct PR
32 | run: |
33 | git diff --name-only origin/${{ github.base_ref }} HEAD .changelog | grep ${PR_NUMBER}
34 |
--------------------------------------------------------------------------------
/.github/workflows/check_pr_labels.yaml:
--------------------------------------------------------------------------------
1 | name: PRs labels check
2 |
3 | on:
4 | pull_request_target:
5 | types: [opened, edited, reopened, ready_for_review, labeled, unlabeled, synchronize]
6 |
7 | jobs:
8 | label:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: pmalek-sumo/verify-pr-label-action@v1.4.4
12 | with:
13 | github-token: "${{ secrets.GITHUB_TOKEN }}"
14 | invalid-labels: "do-not-merge/hold"
15 | pull-request-number: "${{ github.event.pull_request.number }}"
16 |
17 | pr-name:
18 | runs-on: ubuntu-latest
19 | steps:
20 | - uses: thehanimo/pr-title-checker@v1.4.2
21 | with:
22 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 | pass_on_octokit_error: false
24 |
--------------------------------------------------------------------------------
/.github/workflows/close-jira-task.yaml:
--------------------------------------------------------------------------------
1 | name: Close Jira task
2 |
3 | on:
4 | issues:
5 | types:
6 | - closed
7 |
8 | jobs:
9 | close-jira-issue:
10 | runs-on: ubuntu-22.04
11 | steps:
12 | - name: Close Jira task
13 | id: close-jira-task
14 | run: |-
15 | JIRA_ID=$(curl \
16 | --http1.1 \
17 | -u "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}" \
18 | ${JIRA_BASE_URL}'/rest/api/latest/search?jql=summary~"sumologic-kubernetes-collection%20and%20%23${{ github.event.issue.number }}"' \
19 | | jq '.issues[0].key' --raw-output)
20 |
21 | curl \
22 | --http1.1 \
23 | -u "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}" \
24 | "${JIRA_BASE_URL}/rest/api/latest/issue/${JIRA_ID}/transitions" \
25 | -X POST \
26 | -d '{"update":{"comment":[{"add":{"body":"Resolved via github actions"}}]},"transition":{"id":"31"},"fields":{"resolution":{"name":"Done"}}}' \
27 | -H 'Content-type: application/json'
28 |
29 | env:
30 | JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
31 | JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
32 | JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
33 |
--------------------------------------------------------------------------------
/.github/workflows/create-jira-task.yml:
--------------------------------------------------------------------------------
1 | name: Create Jira task
2 |
3 | on:
4 | issues:
5 | types:
6 | - opened
7 |
8 | jobs:
9 | create-jira-issue:
10 | runs-on: ubuntu-22.04
11 | steps:
12 | - name: Create Jira task
13 | id: create-jira-task
14 | uses: tomhjp/gh-action-jira-create@v0.2.1
15 | env:
16 | JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
17 | JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
18 | JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
19 | with:
20 | project: OSC
21 | issuetype: "Task"
22 | summary: "[sumologic-kubernetes-collection] ${{ github.event.issue.title }} #${{ github.event.issue.number }}"
23 | description: "${{ github.event.issue.body }}\n\nSee: ${{github.event.issue.html_url}}"
24 | extraFields:
25 | '{"labels": ["github_issue", "opensource_gardener"], "priority": {"name": "High"}, "assignee": {"id": "${{ secrets.JIRA_USER_ID
26 | }}"}}'
27 |
--------------------------------------------------------------------------------
/.github/workflows/dev_builds.yml:
--------------------------------------------------------------------------------
1 | name: Dev builds
2 |
3 | on:
4 | push:
5 | branches:
6 | - "dev-build/*"
7 | - main
8 | - "release-v[0-9]+"
9 | - "release-v[0-9]+.[0-9]+"
10 |
11 | jobs:
12 | markdown-link-check:
13 | runs-on: ubuntu-22.04
14 | steps:
15 | - uses: actions/checkout@v4
16 | - uses: gaurav-nelson/github-action-markdown-link-check@v1
17 | with:
18 | config-file: ".markdown_link_check.json"
19 | use-quiet-mode: yes
20 |
21 | push-helm-chart:
22 | runs-on: ubuntu-22.04
23 | steps:
24 | - uses: actions/checkout@v4
25 | - name: Push dev helm chart
26 | run: make push-helm-chart
27 |
28 | integration-tests:
29 | name: Integration Tests
30 | uses: ./.github/workflows/workflow-integration-tests.yaml
31 |
--------------------------------------------------------------------------------
/.github/workflows/pr_labeler.yaml:
--------------------------------------------------------------------------------
1 | name: PRs labeler
2 |
3 | on:
4 | - pull_request_target
5 |
6 | jobs:
7 | triage:
8 | runs-on: ubuntu-22.04
9 | steps:
10 | - uses: actions/labeler@v5
11 | with:
12 | repo-token: "${{ secrets.GITHUB_TOKEN }}"
13 | sync-labels: true
14 |
--------------------------------------------------------------------------------
/.github/workflows/release_builds.yml:
--------------------------------------------------------------------------------
1 | name: Release builds
2 |
3 | on:
4 | push:
5 | tags:
6 | - "v[0-9]+.[0-9]+.[0-9]+"
7 | - "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
8 | - "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
9 | - "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
10 |
11 | jobs:
12 | push-helm-chart:
13 | runs-on: ubuntu-22.04
14 | steps:
15 | - uses: actions/checkout@v4
16 | - name: Push helm chart
17 | run: make push-helm-chart
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Mac OSX ignores
2 | .DS_Store
3 |
4 | # VS Code ignores
5 | .vscode/*
6 | !.vscode/extensions.json
7 | !.vscode/snippets.code-snippets
8 |
9 | # Helm chart dependencies
10 | deploy/helm/sumologic/charts
11 | deploy/helm/sumologic/tmpcharts
12 | deploy/helm/sumologic/requirements.lock
13 |
14 | # Helm chart lock file
15 | deploy/helm/sumologic/Chart.lock
16 |
17 | # vagrant ignores
18 | .vagrant
19 | *.log
20 | .kube-config
21 |
22 | # ignore tmp directories
23 | tmp
24 |
25 | # Go workspace files
26 | go.work
27 | go.work.sum
28 |
29 | # Local values files
30 | values.local.yaml
31 |
32 | # Website cache for the dependency checker
33 | cache
34 |
35 | # Python cache
36 | __pycache__
37 |
--------------------------------------------------------------------------------
/.markdown_link_check.json:
--------------------------------------------------------------------------------
1 | {
2 | "retryOn429": true,
3 | "retryCount": 5,
4 | "fallbackRetryDelay": "30s",
5 | "replacementPatterns": [
6 | {
7 | "pattern": "^/",
8 | "replacement": "{{BASEURL}}/"
9 | }
10 | ],
11 | "ignorePatterns": [
12 | {
13 | "pattern": "^https://mikefarah.gitbook.io/yq"
14 | },
15 | {
16 | "pattern": "^http://localhost"
17 | },
18 | {
19 | "pattern": "^https://stackoverflow.com/"
20 | }
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/.markdownlint.jsonc:
--------------------------------------------------------------------------------
1 | /**
2 | * Note: Configuration for https://github.com/igorshubovych/markdownlint-cli
3 | */
4 | {
5 | "default": true,
6 | "MD004": { "style": "dash" },
7 | "MD013": { "line_length": 360, "code_blocks": false, "tables": false },
8 | "MD024": false, // no-duplicate-heading/no-duplicate-header
9 | "MD033": false, // no-inline-html
10 | "MD034": false, // no-bare-urls
11 | "MD040": false // fenced-code-language
12 | }
13 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Ignore telm templates
2 | deploy/helm/sumologic/conf
3 | deploy/helm/sumologic/templates
4 |
--------------------------------------------------------------------------------
/.prettierrc.yaml:
--------------------------------------------------------------------------------
1 | trailingComma: "es5"
2 | tabWidth: 2
3 | semi: false
4 | singleQuote: false
5 | proseWrap: "always"
6 | printWidth: 140
7 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "davidanson.vscode-markdownlint",
4 | "esbenp.prettier-vscode"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/.vscode/snippets.code-snippets:
--------------------------------------------------------------------------------
1 | // https://code.visualstudio.com/docs/editor/userdefinedsnippets
2 | {
3 | "Link to pull request": {
4 | "scope": "markdown",
5 | "prefix": ["PR"],
6 | "body": ["[#${1:123}]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/${1}"],
7 | "description": "Link to GitHub pull request",
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/.yamllint.yaml:
--------------------------------------------------------------------------------
1 | extends: relaxed
2 |
3 | rules:
4 | comments:
5 | min-spaces-from-content: 1
6 | comments-indentation: disable
7 |
8 | line-length:
9 | max: 140
10 | level: error
11 |
12 | indentation:
13 | level: error
14 | indent-sequences: consistent
15 |
--------------------------------------------------------------------------------
/ROADMAP.md:
--------------------------------------------------------------------------------
1 | # Sumologic Kubernetes Collection Roadmap
2 |
3 | ## [Helm Chart v2][v2]
4 |
5 | This version focuses on incorporating OpenTelemetry Collector as alternative for the following elements:
6 |
7 | - logs collection
8 | - events collection
9 | - metadata enrichment for logs and metrics
10 |
11 | ## [Helm Chart v3][v3]
12 |
13 | In this version Opentelemetry is going to be default choice for the following elements:
14 |
15 | - logs collection
16 | - events collection
17 | - metadata enrichment for logs, events and metrics
18 |
19 | We are going to deprecate Fluent Bit and Fluentd.
20 |
21 | We are also aiming to use OpenTelemetry Collector as alternative to Prometheus.
22 |
23 | ## [Helm Chart v4][v4]
24 |
25 | Fluent Bit and Fluentd are going to be removed and no longer used.
26 |
27 | Prometheus is going to be deprecated and replaced with OpenTelemetry Collector by default.
28 |
29 | ## Helm Chart v5
30 |
31 | In this relase we would like to completely remove support for Prometheus.
32 |
33 | We are also going to move metadata enrichment closer to it's sources, e.g. for logs it's going to be performed by OpenTelemetry Collector
34 | daemonset (node agent)
35 |
36 | [v2]: https://github.com/SumoLogic/sumologic-kubernetes-collection/tree/release-v2
37 | [v3]: https://github.com/SumoLogic/sumologic-kubernetes-collection/tree/release-v3
38 | [v4]: https://github.com/SumoLogic/sumologic-kubernetes-collection/tree/main
39 |
--------------------------------------------------------------------------------
/Vagrantfile:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | Vagrant.configure('2') do |config|
5 | config.vm.box = 'ubuntu/focal64'
6 | config.vm.disk :disk, size: "50GB", primary: true
7 | config.vm.box_check_update = false
8 | config.vm.host_name = 'sumologic-kubernetes-collection'
9 | # Vbox 6.1.28+ restricts host-only adapters to 192.168.56.0/21
10 | # See: https://www.virtualbox.org/manual/ch06.html#network_hostonly
11 | config.vm.network :private_network, ip: "192.168.56.2"
12 |
13 | config.vm.provider 'virtualbox' do |vb|
14 | vb.gui = false
15 | vb.cpus = 8
16 | vb.memory = 16384
17 | vb.name = 'sumologic-kubernetes-collection'
18 | end
19 |
20 | config.vm.provider "qemu" do |qe, override|
21 | override.vm.box = "perk/ubuntu-2204-arm64"
22 | qe.gui = false
23 | qe.smp = 8
24 | qe.memory = 16384
25 | qe.name = 'sumologic-kubernetes-collection'
26 | end
27 |
28 | config.vm.provision 'shell', path: 'vagrant/provision.sh'
29 |
30 | config.vm.synced_folder ".", "/sumologic"
31 | end
--------------------------------------------------------------------------------
/ci/check_dependencies/README.md:
--------------------------------------------------------------------------------
1 | # dependency-checker
2 |
3 | Dependency checker uses web scraping to get information about:
4 |
5 | - platforms suppported by [Sumologic Kubernetes Helm Chart][helm-chart]
6 | - subcharts which are use in [Sumologic Kubernetes Helm Chart][helm-chart]
7 |
8 | ## Usage
9 |
10 | ### Prepare a virtualenv and activate it
11 |
12 | ```bash
13 | python -m venv .venv
14 | source .venv/bin/activate
15 | ```
16 |
17 | ### Install dependencies
18 |
19 | ```bash
20 | pip install -r requirements.txt
21 | ```
22 |
23 | ### Run the script
24 |
25 | ```bash
26 | python main.py
27 | ```
28 |
29 | Web pages used to get information are saved in `cache` directory to clean it please run:
30 |
31 | ```bash
32 | rm -r ./cache
33 | ```
34 |
35 | [helm-chart]: https://github.com/SumoLogic/sumologic-kubernetes-collection
36 |
--------------------------------------------------------------------------------
/ci/check_dependencies/issue_header.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "{{ env.ISSUE_TITLE }}"
3 | labels: dependencies
4 | ---
5 |
6 | This issue was automatically generated by the `check_dependencies` tool located in [ci/check_dependencies][ci_check_dependencies].
7 |
8 | [ci_check_dependencies]: https://github.com/SumoLogic/sumologic-kubernetes-collection/tree/main/ci/check_dependencies
9 |
--------------------------------------------------------------------------------
/ci/check_dependencies/kubernetes_collection.py:
--------------------------------------------------------------------------------
1 | import requests
2 | import traceback
3 | import os
4 | import json
5 | import kubernetes_collection
6 |
7 |
8 | def get_kubernetes_collection_readme():
9 | result = requests.get(
10 | "https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/main/docs/README.md"
11 | )
12 | if result.status_code == 200:
13 | return result.text
14 | return None
15 |
16 |
17 | def get_platform_readme_line(readme, line_pattern):
18 | lines = readme.split("\n")
19 | platform_line = ""
20 | for line in lines:
21 | if line_pattern in line:
22 | platform_line = line
23 | break
24 | return platform_line.strip()
25 |
26 |
27 | def get_platform_versions_from_readme(readme, line_pattern):
28 | platform_line = get_platform_readme_line(readme, line_pattern)
29 | platform_table = [x for x in platform_line.split("|") if x]
30 | versions = platform_table[1].strip().split("
")
31 | return sorted(versions)
32 |
33 |
34 | def get_supported_versions(line_pattern):
35 | readme = get_kubernetes_collection_readme()
36 | versions = get_platform_versions_from_readme(readme, line_pattern)
37 | return versions
38 |
--------------------------------------------------------------------------------
/ci/check_dependencies/main.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 | import kops
4 | import eks
5 | import gke
6 | import aks
7 | import openshift
8 |
9 | import helm_charts
10 |
11 | parser = argparse.ArgumentParser(
12 | prog="dependency_checker",
13 | description="dependency_checker checks whether any dependencies or supported platforms need to be updated"
14 | )
15 | parser.add_argument("-q", "--quiet", action="store_true")
16 |
17 | if __name__ == "__main__":
18 | args = parser.parse_args()
19 | output_lines = []
20 | output_lines.append("Gardener helper")
21 | output_lines.append("#####################################################################")
22 | output_lines.append("")
23 | output_lines.extend(kops.get_info())
24 | output_lines.extend(eks.get_info())
25 | output_lines.extend(gke.get_info())
26 | output_lines.extend(aks.get_info())
27 | output_lines.extend(openshift.get_info())
28 |
29 | if not len(output_lines) == 3:
30 | output_lines.append("")
31 |
32 | output_lines.extend(helm_charts.get_info())
33 |
34 | if len(output_lines) == 3:
35 | output_lines.append("No changes are required")
36 |
37 | if not args.quiet or len(output_lines) > 4:
38 | for line in output_lines:
39 | print(line)
40 |
--------------------------------------------------------------------------------
/ci/check_dependencies/requirements.txt:
--------------------------------------------------------------------------------
1 | requests~=2.31.0
2 | lxml~=4.9.3
3 | pandas~=2.1.2
4 | PyYaml~=6.0.1
5 | beautifulsoup4~=4.11.2
--------------------------------------------------------------------------------
/ci/check_unused_templates.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # This scripts checks for unused helm template definitions
4 | TEMPLATES=$(cat deploy/helm/sumologic/templates/_helpers/*.tpl | grep define | grep -oP '".*?"' || true)
5 | RETURN=0
6 | for template in ${TEMPLATES}; do
7 | if ! grep -P "(template|include) ${template}" deploy/helm/sumologic -R > /dev/null; then
8 | echo "${template}";
9 | RETURN=1
10 | fi
11 | done
12 |
13 | exit "${RETURN}"
14 |
--------------------------------------------------------------------------------
/ci/jsonnet-mixin.tmpl:
--------------------------------------------------------------------------------
1 | {
2 | _config+:: {
3 | sumologicCollectorSvc: 'http://collection-sumologic.sumologic.svc.cluster.local.:9888/',
4 | clusterName: "kubernetes"
5 | },
6 | sumologicCollector:: {
7 | remoteWriteConfigs+: [/*REMOTE_WRITE*/],
8 | },
9 | prometheus+:: {
10 | prometheus+: {
11 | spec+: {
12 | remoteWrite+: $.sumologicCollector.remoteWriteConfigs,
13 | externalLabels+: {
14 | cluster: $._config.clusterName,
15 | },
16 | },
17 | },
18 | },
19 | }
20 |
--------------------------------------------------------------------------------
/ci/markdown_link_check.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | if ! markdown-link-check --help >/dev/null 2>&1 ; then
4 | echo "markdown-link-check not found, please install it with 'npm install -g markdown-link-check'"
5 | exit 1
6 | fi
7 |
8 | # Get all markdown files
9 | ALL_FILES=$(find . -type f -name '*.md')
10 | readonly ALL_FILES
11 |
12 | # Use the files passed as command line arguments if provided, otherwise all of them
13 | readonly FILES=${*:-${ALL_FILES}}
14 |
15 | for file in ${FILES}; do
16 | markdown-link-check --progress --verbose --retry \
17 | --config .markdown_link_check.json "${file}"
18 | done
19 |
--------------------------------------------------------------------------------
/ci/markdown_links_lint.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -euo pipefail
4 |
5 | GREP="grep"
6 | OS="$(uname -s)"
7 | if [[ "${OS}" == "Darwin" ]]; then
8 | GREP="ggrep"
9 | fi
10 |
11 | if ! command -v "${GREP}" ; then
12 | echo "${GREP} is missing from the system, please install it."
13 | exit 1
14 | fi
15 |
16 | # Get all markdown files
17 | readonly FILES=$(find . -type f -name '*.md')
18 |
19 | RET_VAL=0
20 |
21 | for file in ${FILES}; do
22 | # '\[[^\]]*\]\([^\)]*\)' - get all markdown links [*](*)
23 | # filter in only linked to this repository
24 | # filter out all links pointing to specific release, tag or commit
25 | # filter out links ended with /releases
26 | if "${GREP}" -HnoP '\[[^\]]*\]\([^\)]*\)' "${file}" \
27 | | "${GREP}" 'github.com/sumologic/sumologic-kubernetes-collection' \
28 | | "${GREP}" -vP '(\/(blob|tree)\/(v\d+\.|[a-f0-9]{40}\/|release\-))' \
29 | | "${GREP}" -vP '\/releases\)'; then
30 |
31 | RET_VAL=1
32 | fi
33 | done
34 |
35 | exit "${RET_VAL}"
36 |
--------------------------------------------------------------------------------
/ci/push-helm-chart.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -euo pipefail
4 |
5 | ROOT_DIR="$(dirname "$(dirname "${0}")")"
6 | readonly ROOT_DIR="${ROOT_DIR}"
7 |
8 | # shellcheck disable=SC1090,SC1091
9 | source "${ROOT_DIR}"/ci/_build_functions.sh
10 |
11 | fetch_current_branch
12 | RELEASE_VERSION="$(git describe --tags --abbrev=10)"
13 | readonly RELEASE_VERSION="${RELEASE_VERSION#v}"
14 | DEV_VERSION="$(git describe --tags --long --abbrev=10)"
15 | readonly DEV_VERSION="${DEV_VERSION#v}"
16 |
17 | pushd "${ROOT_DIR}" || exit 1
18 |
19 | set_up_github
20 |
21 | PWD=$(pwd)
22 | echo "Pushing helm chart in: ${PWD} with version tag: ${DEV_VERSION} to the dev catalog"
23 | push_helm_chart "${DEV_VERSION}" "./dev"
24 |
25 | echo "Pruning the dev Helm Chart releases older than one month"
26 | max_age_timestamp="$(date --date="-1 month" +"%s")"
27 | major_version_number=$(echo "${DEV_VERSION}" | cut -dv -f2 | cut -d. -f1)
28 | prune_helm_releases "./dev" "${max_age_timestamp}" "${major_version_number}"
29 |
30 | # shellcheck disable=SC2310
31 | if is_checkout_on_tag; then
32 | echo "Pushing helm chart in: ${PWD} with version tag: ${RELEASE_VERSION} to the release catalog"
33 | push_helm_chart "${RELEASE_VERSION}" "."
34 | fi
35 |
36 | popd || exit 1
37 |
38 | echo "DONE"
39 |
--------------------------------------------------------------------------------
/ci/shellcheck.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -euo pipefail
4 |
5 | echo "Checking the bash scripts with shellcheck..."
6 | find . -name '*.sh' -type 'f' -print |
7 | while read -r file; do
8 | # Run tests in their own context
9 | echo "Checking ${file} with shellcheck"
10 | shellcheck --enable all --external-sources --exclude SC2155 "${file}"
11 | done
12 |
--------------------------------------------------------------------------------
/ci/sync-repository.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | SRC_REPOSITORY=${1}
4 | DESTINATION_NAMESPACE=${2}
5 |
6 | docker run \
7 | -v ~/.docker/config.json:/tmp/auth.json \
8 | quay.io/skopeo/stable:v1.15.0 \
9 | sync \
10 | --all \
11 | --keep-going \
12 | --preserve-digests \
13 | --retry-times 5 \
14 | --src docker \
15 | --src-no-creds \
16 | --dest docker \
17 | "${SRC_REPOSITORY}" \
18 | "${DESTINATION_NAMESPACE}"
19 |
--------------------------------------------------------------------------------
/deploy/README.md:
--------------------------------------------------------------------------------
1 | # Deployment Guide for unreleased version
2 |
3 | Moved to [/docs/README.md](/docs/README.md)
4 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/.helmignore:
--------------------------------------------------------------------------------
1 | # Patterns to ignore when building packages.
2 | # This supports shell glob matching, relative path matching, and
3 | # negation (prefixed with !). Only one pattern per line.
4 | .DS_Store
5 | # Common VCS dirs
6 | .git/
7 | .gitignore
8 | .bzr/
9 | .bzrignore
10 | .hg/
11 | .hgignore
12 | .svn/
13 | # Common backup files
14 | *.swp
15 | *.bak
16 | *.tmp
17 | *~
18 | # Various IDEs
19 | .project
20 | .idea/
21 | *.tmproj
22 | .vscode/
23 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/conf/cleanup/cleanup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -euo pipefail
4 |
5 | # Support proxy for Terraform
6 | export HTTP_PROXY="${HTTP_PROXY:=""}"
7 | export HTTPS_PROXY="${HTTPS_PROXY:=""}"
8 | export NO_PROXY="${NO_PROXY:=""}"
9 |
10 | readonly SUMOLOGIC_COLLECTOR_NAME="${SUMOLOGIC_COLLECTOR_NAME:?}"
11 | readonly SUMOLOGIC_SECRET_NAME="${SUMOLOGIC_SECRET_NAME:?}"
12 | readonly NAMESPACE="${NAMESPACE:?}"
13 |
14 | # Set variables for terraform
15 | export TF_VAR_collector_name="${SUMOLOGIC_COLLECTOR_NAME}"
16 | export TF_VAR_secret_name="${SUMOLOGIC_SECRET_NAME}"
17 | export TF_VAR_chart_version="${CHART_VERSION:?}"
18 | export TF_VAR_namespace_name="${NAMESPACE:?}"
19 |
20 | cp /etc/terraform/* /terraform/
21 | cd /terraform || exit 1
22 |
23 | # Fall back to init -upgrade to prevent:
24 | # Error: Inconsistent dependency lock file
25 | terraform init -input=false -get=false || terraform init -input=false -upgrade
26 |
27 | # shellcheck disable=SC1083
28 | terraform import sumologic_collector.collector "${SUMOLOGIC_COLLECTOR_NAME}"
29 | # shellcheck disable=SC1083
30 | terraform import kubernetes_secret.sumologic_collection_secret "${NAMESPACE}/${SUMOLOGIC_SECRET_NAME}"
31 |
32 | terraform destroy -auto-approve
33 |
34 | # Cleanup env variables
35 | export SUMOLOGIC_ACCESSKEY=
36 | export SUMOLOGIC_ACCESSID=
37 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/conf/metrics/remote-write-proxy/remote-write-proxy.conf:
--------------------------------------------------------------------------------
1 | upstream remote_prometheus {
2 | server {{ template "sumologic.metadata.name.metrics.service" . }}:9888;
3 | }
4 |
5 | upstream remote_otel {
6 | server {{ template "sumologic.metadata.name.metrics.service" . }}:4318;
7 | }
8 |
9 | server {
10 | listen {{ .Values.sumologic.metrics.remoteWriteProxy.config.port }} default_server;
11 | {{- if not .Values.sumologic.metrics.remoteWriteProxy.config.enableAccessLogs }}
12 | access_log off;
13 | {{- end }}
14 | location / {
15 | client_body_buffer_size {{ .Values.sumologic.metrics.remoteWriteProxy.config.clientBodyBufferSize }};
16 | proxy_pass http://remote_prometheus;
17 | }
18 | }
19 |
20 | server {
21 | listen 4318 default_server;
22 | {{- if not .Values.sumologic.metrics.remoteWriteProxy.config.enableAccessLogs }}
23 | access_log off;
24 | {{- end }}
25 | location / {
26 | client_body_buffer_size {{ .Values.sumologic.metrics.remoteWriteProxy.config.clientBodyBufferSize }};
27 | proxy_pass http://remote_otel;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/conf/setup/fields.tf:
--------------------------------------------------------------------------------
1 | resource "sumologic_field" "collection_field" {
2 | for_each = var.create_fields ? toset(var.fields) : toset([])
3 |
4 | lifecycle {
5 | # ignore changes for name and type, as older installations have been case sensitive
6 | # see: https://github.com/SumoLogic/sumologic-kubernetes-collection/issues/2865
7 | ignore_changes = [field_name, data_type]
8 | }
9 |
10 | field_name = each.key
11 | data_type = "String"
12 | state = "Enabled"
13 | }
14 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/conf/setup/main.tf:
--------------------------------------------------------------------------------
1 | terraform {
2 | required_providers {
3 | sumologic = {
4 | source = "sumologic/sumologic"
5 | version = ">= 2.31.0, < 3.0.0"
6 | }
7 | kubernetes = {
8 | source = "hashicorp/kubernetes"
9 | version = "~> 2.32.0"
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/conf/setup/providers.tf.json:
--------------------------------------------------------------------------------
1 | {{- $kubernetesProvider := deepCopy .Values.sumologic.cluster -}}
2 | {{- $sumoProvider := dict -}}
3 | {{- $providers := dict "sumologic" $sumoProvider "kubernetes" $kubernetesProvider -}}
4 | {{- $terraformData := dict "provider" $providers -}}
5 | {{- toPrettyJson $terraformData | nindent 2 }}
6 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/conf/setup/resources.tf:
--------------------------------------------------------------------------------
1 | resource "sumologic_collector" "collector" {
2 | name = var.collector_name
3 | description = format("Sumo Logic Kubernetes Collection\nversion: %s", var.chart_version)
4 | fields = var.collector_fields
5 | }
6 |
7 | resource "kubernetes_secret" "sumologic_collection_secret" {
8 | metadata {
9 | name = var.secret_name
10 | namespace = var.namespace_name
11 | }
12 |
13 | data = {
14 | for name, config in local.source_configs : config["config-name"] => lookup(local.sources, name).url
15 | }
16 |
17 | type = "Opaque"
18 | wait_for_service_account_token = false
19 | }
20 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/conf/setup/terraform.tfvars.json:
--------------------------------------------------------------------------------
1 | {{- $fields := concat .Values.sumologic.logs.fields .Values.sumologic.logs.additionalFields -}}
2 | {{- $collectorFields := .Values.sumologic.collector.fields -}}
3 | {{- $variables := dict "fields" $fields "collector_fields" $collectorFields -}}
4 | {{- toPrettyJson $variables | nindent 2 }}
5 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/conf/setup/variables.tf:
--------------------------------------------------------------------------------
1 | variable "collector_name" {
2 | type = string
3 | }
4 |
5 | variable "namespace_name" {
6 | type = string
7 | }
8 |
9 | variable "secret_name" {
10 | type = string
11 | }
12 |
13 | variable "create_fields" {
14 | description = "If set, Terraform will attempt to create fields at Sumo Logic"
15 | type = bool
16 | default = true
17 | }
18 |
19 | variable "fields" {
20 | description = "Log fields to create."
21 | type = list(string)
22 | }
23 |
24 | variable "collector_fields" {
25 | description = "Fields to set on the collector."
26 | type = map(string)
27 | }
28 |
29 | variable "chart_version" {
30 | description = "The Helm Chart version."
31 | type = string
32 | }
33 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/_helpers/_api_versions.tpl:
--------------------------------------------------------------------------------
1 | {{/*
2 | Use PodDisruptionBudget apiVersion that is available on the cluster
3 |
4 | Example Usage:
5 | apiVersion: {{ include "apiVersion.podDisruptionBudget" . }}
6 |
7 | */}}
8 | {{- define "apiVersion.podDisruptionBudget" -}}
9 | {{- if .Capabilities.APIVersions.Has "policy/v1" -}}
10 | policy/v1
11 | {{- else -}}
12 | policy/v1beta1
13 | {{- end -}}
14 | {{- end -}}
15 |
16 | {{/*
17 | Use HorizontalPodAutoscaler apiVersion that is available on the cluster
18 |
19 | Example Usage:
20 | apiVersion: {{ include "apiVersion.horizontalPodAutoscaler" . }}
21 |
22 | */}}
23 | {{- define "apiVersion.horizontalPodAutoscaler" -}}
24 | {{- if .Capabilities.APIVersions.Has "autoscaling/v2" -}}
25 | autoscaling/v2
26 | {{- else -}}
27 | autoscaling/v2beta2
28 | {{- end -}}
29 | {{- end -}}
30 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/chart-configmap.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ConfigMap
3 | metadata:
4 | name: sumologic-configmap
5 | namespace: {{ template "sumologic.namespace" . }}
6 | labels:
7 | {{- include "sumologic.labels.common" . | nindent 4 }}
8 | data:
9 | metadataLogs: {{ template "sumologic.metadata.name.logs.service" . }}
10 | metadataMetrics: {{ template "sumologic.metrics.metadata.endpoint" . }}
11 | metadataNamespace: {{ template "sumologic.namespace" . }}
12 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/cleanup/configmap.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.cleanupEnabled }}
2 | apiVersion: v1
3 | kind: ConfigMap
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.cleanup.configmap" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | annotations:
8 | {{ include "sumologic.annotations.app.cleanup.helmsh" "0" | indent 4 }}
9 | labels:
10 | app: {{ template "sumologic.labels.app.cleanup.configmap" . }}
11 | {{- include "sumologic.labels.common" . | nindent 4 }}
12 | data:
13 | {{- (.Files.Glob "conf/cleanup/cleanup.sh").AsConfig | nindent 2 }}
14 | {{- (.Files.Glob "conf/setup/*.{tf,sh}").AsConfig | nindent 2 }}
15 | {{- (tpl (.Files.Glob "conf/setup/*.json").AsConfig .) | nindent 2 }}
16 | {{- end }}
17 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/cleanup/role.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.cleanupEnabled }}
2 | apiVersion: rbac.authorization.k8s.io/v1
3 | kind: Role
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.cleanup.roles.role" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | annotations:
8 | {{ include "sumologic.annotations.app.cleanup.helmsh" "1" | indent 4 }}
9 | labels:
10 | app: {{ template "sumologic.labels.app.cleanup.roles.role" . }}
11 | {{- include "sumologic.labels.common" . | nindent 4 }}
12 | rules:
13 | - apiGroups:
14 | - ""
15 | resources:
16 | - secrets
17 | verbs: ["get", "list", "describe", "delete"]
18 | resourceNames: ["{{ template "terraform.secret.name" }}"]
19 | {{- end }}
20 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/cleanup/rolebinding.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.cleanupEnabled }}
2 | apiVersion: rbac.authorization.k8s.io/v1
3 | kind: RoleBinding
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.cleanup.roles.rolebinding" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | annotations:
8 | {{ include "sumologic.annotations.app.cleanup.helmsh" "2" | indent 4 }}
9 | labels:
10 | app: {{ template "sumologic.labels.app.cleanup.roles.rolebinding" . }}
11 | {{- include "sumologic.labels.common" . | nindent 4 }}
12 | roleRef:
13 | apiGroup: rbac.authorization.k8s.io
14 | kind: Role
15 | name: {{ template "sumologic.metadata.name.cleanup.roles.role" . }}
16 | subjects:
17 | - kind: ServiceAccount
18 | name: {{ template "sumologic.metadata.name.cleanup.roles.serviceaccount" . }}
19 | namespace: {{ template "sumologic.namespace" . }}
20 | {{- end }}
21 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/cleanup/secret.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.cleanupEnabled }}
2 | {{- if not .Values.sumologic.envFromSecret }}
3 | apiVersion: v1
4 | kind: Secret
5 | metadata:
6 | name: {{ template "sumologic.metadata.name.cleanup.secret" . }}
7 | namespace: {{ template "sumologic.namespace" . }}
8 | annotations:
9 | {{ include "sumologic.annotations.app.cleanup.helmsh" "3" | indent 4 }}
10 | labels:
11 | app: {{ template "sumologic.labels.app.cleanup.secret" . }}
12 | {{- include "sumologic.labels.common" . | nindent 4 }}
13 | data:
14 | {{- if eq (include "sumologic-mock.local-mode-enabled" .) "true" }}
15 | SUMOLOGIC_ACCESSID: {{ "dummy" | b64enc }}
16 | SUMOLOGIC_ACCESSKEY: {{ "dummy" | b64enc }}
17 | {{- else }}
18 | SUMOLOGIC_ACCESSID: {{ required "A valid .Values.sumologic.accessId entry required!" .Values.sumologic.accessId | b64enc }}
19 | SUMOLOGIC_ACCESSKEY: {{ required "A valid .Values.sumologic.accessKey entry required!" .Values.sumologic.accessKey | b64enc }}
20 | {{- end }}
21 | {{- end }}
22 | {{- end }}
23 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/cleanup/serviceaccount.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.cleanupEnabled }}
2 | apiVersion: v1
3 | kind: ServiceAccount
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.cleanup.roles.serviceaccount" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | annotations:
8 | {{ include "sumologic.annotations.app.cleanup.helmsh" "0" | indent 4 }}
9 | {{- with .Values.sumologic.serviceAccount.annotations }}
10 | {{- toYaml . | nindent 4 }}
11 | {{- end }}
12 | labels:
13 | app: {{ template "sumologic.labels.app.cleanup.roles.serviceaccount" . }}
14 | {{- include "sumologic.labels.common" . | nindent 4 }}
15 | {{- end }}
16 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/clusterrole.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: rbac.authorization.k8s.io/v1
2 | kind: ClusterRole
3 | metadata:
4 | name: {{ template "sumologic.metadata.name.roles.clusterrole" . }}
5 | labels:
6 | app: {{ template "sumologic.labels.app.roles.clusterrole" . }}
7 | {{- include "sumologic.labels.common" . | nindent 4 }}
8 | rules:
9 | - apiGroups: ["", "apps", "extensions", "batch", "events.k8s.io", "discovery.k8s.io"]
10 | resources:
11 | - configmaps
12 | - daemonsets
13 | - deployments
14 | - endpoints
15 | - endpointslices
16 | - events
17 | - namespaces
18 | - nodes
19 | - pods
20 | - replicasets
21 | - services
22 | - statefulsets
23 | - cronjobs
24 | - jobs
25 | verbs: ["get", "list", "watch"]
26 | - apiGroups: [""]
27 | resources:
28 | - configmaps
29 | verbs: ["create", "patch"]
30 | {{- if index .Values "opentelemetry-operator" "enabled" }}
31 | - apiGroups: ["opentelemetry.io"]
32 | resources:
33 | - instrumentations
34 | verbs: ["patch", "get", "create"]
35 | {{- end }}
36 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/clusterrolebinding.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: rbac.authorization.k8s.io/v1
2 | kind: ClusterRoleBinding
3 | metadata:
4 | name: {{ template "sumologic.metadata.name.roles.clusterrolebinding" . }}
5 | labels:
6 | app: {{ template "sumologic.labels.app.roles.clusterrolebinding" . }}
7 | {{- include "sumologic.labels.common" . | nindent 4 }}
8 | subjects:
9 | - kind: ServiceAccount
10 | namespace: {{ template "sumologic.namespace" . }}
11 | name: {{ template "sumologic.metadata.name.roles.serviceaccount" . }}
12 | roleRef:
13 | kind: ClusterRole
14 | name: {{ template "sumologic.metadata.name.roles.clusterrole" . }}
15 | apiGroup: rbac.authorization.k8s.io
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/events/common/service-headless.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "events.enabled" .) "true" }}
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.events.service-headless" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.events.service-headless" . }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | {{- include "sumologic.labels.events" . | nindent 4 }}
11 | {{- if .Values.metadata.serviceLabels }}
12 | {{ toYaml .Values.metadata.serviceLabels | indent 4 }}
13 | {{- end }}
14 | spec:
15 | selector:
16 | app: {{ template "sumologic.labels.app.events.pod" . }}
17 | clusterIP: None
18 | ports:
19 | - name: metrics
20 | port: 24231
21 | targetPort: 24231
22 | protocol: TCP
23 | - name: otelcol-metrics
24 | port: 8888
25 | targetPort: 8888
26 | protocol: TCP
27 | {{- end }}
28 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/events/common/service.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "events.enabled" .) "true" }}
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.events.service" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.events.service" . }}
9 | {{- include "sumologic.labels.scrape.events" . | nindent 4 }}
10 | {{- include "sumologic.labels.common" . | nindent 4 }}
11 | {{- if .Values.metadata.serviceLabels }}
12 | {{ toYaml .Values.metadata.serviceLabels | indent 4 }}
13 | {{- end }}
14 | spec:
15 | selector:
16 | app: {{ template "sumologic.labels.app.events.pod" . }}
17 | ports:
18 | - name: metrics
19 | port: 24231
20 | targetPort: 24231
21 | protocol: TCP
22 | - name: otelcol-metrics
23 | port: 8888
24 | targetPort: 8888
25 | protocol: TCP
26 | {{- end }}
27 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/events/otelcol/configmap.yaml:
--------------------------------------------------------------------------------
1 | {{ if eq (include "events.otelcol.enabled" .) "true" }}
2 | {{ $baseConfig := (tpl (.Files.Get "conf/events/otelcol/config.yaml") .) | fromYaml }}
3 | {{ $mergeConfig := .Values.otelevents.config.merge }}
4 | {{ $overrideConfig := .Values.otelevents.config.override }}
5 | {{ $finalConfig := "" }}
6 | {{ if $overrideConfig }}
7 | {{ $finalConfig = $overrideConfig }}
8 | {{ else }}
9 | {{ $finalConfig = mergeOverwrite $baseConfig $mergeConfig }}
10 | {{ end }}
11 | apiVersion: v1
12 | kind: ConfigMap
13 | metadata:
14 | name: {{ template "sumologic.metadata.name.events.configmap" . }}
15 | namespace: {{ template "sumologic.namespace" . }}
16 | labels:
17 | app: {{ template "sumologic.labels.app.events.configmap" . }}
18 | {{- include "sumologic.labels.common" . | nindent 4 }}
19 | data:
20 | config.yaml: |
21 | {{- $finalConfig | toYaml | nindent 4 }}
22 | {{ end }}
23 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/instrumentation/traces-gateway/service.yaml:
--------------------------------------------------------------------------------
1 | {{ $tracesGatewayEnabled := .Values.tracesGateway.enabled }}
2 | {{ $tracesEnabled := .Values.sumologic.traces.enabled }}
3 | {{- if and $tracesEnabled $tracesGatewayEnabled }}
4 | apiVersion: v1
5 | kind: Service
6 | metadata:
7 | name: {{ template "sumologic.metadata.name.tracesgateway.service" . }}
8 | namespace: {{ template "sumologic.namespace" . }}
9 | labels:
10 | app: {{ template "sumologic.labels.app.tracesgateway.service" . }}
11 | {{- include "sumologic.labels.scrape.instrumentation" . | nindent 4 }}
12 | {{- include "sumologic.labels.common" . | nindent 4 }}
13 | spec:
14 | selector:
15 | app: {{ template "sumologic.labels.app.tracesgateway.pod" . }}
16 | component: {{ template "sumologic.labels.app.tracesgateway.component" . }}
17 | ports:
18 | - name: pprof
19 | port: 1777
20 | - name: metrics # Default endpoint for querying metrics.
21 | port: 8888
22 | - name: otlp-grpc # Default endpoint for OTLP gRPC receiver.
23 | port: 4317
24 | - name: otlp-http # Default endpoint for OTLP HTTP receiver.
25 | port: 4318
26 | {{- end }}
27 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/instrumentation/traces-sampler/configmap.yaml:
--------------------------------------------------------------------------------
1 | {{ $tracesEnabled := .Values.sumologic.traces.enabled }}
2 | {{- if $tracesEnabled }}
3 | {{ $baseConfig := (tpl (.Files.Get "conf/instrumentation/traces.sampler.conf.yaml") .) | fromYaml }}
4 | {{ $mergeConfig := .Values.tracesSampler.config.merge }}
5 | {{ $overrideConfig := .Values.tracesSampler.config.override }}
6 | {{ $finalConfig := "" }}
7 | {{ if $overrideConfig }}
8 | {{ $finalConfig = $overrideConfig }}
9 | {{ else }}
10 | {{ $finalConfig = mergeOverwrite $baseConfig $mergeConfig }}
11 | {{ end }}
12 | {{ $valuesYamlConfig := .Values.tracesSampler.config }}
13 | {{ $useValuesYamlConfig := include "useDefaultConfig" $valuesYamlConfig | trim }}
14 | {{ if eq $useValuesYamlConfig "true" }}
15 | {{ $oldConfig := include "removeMergeAndOverrideKeys" .Values.tracesSampler.config | fromYaml }}
16 | {{ $finalConfig = mergeOverwrite $baseConfig $oldConfig }}
17 | {{ end }}
18 | apiVersion: v1
19 | kind: ConfigMap
20 | metadata:
21 | name: {{ template "sumologic.metadata.name.tracessampler.configmap" . }}
22 | namespace: {{ template "sumologic.namespace" . }}
23 | labels:
24 | app: {{ template "sumologic.labels.app.tracessampler.configmap" . }}
25 | {{- include "sumologic.labels.common" . | nindent 4 }}
26 | data:
27 | traces.sampler.conf.yaml: |
28 | {{- $finalConfig | toYaml | nindent 4 }}
29 | {{- end }}
30 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/instrumentation/traces-sampler/service-headless.yaml:
--------------------------------------------------------------------------------
1 | {{ $tracesSampler := .Values.tracesSampler }}
2 | {{ $tracesEnabled := .Values.sumologic.traces.enabled }}
3 | {{- if eq $tracesEnabled true }}
4 | apiVersion: v1
5 | kind: Service
6 | metadata:
7 | name: {{ template "sumologic.metadata.name.tracessampler.service-headless" . }}
8 | namespace: {{ template "sumologic.namespace" . }}
9 | labels:
10 | app: {{ template "sumologic.labels.app.tracessampler.service-headless" . }}
11 | {{- include "sumologic.labels.scrape.instrumentation" . | nindent 4 }}
12 | {{- include "sumologic.labels.common" . | nindent 4 }}
13 | spec:
14 | # Otel DNS load balancing requires collector service to be headless
15 | # in order to skip k8s load balancing and instead populate DNS records.
16 | clusterIP: None
17 | selector:
18 | app: {{ template "sumologic.labels.app.tracessampler.pod" . }}
19 | ports:
20 | - name: pprof
21 | port: 1777
22 | - name: metrics # Default endpoint for querying metrics.
23 | port: 8888
24 | - name: otlp-grpc # Default endpoint for OTLP gRPC receiver.
25 | port: 4317
26 | - name: otlp-http # Default endpoint for OTLP HTTP receiver.
27 | port: 4318
28 | {{- end }}
29 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/logs/collector/common/service.yaml:
--------------------------------------------------------------------------------
1 | {{- if or (and (eq (include "logs.collector.otelcol.enabled" .) "true") (.Values.otellogs.metrics.enabled)) (and (eq (include "logs.collector.otellogswindows.enabled" .) "true") (.Values.otellogswindows.metrics.enabled)) }}
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.logs.collector.service" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.logs.collector.service" . }}
9 | {{- include "sumologic.labels.scrape.logs.collector" . | nindent 4 }}
10 | {{- include "sumologic.labels.common" . | nindent 4 }}
11 | {{- if .Values.otellogs.serviceLabels }}
12 | {{ toYaml .Values.otellogs.serviceLabels | indent 4 }}
13 | {{- end }}
14 | spec:
15 | selector:
16 | app.kubernetes.io/app-name: {{ (include "sumologic.labels.app.logs.collector.pod" .) | trunc 63 | trimSuffix "-" }}
17 | ports:
18 | - name: metrics
19 | port: 8888
20 | targetPort: 8888
21 | protocol: TCP
22 | {{- end }}
23 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/logs/collector/common/serviceaccount.yaml:
--------------------------------------------------------------------------------
1 | {{- if or (eq (include "logs.collector.otelcol.enabled" .) "true") (eq (include "logs.collector.otellogswindows.enabled" .) "true") }}
2 | apiVersion: v1
3 | kind: ServiceAccount
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.logs.collector.serviceaccount" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.logs.collector.serviceaccount" . }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | {{- if .Values.sumologic.serviceAccount.annotations }}
11 | annotations:
12 | {{ toYaml .Values.sumologic.serviceAccount.annotations | indent 2 }}
13 | {{- end }}
14 | {{- if .Values.sumologic.pullSecrets }}
15 | imagePullSecrets:
16 | {{ toYaml .Values.sumologic.pullSecrets | indent 2 }}
17 | {{- end }}
18 | {{- end }}
19 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/logs/collector/otelcol-cloudwatch/configmap.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.logs.collector.otelcloudwatch.enabled }}
2 | {{ $baseConfig := (tpl (.Files.Get "conf/logs/collector/otelcloudwatch/config.yaml") .) | fromYaml }}
3 | {{ $mergeConfig := .Values.otellogs.config.merge }}
4 | {{ $overrideConfig := .Values.otellogs.config.override }}
5 | {{ $finalConfig := "" }}
6 | {{ if $overrideConfig }}
7 | {{ $finalConfig = $overrideConfig }}
8 | {{ else }}
9 | {{ $finalConfig = mergeOverwrite $baseConfig $mergeConfig }}
10 | {{ end }}
11 | apiVersion: v1
12 | kind: ConfigMap
13 | metadata:
14 | name: {{ template "sumologic.metadata.name.logs.collector.cloudwatch" . }}
15 | namespace: {{ template "sumologic.namespace" . }}
16 | labels:
17 | app: {{ template "sumologic.labels.app.logs.cloudwatch.configmap" . }}
18 | {{- include "sumologic.labels.common" . | nindent 4 }}
19 | data:
20 | config.yaml: |
21 | {{- $finalConfig | toYaml | nindent 4 }}
22 | {{- end }}
23 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/logs/collector/otelcol-cloudwatch/serviceaccount.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.logs.collector.otelcloudwatch.enabled }}
2 | apiVersion: v1
3 | kind: ServiceAccount
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.logs.collector.cloudwatch.serviceaccount" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.metadata.name.logs.collector.cloudwatch.serviceaccount" . }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | {{- if and .Values.sumologic.logs.collector.otelcloudwatch.enabled .Values.sumologic.logs.collector.otelcloudwatch.roleArn}}
11 | annotations:
12 | eks.amazonaws.com/role-arn: {{ .Values.sumologic.logs.collector.otelcloudwatch.roleArn }}
13 | {{- end }}
14 | {{- if .Values.sumologic.pullSecrets }}
15 | imagePullSecrets:
16 | {{ toYaml .Values.sumologic.pullSecrets | indent 2 }}
17 | {{- end }}
18 | {{- end }}
19 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/logs/collector/otelcol/configmap.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "logs.collector.otelcol.enabled" .) "true" }}
2 | {{ $baseConfig := (tpl (.Files.Get "conf/logs/collector/otelcol/config.yaml") (deepCopy . | merge (dict "Type" "linux" ))) | fromYaml }}
3 | {{ $mergeConfig := .Values.otellogs.config.merge }}
4 | {{ $overrideConfig := .Values.otellogs.config.override }}
5 | {{ $finalConfig := "" }}
6 | {{ if $overrideConfig }}
7 | {{ $finalConfig = $overrideConfig }}
8 | {{ else }}
9 | {{ $finalConfig = mergeOverwrite $baseConfig $mergeConfig }}
10 | {{ end }}
11 | apiVersion: v1
12 | kind: ConfigMap
13 | metadata:
14 | name: {{ template "sumologic.metadata.name.logs.collector.configmap" . }}
15 | namespace: {{ template "sumologic.namespace" . }}
16 | labels:
17 | app: {{ template "sumologic.labels.app.logs.collector.configmap" . }}
18 | {{- include "sumologic.labels.common" . | nindent 4 }}
19 | data:
20 | config.yaml: |
21 | {{- $finalConfig | toYaml | nindent 4 }}
22 | {{- end }}
23 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/logs/collector/otellogswindows/configmap.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "logs.collector.otellogswindows.enabled" .) "true" }}
2 | {{ $baseConfig := (tpl (.Files.Get "conf/logs/collector/otellogswindows/config.yaml") (deepCopy . | merge (dict "Type" "windows" ))) | fromYaml }}
3 | {{ $mergeConfig := .Values.otellogswindows.config.merge }}
4 | {{ $overrideConfig := .Values.otellogswindows.config.override }}
5 | {{ $finalConfig := "" }}
6 | {{ if $overrideConfig }}
7 | {{ $finalConfig = $overrideConfig }}
8 | {{ else }}
9 | {{ $finalConfig = mergeOverwrite $baseConfig $mergeConfig }}
10 | {{ end }}
11 | apiVersion: v1
12 | kind: ConfigMap
13 | metadata:
14 | name: {{ template "sumologic.metadata.name.logs.collector.windows.configmap" . }}
15 | namespace: {{ template "sumologic.namespace" . }}
16 | labels:
17 | app: {{ template "sumologic.labels.app.logs.collector.windows.configmap" . }}
18 | {{- include "sumologic.labels.common" . | nindent 4 }}
19 | data:
20 | config.yaml: |
21 | {{- $finalConfig | toYaml | nindent 4 }}
22 | {{- end }}
23 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/logs/common/hpa.yaml:
--------------------------------------------------------------------------------
1 | {{- if and (eq (include "logs.otelcol.enabled" .) "true") (eq (include "metadata.logs.autoscaling.enabled" .) "true") }}
2 | apiVersion: {{ include "apiVersion.horizontalPodAutoscaler" . }}
3 | kind: HorizontalPodAutoscaler
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.logs.hpa" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.logs.hpa" . }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | spec:
11 | scaleTargetRef:
12 | apiVersion: apps/v1
13 | kind: StatefulSet
14 | name: {{ template "sumologic.metadata.name.logs.statefulset" . }}
15 | minReplicas: {{ .Values.metadata.logs.autoscaling.minReplicas }}
16 | maxReplicas: {{ .Values.metadata.logs.autoscaling.maxReplicas }}
17 | metrics:
18 | {{- if .Values.metadata.logs.autoscaling.targetMemoryUtilizationPercentage }}
19 | - type: Resource
20 | resource:
21 | name: memory
22 | target:
23 | type: Utilization
24 | averageUtilization: {{ .Values.metadata.logs.autoscaling.targetMemoryUtilizationPercentage }}
25 | {{- end }}
26 | - type: Resource
27 | resource:
28 | name: cpu
29 | target:
30 | type: Utilization
31 | averageUtilization: {{ .Values.metadata.logs.autoscaling.targetCPUUtilizationPercentage }}
32 | {{- end -}}
33 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/logs/common/pdb.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "logs.otelcol.enabled" .) "true" }}
2 | {{- if .Values.metadata.logs.podDisruptionBudget -}}
3 | apiVersion: {{ include "apiVersion.podDisruptionBudget" . }}
4 | kind: PodDisruptionBudget
5 | metadata:
6 | name: {{ template "sumologic.metadata.name.logs.pdb" . }}
7 | namespace: {{ template "sumologic.namespace" . }}
8 | labels:
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | spec:
11 | selector:
12 | matchLabels:
13 | app: {{ template "sumologic.labels.app.logs.statefulset" . }}
14 | {{- if hasKey .Values.metadata.logs.podDisruptionBudget "maxUnavailable" }}
15 | maxUnavailable: {{ .Values.metadata.logs.podDisruptionBudget.maxUnavailable }}
16 | {{- else }}
17 | minAvailable: {{ .Values.metadata.logs.podDisruptionBudget.minAvailable }}
18 | {{- end -}}
19 | {{- end -}}
20 | {{- end -}}
21 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/logs/common/service-headless.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "logs.otelcol.enabled" .) "true" }}
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.logs.service-headless" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.logs.service-headless" . }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | {{- include "sumologic.labels.logs" . | nindent 4 }}
11 | {{- if .Values.metadata.serviceLabels }}
12 | {{ toYaml .Values.metadata.serviceLabels | indent 4 }}
13 | {{- end }}
14 | spec:
15 | selector:
16 | app: {{ template "sumologic.labels.app.logs.pod" . }}
17 | clusterIP: None
18 | ports:
19 | - name: otlphttp
20 | port: 4318
21 | targetPort: 4318
22 | protocol: TCP
23 | {{- end }}
24 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/logs/common/service.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "logs.otelcol.enabled" .) "true" }}
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.logs.service" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.logs.service" . }}
9 | {{- include "sumologic.labels.scrape.logs" . | nindent 4 }}
10 | {{- include "sumologic.labels.common" . | nindent 4 }}
11 | {{- if .Values.metadata.serviceLabels }}
12 | {{ toYaml .Values.metadata.serviceLabels | indent 4 }}
13 | {{- end }}
14 | spec:
15 | selector:
16 | app: {{ template "sumologic.labels.app.logs.pod" . }}
17 | ports:
18 | - name: otlphttp
19 | port: 4318
20 | targetPort: 4318
21 | protocol: TCP
22 | - name: otelcol-metrics
23 | port: 8888
24 | targetPort: 8888
25 | protocol: TCP
26 | {{- if .Values.metadata.logs.statefulset.extraPorts }}
27 | {{- range .Values.metadata.logs.statefulset.extraPorts }}
28 | - name: {{ toYaml .name }}
29 | port: {{ toYaml .containerPort }}
30 | targetPort: {{ toYaml .containerPort }}
31 | protocol: {{ toYaml .protocol }}
32 | {{- end }}
33 | {{- end }}
34 | {{- end }}
35 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/logs/otelcol/configmap.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "logs.otelcol.enabled" .) "true" }}
2 | {{ $baseConfig := (tpl (.Files.Get "conf/logs/otelcol/config.yaml") .) | fromYaml }}
3 | {{ $mergeConfig := .Values.metadata.logs.config.merge }}
4 | {{ $overrideConfig := .Values.metadata.logs.config.override }}
5 | {{ $finalConfig := "" }}
6 | {{ if $overrideConfig }}
7 | {{ $finalConfig = $overrideConfig }}
8 | {{ else }}
9 | {{ $finalConfig = mergeOverwrite $baseConfig $mergeConfig }}
10 | {{ end }}
11 | apiVersion: v1
12 | kind: ConfigMap
13 | metadata:
14 | name: {{ template "sumologic.metadata.name.logs.configmap" . }}
15 | namespace: {{ template "sumologic.namespace" . }}
16 | labels:
17 | app: {{ template "sumologic.labels.app.logs.configmap" . }}
18 | {{- include "sumologic.labels.common" . | nindent 4 }}
19 | data:
20 | config.yaml: |
21 | {{- $finalConfig | toYaml | nindent 4 }}
22 | {{- end }}
23 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/machineconfig/master.yaml:
--------------------------------------------------------------------------------
1 | {{- if and (eq .Values.sumologic.scc.create true) (.Capabilities.APIVersions.Has "security.openshift.io/v1")}}
2 | {{- if and (eq .Values.falco.enabled true) (eq .Values.falco.addKernelDevel true) }}
3 | apiVersion: machineconfiguration.openshift.io/v1
4 | kind: MachineConfig
5 | metadata:
6 | labels:
7 | app: {{ template "sumologic.labels.app.machineconfig.master" . }}
8 | {{- include "sumologic.labels.machineconfig.master" . | nindent 4 }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | name: {{ template "sumologic.labels.app.machineconfig.master" . }}
11 | namespace: {{ template "sumologic.namespace" . }}
12 | spec:
13 | extensions:
14 | - kernel-devel
15 | {{- end }}
16 | {{- end }}
17 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/machineconfig/worker.yaml:
--------------------------------------------------------------------------------
1 | {{- if and (eq .Values.sumologic.scc.create true) (.Capabilities.APIVersions.Has "security.openshift.io/v1")}}
2 | {{- if and (eq .Values.falco.enabled true) (eq .Values.falco.addKernelDevel true) }}
3 | apiVersion: machineconfiguration.openshift.io/v1
4 | kind: MachineConfig
5 | metadata:
6 | labels:
7 | app: {{ template "sumologic.labels.app.machineconfig.worker" . }}
8 | {{- include "sumologic.labels.machineconfig.worker" . | nindent 4 }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | name: {{ template "sumologic.labels.app.machineconfig.worker" . }}
11 | namespace: {{ template "sumologic.namespace" . }}
12 | spec:
13 | extensions:
14 | - kernel-devel
15 | {{- end }}
16 | {{- end}}
17 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/collector/otelcol/clusterrole.yaml:
--------------------------------------------------------------------------------
1 | {{ if and (eq (include "metrics.otelcol.enabled" .) "true") .Values.sumologic.metrics.collector.otelcol.enabled }}
2 | apiVersion: rbac.authorization.k8s.io/v1
3 | kind: ClusterRole
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.metrics.collector.clusterrole" . }}
6 | labels:
7 | {{- include "sumologic.labels.metrics.clusterrole" . | nindent 4 }}
8 | {{- include "sumologic.labels.common" . | nindent 4 }}
9 | rules:
10 | - apiGroups: [""]
11 | resources:
12 | - pods
13 | - nodes
14 | - nodes/metrics
15 | - services
16 | - endpoints
17 | verbs:
18 | - get
19 | - watch
20 | - list
21 | - apiGroups: ["networking.k8s.io"]
22 | resources:
23 | - ingresses
24 | verbs:
25 | - get
26 | - watch
27 | - list
28 | - nonResourceURLs: ["/metrics", "/metrics/cadvisor"]
29 | verbs: ["get"]
30 | {{- end }}
31 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/collector/otelcol/serviceaccount-targetallocator.yaml:
--------------------------------------------------------------------------------
1 | {{ if and (eq (include "metrics.otelcol.enabled" .) "true") .Values.sumologic.metrics.collector.otelcol.enabled }}
2 | apiVersion: v1
3 | kind: ServiceAccount
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.metrics.targetallocator.serviceaccount" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | {{- include "sumologic.labels.metrics.serviceaccount" . | nindent 4 }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | {{- if .Values.sumologic.serviceAccount.annotations }}
11 | annotations:
12 | {{ toYaml .Values.sumologic.serviceAccount.annotations | indent 2 }}
13 | {{- end }}
14 | {{- if .Values.sumologic.pullSecrets }}
15 | imagePullSecrets:
16 | {{ toYaml .Values.sumologic.pullSecrets | indent 2 }}
17 | {{- end }}
18 | {{- end }}
19 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/collector/otelcol/serviceaccount.yaml:
--------------------------------------------------------------------------------
1 | {{ if and (eq (include "metrics.otelcol.enabled" .) "true") .Values.sumologic.metrics.collector.otelcol.enabled }}
2 | apiVersion: v1
3 | kind: ServiceAccount
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.metrics.collector.serviceaccount" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | {{- include "sumologic.labels.metrics.serviceaccount" . | nindent 4 }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | {{- if .Values.sumologic.serviceAccount.annotations }}
11 | annotations:
12 | {{ toYaml .Values.sumologic.serviceAccount.annotations | indent 2 }}
13 | {{- end }}
14 | {{- if .Values.sumologic.pullSecrets }}
15 | imagePullSecrets:
16 | {{ toYaml .Values.sumologic.pullSecrets | indent 2 }}
17 | {{- end }}
18 | {{- end }}
19 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/collector/otelcol/targetallocator-clusterrole.yaml:
--------------------------------------------------------------------------------
1 | {{ if and (eq (include "metrics.otelcol.enabled" .) "true") .Values.sumologic.metrics.collector.otelcol.enabled }}
2 | apiVersion: rbac.authorization.k8s.io/v1
3 | kind: ClusterRole
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.metrics.targetallocator.clusterrole" . }}
6 | labels:
7 | {{- include "sumologic.labels.metrics.clusterrole" . | nindent 4 }}
8 | {{- include "sumologic.labels.common" . | nindent 4 }}
9 | rules:
10 | - apiGroups: [""]
11 | resources:
12 | - pods
13 | - nodes
14 | - services
15 | - endpoints
16 | - configmaps
17 | - secrets
18 | - namespaces
19 | verbs:
20 | - get
21 | - watch
22 | - list
23 | - apiGroups: ["apps"]
24 | resources:
25 | - statefulsets
26 | - services
27 | - endpoints
28 | verbs:
29 | - get
30 | - watch
31 | - list
32 | - apiGroups: ["discovery.k8s.io"]
33 | resources:
34 | - endpointslices
35 | verbs:
36 | - get
37 | - watch
38 | - list
39 | - apiGroups: ["networking.k8s.io"]
40 | resources:
41 | - ingresses
42 | verbs:
43 | - get
44 | - watch
45 | - list
46 | - apiGroups: ["monitoring.coreos.com"]
47 | resources:
48 | - servicemonitors
49 | - podmonitors
50 | - probes
51 | - scrapeconfigs
52 | verbs:
53 | - get
54 | - watch
55 | - list
56 | {{- end }}
57 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/collector/otelcol/targetallocator-clusterrolebinding.yaml:
--------------------------------------------------------------------------------
1 | {{ if and (eq (include "metrics.otelcol.enabled" .) "true") .Values.sumologic.metrics.collector.otelcol.enabled }}
2 | apiVersion: rbac.authorization.k8s.io/v1
3 | kind: ClusterRoleBinding
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.metrics.targetallocator.clusterrolebinding" . }}
6 | labels:
7 | {{- include "sumologic.labels.metrics.clusterrolebinding" . | nindent 4 }}
8 | {{- include "sumologic.labels.common" . | nindent 4 }}
9 | subjects:
10 | - kind: ServiceAccount
11 | name: {{ template "sumologic.metadata.name.metrics.targetallocator.serviceaccount" . }}
12 | namespace: {{ template "sumologic.namespace" . }}
13 | roleRef:
14 | kind: ClusterRole
15 | name: {{ template "sumologic.metadata.name.metrics.targetallocator.clusterrole" . }}
16 | apiGroup: rbac.authorization.k8s.io
17 | {{- end }}
18 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/common/hpa.yaml:
--------------------------------------------------------------------------------
1 | {{- if and (eq (include "metrics.otelcol.enabled" .) "true") (eq (include "metadata.metrics.autoscaling.enabled" .) "true") }}
2 | apiVersion: {{ include "apiVersion.horizontalPodAutoscaler" . }}
3 | kind: HorizontalPodAutoscaler
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.metrics.hpa" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.metrics.hpa" . }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | spec:
11 | scaleTargetRef:
12 | apiVersion: apps/v1
13 | kind: StatefulSet
14 | name: {{ template "sumologic.metadata.name.metrics.statefulset" . }}
15 | minReplicas: {{ .Values.metadata.metrics.autoscaling.minReplicas }}
16 | maxReplicas: {{ .Values.metadata.metrics.autoscaling.maxReplicas }}
17 | metrics:
18 | {{- if .Values.metadata.metrics.autoscaling.targetMemoryUtilizationPercentage }}
19 | - type: Resource
20 | resource:
21 | name: memory
22 | target:
23 | type: Utilization
24 | averageUtilization: {{ .Values.metadata.metrics.autoscaling.targetMemoryUtilizationPercentage }}
25 | {{- end }}
26 | - type: Resource
27 | resource:
28 | name: cpu
29 | target:
30 | type: Utilization
31 | averageUtilization: {{ .Values.metadata.metrics.autoscaling.targetCPUUtilizationPercentage }}
32 | {{- end -}}
33 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/common/pdb.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "metrics.otelcol.enabled" .) "true" }}
2 | {{- if .Values.metadata.metrics.podDisruptionBudget -}}
3 | apiVersion: {{ include "apiVersion.podDisruptionBudget" . }}
4 | kind: PodDisruptionBudget
5 | metadata:
6 | name: {{ template "sumologic.metadata.name.metrics.pdb" . }}
7 | namespace: {{ template "sumologic.namespace" . }}
8 | labels:
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | spec:
11 | selector:
12 | matchLabels:
13 | app: {{ template "sumologic.labels.app.metrics.statefulset" . }}
14 | {{ toYaml .Values.metadata.metrics.podDisruptionBudget | indent 2 }}
15 | {{- end -}}
16 | {{- end -}}
17 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/common/service-headless.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "metrics.otelcol.enabled" .) "true" }}
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.metrics.service-headless" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.metrics.service-headless" . }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | {{- include "sumologic.labels.metrics" . | nindent 4 }}
11 | {{- if .Values.metadata.serviceLabels }}
12 | {{ toYaml .Values.metadata.serviceLabels | indent 4 }}
13 | {{- end }}
14 | spec:
15 | selector:
16 | app: {{ template "sumologic.labels.app.metrics.pod" . }}
17 | clusterIP: None
18 | ports:
19 | - name: otlphttp
20 | port: 4318
21 | protocol: TCP
22 | - name: prom-write
23 | port: 9888
24 | targetPort: 9888
25 | protocol: TCP
26 | - name: metrics
27 | port: 24231
28 | targetPort: 24231
29 | protocol: TCP
30 | {{- end }}
31 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/common/service.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "metrics.otelcol.enabled" .) "true" }}
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.metrics.service" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.metrics.service" . }}
9 | {{- include "sumologic.labels.scrape.metrics" . | nindent 4 }}
10 | {{- include "sumologic.labels.common" . | nindent 4 }}
11 | {{- if .Values.metadata.serviceLabels }}
12 | {{ toYaml .Values.metadata.serviceLabels | indent 4 }}
13 | {{- end }}
14 | spec:
15 | selector:
16 | app: {{ template "sumologic.labels.app.metrics.pod" . }}
17 | ports:
18 | - name: otlphttp
19 | port: 4318
20 | protocol: TCP
21 | - name: prom-write
22 | port: 9888
23 | targetPort: 9888
24 | protocol: TCP
25 | - name: otelcol-metrics
26 | port: 8888
27 | targetPort: 8888
28 | protocol: TCP
29 | {{- end }}
30 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/otelcol/configmap.yaml:
--------------------------------------------------------------------------------
1 | {{ if eq (include "metrics.otelcol.enabled" .) "true" }}
2 | {{ $baseConfig := (tpl (.Files.Get "conf/metrics/otelcol/config.yaml") .) | fromYaml }}
3 | {{ $mergeConfig := .Values.metadata.metrics.config.merge }}
4 | {{ $overrideConfig := .Values.metadata.metrics.config.override }}
5 | {{ $finalConfig := "" }}
6 | {{ if $overrideConfig }}
7 | {{ $finalConfig = $overrideConfig }}
8 | {{ else }}
9 | {{ $finalConfig = mergeOverwrite $baseConfig $mergeConfig }}
10 | {{ end }}
11 | apiVersion: v1
12 | kind: ConfigMap
13 | metadata:
14 | name: {{ template "sumologic.metadata.name.metrics.configmap" . }}
15 | namespace: {{ template "sumologic.namespace" . }}
16 | labels:
17 | app: {{ template "sumologic.labels.app.metrics.configmap" . }}
18 | {{- include "sumologic.labels.common" . | nindent 4 }}
19 | data:
20 | config.yaml: |
21 | {{- $finalConfig | toYaml | nindent 4 }}
22 | {{- end }}
23 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/remote-write-proxy/configmap.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "metrics.remoteWriteProxy.enabled" .) "true" }}
2 | apiVersion: v1
3 | kind: ConfigMap
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.remoteWriteProxy.configmap" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.remoteWriteProxy.configmap" . }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | data:
11 | {{- (tpl (.Files.Glob "conf/metrics/remote-write-proxy/remote-write-proxy.conf").AsConfig .) | nindent 4 }}
12 | {{- end }}
13 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/metrics/remote-write-proxy/service.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq (include "metrics.remoteWriteProxy.enabled" .) "true" }}
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.remoteWriteProxy.service" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.remoteWriteProxy.service" . }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | spec:
11 | ports:
12 | - name: prometheus
13 | port: 9888
14 | targetPort: {{ .Values.sumologic.metrics.remoteWriteProxy.config.port }}
15 | - name: otel
16 | port: 4318
17 | targetPort: 4318
18 | selector:
19 | app: {{ template "sumologic.labels.app.remoteWriteProxy.pod" . }}
20 | {{- end }}
21 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/opentelemetry-operator/configmap-instrumentation-cr.yaml:
--------------------------------------------------------------------------------
1 | {{ $operatorEnabled := index .Values "opentelemetry-operator" "enabled" }}
2 | {{ $tracesEnabled := .Values.sumologic.traces.enabled }}
3 | {{ $createDefaultInstrumentation := .Values.instrumentation.createDefaultInstrumentation }}
4 | {{- if and $operatorEnabled $tracesEnabled $createDefaultInstrumentation }}
5 | apiVersion: v1
6 | kind: ConfigMap
7 | metadata:
8 | name: {{ template "sumologic.metadata.name.opentelemetry.operator.instrumentation.configmap" . }}
9 | namespace: {{ template "sumologic.namespace" . }}
10 | labels:
11 | app: {{ template "sumologic.labels.app.opentelemetry.operator.instrumentation.configmap" . }}
12 | {{- include "sumologic.labels.common" . | nindent 4 }}
13 | data:
14 | instrumentation.cr.yaml: |
15 | {{- (tpl (.Files.Get "conf/opentelemetry-operator/instrumentation.cr.yaml") .) | nindent 4 }}
16 | {{- end }}
17 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/priorityclass.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: scheduling.k8s.io/v1
2 | kind: PriorityClass
3 | metadata:
4 | name: {{ template "sumologic.metadata.name.priorityclass" . }}
5 | namespace: {{ template "sumologic.namespace" . }}
6 | labels:
7 | {{- include "sumologic.labels.common" . | nindent 4 }}
8 | value: 1000000
9 | globalDefault: false
10 | description: "This PriorityClass will be used for OTel Distro agents running as Daemonsets"
11 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/pvc-cleaner/configmap.yaml:
--------------------------------------------------------------------------------
1 | {{- if or (eq .Values.pvcCleaner.logs.enabled true) (eq .Values.pvcCleaner.metrics.enabled true) }}
2 | apiVersion: v1
3 | kind: ConfigMap
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.pvcCleaner.configmap" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.pvcCleaner.configmap" . }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | data:
11 | {{- (tpl (.Files.Glob "conf/pvc-cleaner/*.sh").AsConfig .) | nindent 2 }}
12 | {{- end }}
13 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/serviceaccount.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ServiceAccount
3 | metadata:
4 | name: {{ template "sumologic.metadata.name.roles.serviceaccount" . }}
5 | namespace: {{ template "sumologic.namespace" . }}
6 | labels:
7 | app: {{ template "sumologic.labels.app.roles.serviceaccount" . }}
8 | {{- include "sumologic.labels.common" . | nindent 4 }}
9 | {{- with .Values.sumologic.serviceAccount.annotations }}
10 | annotations:
11 | {{- toYaml . | nindent 4 }}
12 | {{- end }}
13 | {{- if .Values.sumologic.pullSecrets }}
14 | imagePullSecrets:
15 | {{ toYaml .Values.sumologic.pullSecrets | indent 2 }}
16 | {{- end }}
17 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/setup/configmap.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.setupEnabled }}
2 | apiVersion: v1
3 | kind: ConfigMap
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.setup.configmap" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | annotations:
8 | {{ include "sumologic.annotations.app.setup.helmsh" "2" | indent 4 }}
9 | labels:
10 | app: {{ template "sumologic.labels.app.setup.configmap" . }}
11 | {{- include "sumologic.labels.common" . | nindent 4 }}
12 | data:
13 | {{- (.Files.Glob "conf/setup/*.{tf,sh}").AsConfig | nindent 2 }}
14 | {{- (tpl (.Files.Glob "conf/setup/*.json").AsConfig .) | nindent 2 }}
15 | {{- end }}
16 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/setup/crds-configmap.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.setupEnabled }}
2 | apiVersion: v1
3 | kind: ConfigMap
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.setup.configmap-crds" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | annotations:
8 | {{ include "sumologic.annotations.app.setup.helmsh" "2" | indent 4 }}
9 | {{- if .Values.sumologic.setup.job.crdConfigMapAnnotations }}
10 | {{ toYaml .Values.sumologic.setup.job.crdConfigMapAnnotations | indent 4 }}
11 | {{- end }}
12 | labels:
13 | app: {{ template "sumologic.labels.app.setup.configmap.crds" . }}
14 | {{- include "sumologic.labels.common" . | nindent 4 }}
15 | data:
16 | crds-configmaps.yaml: |-
17 | {{ range $path, $bytes := .Files.Glob (printf "crds/*")}}
18 | {{- $.Files.Get $path | nindent 8 }}
19 | {{ end }}
20 | {{- end }}
21 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/setup/custom-configmap.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.setupEnabled }}
2 | apiVersion: v1
3 | kind: ConfigMap
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.setup.configmap-custom" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | annotations:
8 | {{ include "sumologic.annotations.app.setup.helmsh" "2" | indent 4 }}
9 | labels:
10 | app: {{ template "sumologic.labels.app.setup.configmap-custom" . }}
11 | {{- include "sumologic.labels.common" . | nindent 4 }}
12 | data:
13 | {{- if .Values.sumologic.setup.additionalFiles }}
14 | {{- range $directory, $files := .Values.sumologic.setup.additionalFiles }}
15 | {{- range $filename, $file := $files }}
16 | {{ printf "%s_%s: |-" $directory $filename }}
17 | {{- $file | nindent 4 }}
18 | {{- end }}
19 | {{- end }}
20 | {{- end }}
21 | {{- end }}
22 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/setup/role.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.setupEnabled }}
2 | apiVersion: rbac.authorization.k8s.io/v1
3 | kind: Role
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.setup.roles.role" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | annotations:
8 | {{ include "sumologic.annotations.app.setup.helmsh" "1" | indent 4 }}
9 | labels:
10 | app: {{ template "sumologic.labels.app.setup.roles.role" . }}
11 | {{- include "sumologic.labels.common" . | nindent 4 }}
12 | rules:
13 | - apiGroups:
14 | - ""
15 | resources:
16 | - secrets
17 | verbs: ["get", "list", "describe", "create", "patch"]
18 | {{- end }}
19 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/setup/rolebinding.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.setupEnabled }}
2 | apiVersion: rbac.authorization.k8s.io/v1
3 | kind: RoleBinding
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.setup.roles.rolebinding" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | annotations:
8 | {{ include "sumologic.annotations.app.setup.helmsh" "2" | indent 4 }}
9 | labels:
10 | app: {{ template "sumologic.labels.app.setup.roles.rolebinding" . }}
11 | {{- include "sumologic.labels.common" . | nindent 4 }}
12 | roleRef:
13 | apiGroup: rbac.authorization.k8s.io
14 | kind: Role
15 | name: {{ template "sumologic.metadata.name.setup.roles.role" . }}
16 | subjects:
17 | - kind: ServiceAccount
18 | name: {{ template "sumologic.metadata.name.setup.roles.serviceaccount" . }}
19 | namespace: {{ template "sumologic.namespace" . }}
20 | {{- end }}
21 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/setup/secret.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.setupEnabled }}
2 | {{- if not .Values.sumologic.envFromSecret }}
3 | apiVersion: v1
4 | kind: Secret
5 | metadata:
6 | name: {{ template "sumologic.metadata.name.setup.secret" . }}
7 | namespace: {{ template "sumologic.namespace" . }}
8 | annotations:
9 | {{ include "sumologic.annotations.app.setup.helmsh" "3" | indent 4 }}
10 | labels:
11 | app: {{ template "sumologic.labels.app.setup.secret" . }}
12 | {{- include "sumologic.labels.common" . | nindent 4 }}
13 | data:
14 | {{- if eq (include "sumologic-mock.local-mode-enabled" .) "true" }}
15 | SUMOLOGIC_ACCESSID: {{ "dummy" | b64enc }}
16 | SUMOLOGIC_ACCESSKEY: {{ "dummy" | b64enc }}
17 | {{- else }}
18 | SUMOLOGIC_ACCESSID: {{ required "A valid .Values.sumologic.accessId entry required!" .Values.sumologic.accessId | b64enc }}
19 | SUMOLOGIC_ACCESSKEY: {{ required "A valid .Values.sumologic.accessKey entry required!" .Values.sumologic.accessKey | b64enc }}
20 | {{- end }}
21 | {{- end }}
22 | {{- end }}
23 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/setup/serviceaccount.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.sumologic.setupEnabled }}
2 | apiVersion: v1
3 | kind: ServiceAccount
4 | metadata:
5 | name: {{ template "sumologic.metadata.name.setup.roles.serviceaccount" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | annotations:
8 | {{ include "sumologic.annotations.app.setup.helmsh" "0" | indent 4 }}
9 | {{- with .Values.sumologic.serviceAccount.annotations }}
10 | {{- toYaml . | nindent 4 }}
11 | {{- end }}
12 | labels:
13 | app: {{ template "sumologic.labels.app.setup.roles.serviceaccount" . }}
14 | {{- include "sumologic.labels.common" . | nindent 4 }}
15 | {{- if .Values.sumologic.setup.job.pullSecrets }}
16 | imagePullSecrets:
17 | {{ toYaml .Values.sumologic.setup.job.pullSecrets | indent 2 }}
18 | {{- end }}
19 | {{- end }}
20 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/sumologic-mock/service.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq .Values.debug.sumologicMock.enabled true }}
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: {{ template "sumologic.sumologic-mock.name.service" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.sumologic-mock.service" . }}
9 | {{- include "sumologic.labels.sumologic-mock" . | nindent 4 }}
10 | {{- include "sumologic.labels.common" . | nindent 4 }}
11 | annotations:
12 | {{ include "sumologic.annotations.app.sumologic-mock.helmsh" "1" | indent 4 }}
13 | spec:
14 | selector:
15 | app: {{ template "sumologic.labels.app.sumologic-mock.pod" . }}
16 | ports:
17 | - name: port
18 | port: {{ template "sumologic-mock.port" . }}
19 | targetPort: {{ template "sumologic-mock.port" . }}
20 | protocol: TCP
21 | {{- end }}
22 |
--------------------------------------------------------------------------------
/deploy/helm/sumologic/templates/sumologic-mock/serviceaccount.yaml:
--------------------------------------------------------------------------------
1 | {{- if eq .Values.debug.sumologicMock.enabled true }}
2 | apiVersion: v1
3 | kind: ServiceAccount
4 | metadata:
5 | name: {{ template "sumologic.sumologic-mock.name.roles.serviceaccount" . }}
6 | namespace: {{ template "sumologic.namespace" . }}
7 | labels:
8 | app: {{ template "sumologic.labels.app.roles.serviceaccount" . }}
9 | {{- include "sumologic.labels.common" . | nindent 4 }}
10 | annotations:
11 | {{ include "sumologic.annotations.app.sumologic-mock.helmsh" "0" | indent 4 }}
12 | {{- with .Values.sumologic.serviceAccount.annotations }}
13 | {{- toYaml . | nindent 4 }}
14 | {{- end }}
15 | {{- if .Values.sumologic.pullSecrets }}
16 | imagePullSecrets:
17 | {{ toYaml .Values.sumologic.pullSecrets | indent 2 }}
18 | {{- end }}
19 | {{- end }}
20 |
--------------------------------------------------------------------------------
/docs/best-practices.md:
--------------------------------------------------------------------------------
1 | # Advanced Configuration / Best Practices
2 |
3 | Document moved to
4 | [help.sumologic.com - Best Practices and Advanced Configuration](https://help.sumologic.com/docs/send-data/kubernetes/best-practices/)
5 |
--------------------------------------------------------------------------------
/docs/collecting-application-metrics.md:
--------------------------------------------------------------------------------
1 | # Collecting Application Metrics
2 |
3 | This document was moved to
4 | [help.sumologic.com - Collecting Metrics](https://help.sumologic.com/docs/send-data/kubernetes/collecting-metrics/).
5 |
--------------------------------------------------------------------------------
/docs/collecting-container-logs.md:
--------------------------------------------------------------------------------
1 | # Collecting Container Logs
2 |
3 | This document was moved to [help.sumologic.com - Collecting Logs](https://help.sumologic.com/docs/send-data/kubernetes/collecting-logs/).
4 |
--------------------------------------------------------------------------------
/docs/collecting-kubernetes-events.md:
--------------------------------------------------------------------------------
1 | # Collecting Kubernetes Events
2 |
3 | This document was moved to
4 | [help.sumologic.com - Collecting Kubernetes Events](https://help.sumologic.com/docs/send-data/kubernetes/collecting-events/).
5 |
--------------------------------------------------------------------------------
/docs/collecting-kubernetes-metrics.md:
--------------------------------------------------------------------------------
1 | # Collecting Kubernetes Metrics
2 |
3 | This document was moved to
4 | [help.sumologic.com - Kubernetes metrics](https://help.sumologic.com/docs/send-data/kubernetes/collecting-metrics/#kubernetes-metrics).
5 |
--------------------------------------------------------------------------------
/docs/collecting-systemd-logs.md:
--------------------------------------------------------------------------------
1 | # Collecting Systemd Logs
2 |
3 | This document was moved to [help.sumologic.com - Collecting Logs](https://help.sumologic.com/docs/send-data/kubernetes/collecting-logs/).
4 |
--------------------------------------------------------------------------------
/docs/installation.md:
--------------------------------------------------------------------------------
1 | # Installation
2 |
3 | Document moved to
4 | [sumo logic docs - Sumo Logic Kubernetes Helm Chart Installation](https://help.sumologic.com/docs/send-data/kubernetes/install-helm-chart/).
5 |
--------------------------------------------------------------------------------
/docs/opentelemetry-collector/events.md:
--------------------------------------------------------------------------------
1 | # Kubernetes Events
2 |
3 | OpenTelemetry Collector is used to collect and enrich Kubernetes events.
4 |
5 | ## Customizing OpenTelemetry Collector configuration
6 |
7 | If the configuration options present under the `otelevents` key aren't sufficient for your needs, you can override the OT configuration
8 | directly.
9 |
10 | The `otelevents.config.merge` key can be used to provide configuration that will be merged with the Helm Chart's default configuration. It
11 | should be noted that this field is not subject to normal backwards compatibility guarantees, the default configuration can change even in
12 | minor versions while preserving the same end-to-end behaviour. Use of this field is discouraged - ideally the necessary customizations
13 | should be able to be achieved without touching the otel configuration directly. Please open an issue if your use case requires the use of
14 | this field.
15 |
16 | The `otelevents.config.override` key can be used to provide configuration that will be completely replace the default configuration. As
17 | above, care must be taken not to depend on implementation details that may change between minor releases of this Chart.
18 |
--------------------------------------------------------------------------------
/docs/opentelemetry-collector/traces.md:
--------------------------------------------------------------------------------
1 | # Traces
2 |
3 | ## Load balancing using the gateway
4 |
5 | Open Telemetry supports Trace ID aware load balancing. An example use case for load balancing is scaling `cascading_filter` that requires
6 | spans with same Trace ID to be send to the same collector instance.
7 |
8 | Sumo Logic kubernetes collection supports three layer architecture - with an agent, gateway and a collector - in order to perform Trace ID
9 | aware load balancing.
10 |
11 | Agent, if the gateway is enabled, sends traces to the gateway. Gateway is configured with a load balancing exporter pointing to the
12 | collector headless service. Gateway may also be exposed outside cluster, allowing to load balance traces originating from outside kubernetes
13 | cluster.
14 |
15 | Sample config:
16 |
17 | ```yaml
18 | sumologic:
19 | traces:
20 | enabled: true
21 |
22 | otelcolInstrumentation:
23 | enabled: true
24 |
25 | tracesGateway:
26 | enabled: true
27 | ```
28 |
29 | Refs:
30 |
31 | - [Trace ID aware load balancing](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/loadbalancingexporter/README.md)
32 | - [Using cascading_filter](https://help.sumologic.com/docs/apm/traces/advanced-configuration/filter-shape-tracing-data)
33 |
--------------------------------------------------------------------------------
/docs/performance.md:
--------------------------------------------------------------------------------
1 | # Performance
2 |
3 | :construction: Please use the following documents for performance reference:
4 |
5 | - [OpenTelemetry Collector][otc-performance] - default since Helm Chart v3
6 |
7 | [otc-performance]: https://github.com/SumoLogic/sumologic-otel-collector/blob/main/docs/performance.md
8 |
--------------------------------------------------------------------------------
/docs/security-best-practices.md:
--------------------------------------------------------------------------------
1 | # Advanced Configuration / Security Best Practices
2 |
3 | Document moved to
4 | [help.sumologic.com - Security Best Practices](https://help.sumologic.com/docs/send-data/kubernetes/security-best-practices/)
5 |
--------------------------------------------------------------------------------
/docs/troubleshoot-collection.md:
--------------------------------------------------------------------------------
1 | # Troubleshooting Collection
2 |
3 | This document was moved to
4 | [help.sumologic.com - Troubleshooting Collection](https://help.sumologic.com/docs/send-data/kubernetes/troubleshoot-collection/)
5 |
--------------------------------------------------------------------------------
/docs/v3-migration-doc.md:
--------------------------------------------------------------------------------
1 | # Kubernetes Collection `v3.0.0` - Breaking Changes
2 |
3 | Document moved to [sumo logic docs - v3 Upgrade Guide](https://help.sumologic.com/docs/send-data/kubernetes/v3/important-changes/).
4 |
--------------------------------------------------------------------------------
/docs/v4-migration-doc.md:
--------------------------------------------------------------------------------
1 | # Kubernetes Collection `v4.0.0` - Breaking Changes
2 |
3 | Document moved to [sumo logic docs - v4 Upgrade Guide](https://help.sumologic.com/docs/send-data/kubernetes/v4/important-changes/).
4 |
--------------------------------------------------------------------------------
/examples/kube_prometheus_stack/values.yaml:
--------------------------------------------------------------------------------
1 | kube-prometheus-stack:
2 | enabled: false
3 |
--------------------------------------------------------------------------------
/images/events.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/images/events.png
--------------------------------------------------------------------------------
/images/helm_chart_installed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/images/helm_chart_installed.png
--------------------------------------------------------------------------------
/images/logs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/images/logs.png
--------------------------------------------------------------------------------
/images/metrics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/images/metrics.png
--------------------------------------------------------------------------------
/images/metrics/prometheus-query.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/images/metrics/prometheus-query.png
--------------------------------------------------------------------------------
/images/metrics/prometheus-targets-error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/images/metrics/prometheus-targets-error.png
--------------------------------------------------------------------------------
/images/metrics/prometheus-targets-ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/images/metrics/prometheus-targets-ok.png
--------------------------------------------------------------------------------
/images/metrics/prometheus-ui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/images/metrics/prometheus-ui.png
--------------------------------------------------------------------------------
/images/overview-v4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/images/overview-v4.png
--------------------------------------------------------------------------------
/images/sumo_k8s_dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/images/sumo_k8s_dashboard.png
--------------------------------------------------------------------------------
/images/sumo_logic_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/images/sumo_logic_logo.png
--------------------------------------------------------------------------------
/override.output.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/override.output.yaml
--------------------------------------------------------------------------------
/tests/helm/.golangci.yaml:
--------------------------------------------------------------------------------
1 | run:
2 | timeout: 10m
3 | allow-parallel-runners: true
4 |
5 | linters-settings:
6 | errcheck:
7 | check-type-assertions: false
8 | check-blank: true
9 |
10 | lll:
11 | # max line length, lines longer will be reported. Default is 120.
12 | # '\t' is counted as 1 character by default, and can be changed with the tab-width option
13 | line-length: 185
14 | # tab width in spaces. Default to 1.
15 | tab-width: 8
16 |
17 | linters:
18 | disable-all: false
19 | disable:
20 | - maligned
21 | - prealloc
22 | - gosimple
23 | enable:
24 | - gofmt
25 | - unused
26 | - errcheck
27 | - goimports
28 | - misspell
29 | - lll
30 | fast: false
31 |
32 | issues:
33 | # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
34 | max-issues-per-linter: 0
35 | # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
36 | max-same-issues: 0
37 |
--------------------------------------------------------------------------------
/tests/helm/Makefile:
--------------------------------------------------------------------------------
1 | .PHONY: test
2 | test:
3 | go test -timeout 30m -v
4 |
5 | .PHONY: regenerate-goldenfiles
6 | regenerate-goldenfiles:
7 | REGENERATE_GOLDENFILES=1 go test -run=^TestGoldenFiles$$ || true
8 |
9 | .PHONY: gomod-tidy
10 | gomod-tidy:
11 | go mod tidy -compat=1.19
12 |
13 | LINT=golangci-lint
14 | GOLANGCI_LINT_VERSION ?= v1.51.0
15 |
16 | .PHONY: install-golint
17 | install-golangci-lint:
18 | curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
19 | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_LINT_VERSION)
20 |
21 | .PHONY: golint
22 | golint:
23 | $(LINT) run --verbose
24 |
25 | .PHONY: gofmt
26 | gofmt:
27 | gofmt -s -w .
28 |
--------------------------------------------------------------------------------
/tests/helm/otellogs_metrics_test.go:
--------------------------------------------------------------------------------
1 | package helm
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/stretchr/testify/assert"
7 | )
8 |
9 | func TestOtellogsMetricsDisabled(t *testing.T) {
10 | t.Parallel()
11 | templatePath := "templates/logs/collector/common/service.yaml"
12 | valuesYaml := `
13 | otellogs:
14 | metrics:
15 | enabled: false
16 | `
17 | _, err := RenderTemplateFromValuesStringE(t, valuesYaml, templatePath)
18 | expectedError := "Error: could not find template templates/logs/collector/common/service.yaml in chart"
19 | assert.ErrorContains(t, err, expectedError)
20 | }
21 |
--------------------------------------------------------------------------------
/tests/helm/testdata/everything-enabled.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | pullSecrets:
3 | - name: pullSecret
4 | setup:
5 | job:
6 | pullSecrets:
7 | - name: pullSecret
8 | logs:
9 | collector:
10 | allowSideBySide: true
11 | otelcloudwatch:
12 | enabled: true
13 |
14 | metrics-server:
15 | enabled: true
16 |
17 | telegraf-operator:
18 | enabled: true
19 |
20 | falco:
21 | enabled: true
22 |
23 | opentelemetry-operator:
24 | enabled: true
25 | crds:
26 | create: true
27 |
28 | tailing-sidecar-operator:
29 | enabled: true
30 |
--------------------------------------------------------------------------------
/tests/helm/testdata/fipsmode.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | otelcolImage:
3 | addFipsSuffix: true
4 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/cleanup/basic.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | cleanupEnabled: true
3 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/cleanup/sumologic-mock-no-secret.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 |
5 | enableLocalMode: true
6 |
7 | sumologic:
8 | envFromSecret: false
9 | cleanupEnabled: true
10 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/cleanup/sumologic-mock-secret.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 |
5 | enableLocalMode: true
6 |
7 | sumologic:
8 | cleanupEnabled: true
9 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/cleanup/sumologic-mock-secret.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/cleanup/secret.yaml
3 | apiVersion: v1
4 | kind: Secret
5 | metadata:
6 | name: RELEASE-NAME-sumologic-cleanup
7 | namespace: sumologic
8 | annotations:
9 | helm.sh/hook: pre-delete
10 | helm.sh/hook-weight: "3"
11 | helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
12 | labels:
13 | app: RELEASE-NAME-sumologic
14 | chart: "sumologic-%CURRENT_CHART_VERSION%"
15 | release: "RELEASE-NAME"
16 | heritage: "Helm"
17 | data:
18 | SUMOLOGIC_ACCESSID: ZHVtbXk=
19 | SUMOLOGIC_ACCESSKEY: ZHVtbXk=
20 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/cleanup/sumologic-mock.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 |
5 | enableLocalMode: true
6 |
7 | sumologic:
8 | cleanupEnabled: true
9 | setup:
10 | job:
11 | initContainerImage:
12 | repository: myrepo
13 | tag: mytag
14 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/common/clusterrole.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/common/clusterrole.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/common/clusterrole.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/clusterrole.yaml
3 | apiVersion: rbac.authorization.k8s.io/v1
4 | kind: ClusterRole
5 | metadata:
6 | name: RELEASE-NAME-sumologic
7 | labels:
8 | app: RELEASE-NAME-sumologic
9 | chart: "sumologic-%CURRENT_CHART_VERSION%"
10 | release: "RELEASE-NAME"
11 | heritage: "Helm"
12 | rules:
13 | - apiGroups: ["", "apps", "extensions", "batch", "events.k8s.io", "discovery.k8s.io"]
14 | resources:
15 | - configmaps
16 | - daemonsets
17 | - deployments
18 | - endpoints
19 | - endpointslices
20 | - events
21 | - namespaces
22 | - nodes
23 | - pods
24 | - replicasets
25 | - services
26 | - statefulsets
27 | - cronjobs
28 | - jobs
29 | verbs: ["get", "list", "watch"]
30 | - apiGroups: [""]
31 | resources:
32 | - configmaps
33 | verbs: ["create", "patch"]
34 | - apiGroups: ["opentelemetry.io"]
35 | resources:
36 | - instrumentations
37 | verbs: ["patch", "get", "create"]
38 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/events_otc/basic.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/events_otc/basic.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/events_otc/options.input.yaml:
--------------------------------------------------------------------------------
1 | otelevents:
2 | logLevel: debug
3 | metricsLevel: detailed
4 |
5 | sumologic:
6 | clusterName: testCluster
7 | collectorName: testCollector
8 | events:
9 | sourceName: testSourceName
10 | sourceCategory: testSourceCategory
11 | sourceCategoryReplaceDash: ";"
12 | persistence:
13 | enabled: false
14 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/events_otc/sumologic-mock.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 | events:
5 | print: true
6 | forwardToSumologicMock: true
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/events_otc_statefulset/common.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | nodeSelector:
3 | kubernetes.io/os: linux
4 | affinity:
5 | nodeAffinity:
6 | requiredDuringSchedulingIgnoredDuringExecution:
7 | nodeSelectorTerms:
8 | - matchExpressions:
9 | - key: kubernetes.io/os
10 | operator: NotIn
11 | values:
12 | - windows
13 | tolerations:
14 | - key: "arbeiter"
15 | operator: "NotEqual"
16 | value: arbeiter
17 | effect: "FailTest"
18 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/events_otc_statefulset/custom.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | events:
3 | sourceType: http
4 | podAnnotations:
5 | sumoAnnotation: sumoValue
6 | podLabels:
7 | sumoLabel: sumoValue
8 |
9 | otelevents:
10 | image:
11 | repository: my_repository
12 | tag: my_tag
13 | statefulset:
14 | ## Add custom labels only to logs sts pods
15 | podLabels:
16 | statefulsetLabel: statefulsetValue
17 | ## Add custom annotations only to logs sts pods
18 | podAnnotations:
19 | statefulsetAnnotation: statefulsetValue
20 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/events_otc_statefulset/proxy.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | httpProxy: http://proxy.internal
3 | httpsProxy: https://proxy.internal
4 | noProxy: http://non-proxy.internal
5 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/kube-prometheus-stack/servicemonitors/basic-sumo.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/kube-prometheus-stack/servicemonitors/basic-sumo.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc/basic.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otelcol:
5 | enabled: true
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc/debug.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otelcol:
5 | enabled: true
6 | debug:
7 | logs:
8 | collector:
9 | print: true
10 | stopLogsIngestion: true
11 | metadata:
12 | stopLogsIngestion: true
13 | otellogswindows:
14 | stopLogsIngestion: true
15 | metrics:
16 | collector:
17 | stopLogsIngestion: true
18 | metadata:
19 | stopLogsIngestion: true
20 | instrumentation:
21 | otelcolInstrumentation:
22 | stopLogsIngestion: true
23 | tracesGateway:
24 | stopLogsIngestion: true
25 | tracesSampler:
26 | stopLogsIngestion: true
27 | events:
28 | stopLogsIngestion: true
29 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc/options.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otelcol:
5 | enabled: true
6 | multiline:
7 | enabled: false
8 | systemd:
9 | enabled: true
10 | container:
11 | enabled: false
12 |
13 | otellogs:
14 | logLevel: debug
15 | metricsLevel: detailed
16 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_cloudwatch/basic.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otelcloudwatch:
5 | enabled: true
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_cloudwatch/custom.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otelcloudwatch:
5 | enabled: true
6 | persistence:
7 | enabled: false
8 |
9 | metadata:
10 | image:
11 | repository: my_repository
12 | tag: my_tag
13 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_daemonset/additional.input.yaml:
--------------------------------------------------------------------------------
1 | otellogs:
2 | additionalDaemonSets:
3 | linux:
4 | nodeSelector:
5 | kubernetes.io/os: linux
6 | resources:
7 | requests:
8 | cpu: 2
9 | limits:
10 | cpu: 6
11 | affinity:
12 | nodeAffinity:
13 | requiredDuringSchedulingIgnoredDuringExecution:
14 | nodeSelectorTerms:
15 | - matchExpressions:
16 | - key: kubernetes.io/os
17 | operator: NotIn
18 | values:
19 | - windows
20 | daemonset:
21 | affinity:
22 | nodeAffinity:
23 | requiredDuringSchedulingIgnoredDuringExecution:
24 | nodeSelectorTerms:
25 | - matchExpressions:
26 | - key: kubernetes.io/os
27 | operator: NotIn
28 | values:
29 | - linux
30 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_daemonset/basic.input.yaml:
--------------------------------------------------------------------------------
1 | namespaceOverride: "sumologic"
2 | sumologic:
3 | logs:
4 | collector:
5 | otelcol:
6 | enabled: true
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_daemonset/multiple_multiline.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | multiline:
4 | enabled: true
5 | first_line_regex: "^\\[?\\d{4}-\\d{1,2}-\\d{1,2}.\\d{2}:\\d{2}:\\d{2}"
6 | ## Additional configuration takes precedence over first_line_regex and are executed only for first matching condition
7 | additional:
8 | - first_line_regex: "@@@Log beginning"
9 | condition: attributes["k8s.container.name"] matches "^.*-foo$"
10 | - first_line_regex: "---Log beginning"
11 | condition: attributes["k8s.namespace.name"] == "bar"
12 | - first_line_regex: ": : : Log beginning"
13 | condition: attributes["k8s.namespace.name"] == "foo"
14 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/basic.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/basic.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/basic.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/logs/collector/otelcol/serviceaccount.yaml
3 | apiVersion: v1
4 | kind: ServiceAccount
5 | metadata:
6 | name: RELEASE-NAME-sumologic-otelcol-logs-collector
7 | namespace: sumologic
8 | labels:
9 | app: RELEASE-NAME-sumologic-otelcol-logs-collector
10 | chart: "sumologic-%CURRENT_CHART_VERSION%"
11 | release: "RELEASE-NAME"
12 | heritage: "Helm"
13 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/image_pull_secrets.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | pullSecrets:
3 | - name: myRegistryKeySecretName
4 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_serviceaccount/image_pull_secrets.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/logs/collector/otelcol/serviceaccount.yaml
3 | apiVersion: v1
4 | kind: ServiceAccount
5 | metadata:
6 | name: RELEASE-NAME-sumologic-otelcol-logs-collector
7 | namespace: sumologic
8 | labels:
9 | app: RELEASE-NAME-sumologic-otelcol-logs-collector
10 | chart: "sumologic-%CURRENT_CHART_VERSION%"
11 | release: "RELEASE-NAME"
12 | heritage: "Helm"
13 | imagePullSecrets:
14 | - name: myRegistryKeySecretName
15 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_windows/configmap/basic.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otellogswindows:
5 | enabled: true
6 |
7 | otellogswindows:
8 | daemonset:
9 | nameservers:
10 | - 10.100.0.10
11 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_windows/configmap/debug.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otellogswindows:
5 | enabled: true
6 | debug:
7 | logs:
8 | otellogswindows:
9 | print: true
10 | stopLogsIngestion: true
11 | collector:
12 | stopLogsIngestion: true
13 | metadata:
14 | stopLogsIngestion: true
15 | metrics:
16 | collector:
17 | stopLogsIngestion: true
18 | metadata:
19 | stopLogsIngestion: true
20 | instrumentation:
21 | otelcolInstrumentation:
22 | stopLogsIngestion: true
23 | tracesGateway:
24 | stopLogsIngestion: true
25 | tracesSampler:
26 | stopLogsIngestion: true
27 | events:
28 | stopLogsIngestion: true
29 |
30 | otellogswindows:
31 | daemonset:
32 | nameservers:
33 | - 10.100.0.10
34 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_windows/configmap/options.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otellogswindows:
5 | enabled: true
6 | multiline:
7 | enabled: false
8 | systemd:
9 | enabled: true
10 | container:
11 | enabled: false
12 |
13 | otellogswindows:
14 | logLevel: debug
15 | daemonset:
16 | nameservers:
17 | - 10.100.0.10
18 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_windows/daemonset/additional.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otellogswindows:
5 | enabled: true
6 | otellogswindows:
7 | additionalDaemonSets:
8 | linux:
9 | nodeSelector:
10 | kubernetes.io/os: linux
11 | resources:
12 | requests:
13 | cpu: 2
14 | limits:
15 | cpu: 6
16 | affinity:
17 | nodeAffinity:
18 | requiredDuringSchedulingIgnoredDuringExecution:
19 | nodeSelectorTerms:
20 | - matchExpressions:
21 | - key: kubernetes.io/os
22 | operator: NotIn
23 | values:
24 | - windows
25 | daemonset:
26 | nameservers:
27 | - 10.100.0.10
28 | affinity:
29 | nodeAffinity:
30 | requiredDuringSchedulingIgnoredDuringExecution:
31 | nodeSelectorTerms:
32 | - matchExpressions:
33 | - key: kubernetes.io/os
34 | operator: NotIn
35 | values:
36 | - linux
37 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_windows/daemonset/basic.input.yaml:
--------------------------------------------------------------------------------
1 | namespaceOverride: "sumologic"
2 | sumologic:
3 | logs:
4 | collector:
5 | otellogswindows:
6 | enabled: true
7 | otellogswindows:
8 | daemonset:
9 | nameservers:
10 | - 10.100.0.10
11 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/logs_otc_windows/daemonset/multiple_multiline.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | multiline:
4 | enabled: true
5 | first_line_regex: "^\\[?\\d{4}-\\d{1,2}-\\d{1,2}.\\d{2}:\\d{2}:\\d{2}"
6 | ## Additional configuration takes precedence over first_line_regex and are executed only for first matching condition
7 | additional:
8 | - first_line_regex: "@@@Log beginning"
9 | condition: attributes["k8s.container.name"] matches "^.*-foo$"
10 | - first_line_regex: "---Log beginning"
11 | condition: attributes["k8s.namespace.name"] == "bar"
12 | - first_line_regex: ": : : Log beginning"
13 | condition: attributes["k8s.namespace.name"] == "foo"
14 | collector:
15 | otellogswindows:
16 | enabled: true
17 |
18 | otellogswindows:
19 | daemonset:
20 | nameservers:
21 | - 10.100.0.10
22 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_logs_otc/debug.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | logs:
3 | metadata:
4 | print: true
5 | forwardToSumologicMock: true
6 | stopLogsIngestion: true
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_logs_otc/debug_with_sumologic_mock.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 | logs:
5 | metadata:
6 | print: true
7 | forwardToSumologicMock: true
8 | stopLogsIngestion: true
9 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_logs_otc/debug_with_sumologic_mock_http.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 | logs:
5 | metadata:
6 | print: true
7 | forwardToSumologicMock: true
8 | stopLogsIngestion: true
9 | sumologic:
10 | logs:
11 | sourceType: http
12 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_logs_otc/extra_exporter.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otelcol:
5 | enabled: true
6 | otelcol:
7 | extraExporters:
8 | sumologic/test:
9 | endpoint: https://test-endpoint
10 | debug:
11 | verbosity: detailed
12 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_logs_otc/k8sattributes.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | collector:
3 | otelcol:
4 | enabled: true
5 | metadata:
6 | logs:
7 | useSumoK8sProcessor: false
8 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_logs_otc/otel.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otelcol:
5 | enabled: true
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_logs_otc/routing.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otelcol:
5 | enabled: true
6 | otelcol:
7 | extraExporters:
8 | sumologic/test:
9 | endpoint: https://test-endpoint
10 | debug:
11 | verbosity: detailed
12 | useDefaultExporters: false
13 | routing:
14 | fallbackExporters:
15 | - debug
16 | - sumologic/test
17 | table:
18 | - exporter: sumologic/test
19 | statement: route() where resource.attributes["exporter"] == "test"
20 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_logs_otc/routing_with_defaults.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | collector:
4 | otelcol:
5 | enabled: true
6 | otelcol:
7 | extraExporters:
8 | sumologic/test:
9 | endpoint: https://test-endpoint
10 | debug:
11 | verbosity: detailed
12 | useDefaultExporters: true
13 | routing:
14 | table:
15 | - exporter: sumologic/test
16 | statement: route() where resource.attributes["exporter"] == "test"
17 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_logs_otc/routing_with_defaults_http.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | sourceType: http
4 | collector:
5 | otelcol:
6 | enabled: true
7 | otelcol:
8 | extraExporters:
9 | sumologic/test:
10 | endpoint: https://test-endpoint
11 | debug:
12 | verbosity: detailed
13 | useDefaultExporters: true
14 | routing:
15 | table:
16 | - exporter: sumologic/test
17 | statement: route() where resource.attributes["exporter"] == "test"
18 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/basic.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/metadata_logs_otc_statefulset/basic.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_metrics_otc/additional_endpoints.input.yaml:
--------------------------------------------------------------------------------
1 | metadata:
2 | metrics:
3 | config:
4 | additionalEndpoints:
5 | - /prometheus.metrics.others
6 | - /prometheus.metrics.custom
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_metrics_otc/allow_histograms.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | allowHistogramRegex: "^(apiserver_request_duration_seconds)$"
4 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_metrics_otc/basic.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/metadata_metrics_otc/basic.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_metrics_otc/custom.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | sourceType: http
4 | metadata:
5 | metrics:
6 | autoscaling:
7 | enabled: false
8 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | metrics:
3 | metadata:
4 | print: true
5 | forwardToSumologicMock: true
6 | stopLogsIngestion: true
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug_with_sumologic_mock.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 | metrics:
5 | metadata:
6 | print: true
7 | forwardToSumologicMock: true
8 | stopLogsIngestion: true
9 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_metrics_otc/debug_with_sumologic_mock_http.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 | metrics:
5 | metadata:
6 | print: true
7 | forwardToSumologicMock: true
8 | stopLogsIngestion: true
9 | sumologic:
10 | metrics:
11 | sourceType: http
12 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_metrics_otc/filtered_app_metrics.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | metadata:
4 | provider: otelcol
5 | enableDefaultFilters: true
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/basic.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/metadata_metrics_otc_statefulset/basic.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metrics-server/basic.input.yaml:
--------------------------------------------------------------------------------
1 | metrics-server:
2 | enabled: true
3 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metrics_additional_service_monitors/basic.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | additionalServiceMonitors:
4 | - name: basic-service-monitor
5 | endpoints:
6 | - port: 8888
7 | path: /metrics
8 | selector:
9 | matchLabels:
10 | label-key-a: label-value-a
11 | label-key-b: label-value-b
12 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metrics_additional_service_monitors/custom.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | additionalServiceMonitors:
4 | - name: custom-service-monitor
5 | endpoints:
6 | - port: 8888
7 | path: /metrics
8 | namespaceSelector:
9 | matchNames:
10 | - custom-namespace-a
11 | - custom-namespace-b
12 | selector:
13 | matchLabels:
14 | label-key-a: label-value-a
15 | label-key-b: label-value-b
16 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metrics_collector_otc/basic.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/metrics_collector_otc/basic.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metrics_collector_otc/debug.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | metrics:
3 | collector:
4 | print: true
5 | stopLogsIngestion: true
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/metrics_collector_otc/kubelet.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | collector:
4 | otelcol:
5 | kubelet:
6 | metricRegex: kubelet_running_pods
7 | cAdvisor:
8 | metricRegex: container_cpu_usage_total
9 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.additionalenvs.input.yaml:
--------------------------------------------------------------------------------
1 | opentelemetry-operator:
2 | enabled: true
3 | manager:
4 | autoInstrumentationImage:
5 | dotnet:
6 | repository: myrepo
7 | tag: mytag
8 | python:
9 | repository: myrepo
10 | tag: mytag
11 | nodejs:
12 | repository: myrepo
13 | tag: mytag
14 | java:
15 | repository: myrepo
16 | tag: mytag
17 | instrumentation:
18 | createDefaultInstrumentation: true
19 | instrumentationNamespaces: "ot-operator1,ot-operator2"
20 | instrumentationJobImage:
21 | image:
22 | repository: asd
23 | tag: asd
24 | dotnet:
25 | extraEnvVars:
26 | - name: "test"
27 | value: "dotnetval"
28 | python:
29 | extraEnvVars:
30 | - name: "test"
31 | value: "pythonval"
32 | nodejs:
33 | extraEnvVars:
34 | - name: "test"
35 | value: "nodeval"
36 | java:
37 | extraEnvVars:
38 | - name: "test"
39 | value: "javaval"
40 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.input.yaml:
--------------------------------------------------------------------------------
1 | opentelemetry-operator:
2 | enabled: true
3 | instrumentation:
4 | createDefaultInstrumentation: true
5 | instrumentationNamespaces: "ot-operator1,ot-operator2"
6 | instrumentationJobImage:
7 | image:
8 | repository: asd
9 | tag: asd
10 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.repository.input.yaml:
--------------------------------------------------------------------------------
1 | opentelemetry-operator:
2 | enabled: true
3 | manager:
4 | autoInstrumentationImage:
5 | dotnet:
6 | repository: mydotnetrepo
7 | tag: mydotnettag
8 | python:
9 | repository: mypythonrepo
10 | tag: mypythontag
11 | nodejs:
12 | repository: mynodejsrepo
13 | tag: mynodejstag
14 | java:
15 | repository: myjavarepo
16 | tag: myjavatag
17 | instrumentation:
18 | createDefaultInstrumentation: true
19 | instrumentationNamespaces: "ot-operator1,ot-operator2"
20 | instrumentationJobImage:
21 | image:
22 | repository: asd
23 | tag: asd
24 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_job/job.input.yaml:
--------------------------------------------------------------------------------
1 | opentelemetry-operator:
2 | enabled: true
3 | instrumentation:
4 | createDefaultInstrumentation: true
5 | instrumentationNamespaces: "ot-operator1"
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-config/config-from-merge.input.yaml:
--------------------------------------------------------------------------------
1 | otelcolInstrumentation:
2 | config:
3 | merge:
4 | processors:
5 | batch:
6 | timeout: 10s
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-config/config-from-override.input.yaml:
--------------------------------------------------------------------------------
1 | otelcolInstrumentation:
2 | config:
3 | override:
4 | exporters:
5 | otlphttp/traces:
6 | endpoint: http://RELEASE-NAME-sumologic-traces-gateway.sumologic:4318
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-config/config-from-override.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/instrumentation/otelcol-instrumentation/configmap.yaml
3 | apiVersion: v1
4 | kind: ConfigMap
5 | metadata:
6 | name: RELEASE-NAME-sumologic-otelcol-instrumentation
7 | namespace: sumologic
8 | labels:
9 | app: RELEASE-NAME-sumologic-otelcol-instrumentation
10 | chart: "sumologic-%CURRENT_CHART_VERSION%"
11 | release: "RELEASE-NAME"
12 | heritage: "Helm"
13 | data:
14 | otelcol.instrumentation.conf.yaml: |
15 | exporters:
16 | otlphttp/traces:
17 | endpoint: http://RELEASE-NAME-sumologic-traces-gateway.sumologic:4318
18 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-config/config-from-values-backward-compatibility.input.yaml:
--------------------------------------------------------------------------------
1 | otelcolInstrumentation:
2 | config:
3 | merge:
4 | override:
5 | receivers:
6 | otlp:
7 | protocols:
8 | grpc:
9 | endpoint: "localhost:4317"
10 | http:
11 | endpoint: "localhost:4318"
12 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-config/traces-gateway-disabled.input.yaml:
--------------------------------------------------------------------------------
1 | otelcolInstrumentation:
2 | sourceMetadata:
3 | excludeNamespaceRegex: "kube\\s+"
4 | excludePodRegex: "^foo.*"
5 | excludeContainerRegex: "[123+]bar$|xyz"
6 | excludeHostRegex: hhh123
7 |
8 | tracesGateway:
9 | enabled: false
10 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-config/traces-gateway-disabled.sumologic-mock.input.yaml:
--------------------------------------------------------------------------------
1 | otelcolInstrumentation:
2 | sourceMetadata:
3 | excludeNamespaceRegex: "kube\\s+"
4 | excludePodRegex: "^foo.*"
5 | excludeContainerRegex: "[123+]bar$|xyz"
6 | excludeHostRegex: hhh123
7 |
8 | tracesGateway:
9 | enabled: false
10 |
11 | debug:
12 | instrumentation:
13 | otelcolInstrumentation:
14 | print: true
15 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-config/traces-gateway-enabled.input.yaml:
--------------------------------------------------------------------------------
1 | otelcolInstrumentation:
2 | sourceMetadata:
3 | excludeNamespaceRegex: "kube\\s+"
4 | excludePodRegex: "^foo.*"
5 | excludeContainerRegex: "[123+]bar$|xyz"
6 | excludeHostRegex: hhh123
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-config/traces-gateway-enabled.sumologic-mock.input.yaml:
--------------------------------------------------------------------------------
1 | otelcolInstrumentation:
2 | sourceMetadata:
3 | excludeNamespaceRegex: "kube\\s+"
4 | excludePodRegex: "^foo.*"
5 | excludeContainerRegex: "[123+]bar$|xyz"
6 | excludeHostRegex: hhh123
7 |
8 | tracesGateway:
9 | enabled: false
10 |
11 | debug:
12 | instrumentation:
13 | otelcolInstrumentation:
14 | print: true
15 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-hpa/basic.input.yaml:
--------------------------------------------------------------------------------
1 | otelcolInstrumentation:
2 | enabled: true
3 |
4 | sumologic:
5 | traces:
6 | enabled: true
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-hpa/basic.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/instrumentation/otelcol-instrumentation/hpa.yaml
3 | apiVersion: autoscaling/v2
4 | kind: HorizontalPodAutoscaler
5 | metadata:
6 | name: RELEASE-NAME-sumologic-otelcol-instrumentation
7 | namespace: sumologic
8 | labels:
9 | app: RELEASE-NAME-sumologic-otelcol-instrumentation
10 | chart: "sumologic-%CURRENT_CHART_VERSION%"
11 | release: "RELEASE-NAME"
12 | heritage: "Helm"
13 | spec:
14 | scaleTargetRef:
15 | apiVersion: apps/v1
16 | kind: StatefulSet
17 | name: RELEASE-NAME-sumologic-otelcol-instrumentation
18 | minReplicas: 3
19 | maxReplicas: 10
20 | metrics:
21 | - type: Resource
22 | resource:
23 | name: cpu
24 | target:
25 | type: Utilization
26 | averageUtilization: 100
27 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-statefulset/basic.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/otelcol-instrumentation-statefulset/basic.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otelcol-instrumentation-statefulset/custom.input.yaml:
--------------------------------------------------------------------------------
1 | otelcolInstrumentation:
2 | statefulset:
3 | image:
4 | repository: my_repository
5 | tag: my_tag
6 | autoscaling:
7 | enabled: false
8 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otellogs_metrics/enabled.input.yaml:
--------------------------------------------------------------------------------
1 | otellogs:
2 | metrics:
3 | enabled: true
4 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/otellogs_metrics/enabled.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/logs/collector/common/service.yaml
3 | apiVersion: v1
4 | kind: Service
5 | metadata:
6 | name: RELEASE-NAME-sumologic-otelcol-logs-collector
7 | namespace: sumologic
8 | labels:
9 | app: RELEASE-NAME-sumologic-otelcol-logs-collector
10 | sumologic.com/scrape: "true"
11 | sumologic.com/app: otelcol-logs-collector
12 | sumologic.com/component: logs
13 | chart: "sumologic-%CURRENT_CHART_VERSION%"
14 | release: "RELEASE-NAME"
15 | heritage: "Helm"
16 | spec:
17 | selector:
18 | app.kubernetes.io/app-name: RELEASE-NAME-sumologic-otelcol-logs-collector
19 | ports:
20 | - name: metrics
21 | port: 8888
22 | targetPort: 8888
23 | protocol: TCP
24 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/remote_write_proxy/basic.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | remoteWriteProxy:
4 | enabled: true
5 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/remote_write_proxy/full_configmap.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | nodeSelector:
3 | disktype: hdd
4 | metrics:
5 | remoteWriteProxy:
6 | enabled: true
7 | config:
8 | clientBodyBufferSize: "32k"
9 | port: 80
10 | enableAccessLogs: true
11 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/remote_write_proxy/full_configmap.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/metrics/remote-write-proxy/configmap.yaml
3 | apiVersion: v1
4 | kind: ConfigMap
5 | metadata:
6 | name: RELEASE-NAME-sumologic-remote-write-proxy
7 | namespace: sumologic
8 | labels:
9 | app: RELEASE-NAME-sumologic-remote-write-proxy
10 | chart: "sumologic-%CURRENT_CHART_VERSION%"
11 | release: "RELEASE-NAME"
12 | heritage: "Helm"
13 | data:
14 | remote-write-proxy.conf: |
15 | upstream remote_prometheus {
16 | server RELEASE-NAME-sumologic-metadata-metrics:9888;
17 | }
18 |
19 | upstream remote_otel {
20 | server RELEASE-NAME-sumologic-metadata-metrics:4318;
21 | }
22 |
23 | server {
24 | listen 80 default_server;
25 | location / {
26 | client_body_buffer_size 32k;
27 | proxy_pass http://remote_prometheus;
28 | }
29 | }
30 |
31 | server {
32 | listen 4318 default_server;
33 | location / {
34 | client_body_buffer_size 32k;
35 | proxy_pass http://remote_otel;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/services_with_service_monitor_labels/services_with_service_monitor_labels/default.input.yaml:
--------------------------------------------------------------------------------
1 | metadata:
2 | logs:
3 | statefulset:
4 | extraPorts:
5 | - name: otlphttp2
6 | containerPort: 4319
7 | protocol: TCP
8 | - name: otlphttp3
9 | containerPort: 4320
10 | protocol: TCP
11 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/services_with_service_monitor_labels/services_with_service_monitor_labels/default.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/logs/collector/common/service.yaml
3 | apiVersion: v1
4 | kind: Service
5 | metadata:
6 | name: RELEASE-NAME-sumologic-otelcol-logs-collector
7 | namespace: sumologic
8 | labels:
9 | app: RELEASE-NAME-sumologic-otelcol-logs-collector
10 | sumologic.com/scrape: "true"
11 | sumologic.com/app: otelcol-logs-collector
12 | sumologic.com/component: logs
13 | chart: "sumologic-%CURRENT_CHART_VERSION%"
14 | release: "RELEASE-NAME"
15 | heritage: "Helm"
16 | spec:
17 | selector:
18 | app.kubernetes.io/app-name: RELEASE-NAME-sumologic-otelcol-logs-collector
19 | ports:
20 | - name: metrics
21 | port: 8888
22 | targetPort: 8888
23 | protocol: TCP
24 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/setup/basic.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/setup/basic.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/setup/monitors_with_email_notifications.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | setup:
3 | monitors:
4 | enabled: "true"
5 | notificationEmails: ["test@test.lh", "email@locahost.lh"]
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/setup/monitors_with_single_email.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | setup:
3 | monitors:
4 | enabled: "true"
5 | notificationEmails: "email@locahost.lh"
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/setup/sumologic-mock-no-secret.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 |
5 | enableLocalMode: true
6 |
7 | sumologic:
8 | envFromSecret: false
9 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/setup/sumologic-mock-secret.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 |
5 | enableLocalMode: true
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/setup/sumologic-mock-secret.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/setup/secret.yaml
3 | apiVersion: v1
4 | kind: Secret
5 | metadata:
6 | name: RELEASE-NAME-sumologic-setup
7 | namespace: sumologic
8 | annotations:
9 | helm.sh/hook: pre-install,pre-upgrade
10 | helm.sh/hook-weight: "3"
11 | helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
12 | labels:
13 | app: RELEASE-NAME-sumologic
14 | chart: "sumologic-%CURRENT_CHART_VERSION%"
15 | release: "RELEASE-NAME"
16 | heritage: "Helm"
17 | data:
18 | SUMOLOGIC_ACCESSID: ZHVtbXk=
19 | SUMOLOGIC_ACCESSKEY: ZHVtbXk=
20 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/setup/sumologic-mock.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 |
5 | enableLocalMode: true
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/sumologic-mock/basic.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/sumologic-mock/complex.input.yaml:
--------------------------------------------------------------------------------
1 | namespaceOverride: "collection"
2 | debug:
3 | sumologicMock:
4 | enabled: true
5 | deployment:
6 | nodeSelector:
7 | disktype: ssd
8 | affinity:
9 | nodeAffinity:
10 | preferredDuringSchedulingIgnoredDuringExecution:
11 | - preference:
12 | matchExpressions:
13 | - key: another-node-label-key
14 | operator: In
15 | values:
16 | - another-node-label-value
17 | weight: 1
18 | requiredDuringSchedulingIgnoredDuringExecution:
19 | nodeSelectorTerms:
20 | - matchExpressions:
21 | - key: kubernetes.io/e2e-az-name
22 | operator: In
23 | values:
24 | - e2e-az1
25 | - e2e-az2
26 | tolerations:
27 | - effect: NoSchedule
28 | key: key1
29 | operator: Equal
30 | value: value1
31 | securityContext:
32 | allowPrivilegeEscalation: false
33 | priorityClassName: "high-priority"
34 | resources:
35 | limits:
36 | memory: 3Gi
37 | cpu: 2000m
38 | requests:
39 | memory: 1Gi
40 | cpu: 1000m
41 |
42 | extraArgs:
43 | - --print-logs
44 | - --print-metrics
45 | - --print-headers
46 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/all_fields.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | collector:
3 | sources:
4 | metrics:
5 | test_source:
6 | name: "(Test source)"
7 | properties:
8 | description: "This is complex test"
9 | category: "custom/category"
10 | host_name: "localhost"
11 | timezone: "local timezone"
12 | automatic_date_parsing: false
13 | multiline_processing_enabled: true
14 | use_autoline_matching: false
15 | manual_prefix_regexp: ".*"
16 | force_timezone: true
17 | default_date_formats:
18 | - format: format_1
19 | locator: locator_1
20 | - format: format_2
21 | locator: locator_2
22 | filters:
23 | - name: filter.no1
24 | filter_type: Include
25 | regexp: "[a-z]+"
26 | mask: "some_mask"
27 | - name: filter.no2
28 | filter_type: Exclude
29 | regexp: ".+"
30 | mask: "another_mask"
31 | cutoff_timestamp: 40
32 | cutoff_relative_time: "some value"
33 | fields:
34 | some_field: some_value
35 | another_field: other_value
36 | content_type: "application/json"
37 | test_list:
38 | - point_1
39 | - point_2
40 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/collector_fields.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | collector:
3 | fields:
4 | test_fields: test_value
5 | here_is_very_long_field_name: another_value
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/conditional_sources.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | enabled: false
4 | logs:
5 | enabled: false
6 | traces:
7 | enabled: false
8 | events:
9 | enabled: false
10 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/default.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/terraform/default.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/disable_default_metrics.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | collector:
3 | sources:
4 | metrics:
5 | default:
6 | create: false
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/disabled_dashboards.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | setup:
3 | dashboards:
4 | enabled: false
5 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/disabled_monitors.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | setup:
3 | monitors:
4 | enabled: false
5 | monitorStatus: disabled
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/logs_fields.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | additionalFields:
4 | - addfield1
5 | - addfield2
6 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/monitors_with_email_notifications.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | setup:
3 | monitors:
4 | notificationEmails: ["test@test.lh", "email@locahost.lh"]
5 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/monitors_with_single_email.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | setup:
3 | monitors:
4 | notificationEmails: "email@locahost.lh"
5 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/strip_extrapolation.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | cluster:
3 | host: "https://kubernetes.default.svc"
4 | cluster_ca_certificate: '${file("/var/run/secrets/kubernetes.io/serviceaccount/ca.crt")}'
5 | token: '${file("/var/run/secrets/kubernetes.io/serviceaccount/token")}'
6 | extrapolation: '${file("/var/run/secrets/kubernetes.io/serviceaccount/token")}/${test}'
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/traces.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | enabled: false
4 | logs:
5 | enabled: false
6 | traces:
7 | enabled: true
8 | events:
9 | enabled: false
10 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform/tracing-metrics-disabled.input.yaml:
--------------------------------------------------------------------------------
1 | metrics:
2 | enabled: false
3 | traces:
4 | enabled: true
5 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform_custom/empty.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/terraform_custom/empty.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/terraform_custom/empty.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/setup/custom-configmap.yaml
3 | apiVersion: v1
4 | kind: ConfigMap
5 | metadata:
6 | name: RELEASE-NAME-sumologic-setup-custom
7 | namespace: sumologic
8 | annotations:
9 | helm.sh/hook: pre-install,pre-upgrade
10 | helm.sh/hook-weight: "2"
11 | helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
12 | labels:
13 | app: RELEASE-NAME-sumologic
14 | chart: "sumologic-%CURRENT_CHART_VERSION%"
15 | release: "RELEASE-NAME"
16 | heritage: "Helm"
17 | data:
18 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-gateway-deployment/basic.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/traces-gateway-deployment/basic.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-gateway-deployment/custom.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | traces:
3 | sourceType: http
4 |
5 | tracesGateway:
6 | deployment:
7 | image:
8 | repository: my_repository
9 | tag: my_tag
10 | autoscaling:
11 | enabled: false
12 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-gateway-hpa/basic.input.yaml:
--------------------------------------------------------------------------------
1 | tracesGateway:
2 | enabled: true
3 |
4 | sumologic:
5 | traces:
6 | enabled: true
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-gateway-hpa/basic.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/instrumentation/traces-gateway/hpa.yaml
3 | apiVersion: autoscaling/v2
4 | kind: HorizontalPodAutoscaler
5 | metadata:
6 | name: RELEASE-NAME-sumologic-traces-gateway
7 | namespace: sumologic
8 | labels:
9 | app: RELEASE-NAME-sumologic-traces-gateway
10 | chart: "sumologic-%CURRENT_CHART_VERSION%"
11 | release: "RELEASE-NAME"
12 | heritage: "Helm"
13 | spec:
14 | scaleTargetRef:
15 | apiVersion: apps/v1
16 | kind: Deployment
17 | name: RELEASE-NAME-sumologic-traces-gateway
18 | minReplicas: 1
19 | maxReplicas: 10
20 | metrics:
21 | - type: Resource
22 | resource:
23 | name: cpu
24 | target:
25 | type: Utilization
26 | averageUtilization: 100
27 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-gateway-loadbalancing/config-from-merge.input.yaml:
--------------------------------------------------------------------------------
1 | tracesGateway:
2 | config:
3 | merge:
4 | extensions:
5 | memory_ballast:
6 | size_mib: 256
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-gateway-loadbalancing/config-from-override.input.yaml:
--------------------------------------------------------------------------------
1 | tracesGateway:
2 | config:
3 | override:
4 | exporters:
5 | loadbalancing:
6 | protocol:
7 | otlp:
8 | sending_queue:
9 | enabled: false
10 | num_consumers: 10
11 | queue_size: 10000
12 | timeout: 10s
13 | tls:
14 | insecure: true
15 | resolver:
16 | dns:
17 | hostname: RELEASE-NAME-sumologic-traces-sampler-headless.sumologic
18 | port: 4317
19 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-gateway-loadbalancing/config-from-override.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/instrumentation/traces-gateway/configmap.yaml
3 | apiVersion: v1
4 | kind: ConfigMap
5 | metadata:
6 | name: RELEASE-NAME-sumologic-traces-gateway
7 | namespace: sumologic
8 | labels:
9 | app: RELEASE-NAME-sumologic-traces-gateway
10 | chart: "sumologic-%CURRENT_CHART_VERSION%"
11 | release: "RELEASE-NAME"
12 | heritage: "Helm"
13 | data:
14 | traces.gateway.conf.yaml: |
15 | exporters:
16 | loadbalancing:
17 | protocol:
18 | otlp:
19 | sending_queue:
20 | enabled: false
21 | num_consumers: 10
22 | queue_size: 10000
23 | timeout: 10s
24 | tls:
25 | insecure: true
26 | resolver:
27 | dns:
28 | hostname: RELEASE-NAME-sumologic-traces-sampler-headless.sumologic
29 | port: 4317
30 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-gateway-loadbalancing/config-from-values-backward-compatibility.input.yaml:
--------------------------------------------------------------------------------
1 | tracesGateway:
2 | config:
3 | merge:
4 | override:
5 | exporters:
6 | loadbalancing:
7 | protocol:
8 | otlp:
9 | sending_queue:
10 | queue_size: 100000
11 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-gateway-loadbalancing/sumologic-mock.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | instrumentation:
3 | tracesGateway:
4 | print: true
5 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-gateway-loadbalancing/traces-gateway-true.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/traces-gateway-loadbalancing/traces-gateway-true.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-sampler-deployment/basic.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/traces-sampler-deployment/basic.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-sampler-deployment/custom.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | traces:
3 | sourceType: http
4 |
5 | tracesSampler:
6 | deployment:
7 | image:
8 | repository: my_repository
9 | tag: my_tag
10 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-sampler-deployment/persistence-enabled.input.yaml:
--------------------------------------------------------------------------------
1 | tracesSampler:
2 | persistence:
3 | enabled: true
4 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-sampler/config-from-merge.input.yaml:
--------------------------------------------------------------------------------
1 | tracesSampler:
2 | config:
3 | merge:
4 | extensions:
5 | memory_ballast:
6 | size_mib: 512
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-sampler/config-from-override.input.yaml:
--------------------------------------------------------------------------------
1 | tracesSampler:
2 | config:
3 | override:
4 | extensions:
5 | memory_ballast:
6 | size_mib: 512
7 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-sampler/config-from-override.output.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Source: sumologic/templates/instrumentation/traces-sampler/configmap.yaml
3 | apiVersion: v1
4 | kind: ConfigMap
5 | metadata:
6 | name: RELEASE-NAME-sumologic-traces-sampler
7 | namespace: sumologic
8 | labels:
9 | app: RELEASE-NAME-sumologic-traces-sampler
10 | chart: "sumologic-%CURRENT_CHART_VERSION%"
11 | release: "RELEASE-NAME"
12 | heritage: "Helm"
13 | data:
14 | traces.sampler.conf.yaml: |
15 | extensions:
16 | memory_ballast:
17 | size_mib: 512
18 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-sampler/config-from-values-backward-compatibility.input.yaml:
--------------------------------------------------------------------------------
1 | tracesSampler:
2 | config:
3 | merge:
4 | override:
5 | processors:
6 | cascading_filter:
7 | num_traces: 10
8 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-sampler/httpendpoint.input.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | traces:
3 | sourceType: http
4 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-sampler/persistence-enabled.input.yaml:
--------------------------------------------------------------------------------
1 | tracesSampler:
2 | persistence:
3 | enabled: true
4 |
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-sampler/simple.input.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/978b447f71269f91034cde25b26222aaf2979cda/tests/helm/testdata/goldenfile/traces-sampler/simple.input.yaml
--------------------------------------------------------------------------------
/tests/helm/testdata/goldenfile/traces-sampler/sumologic-mock.input.yaml:
--------------------------------------------------------------------------------
1 | debug:
2 | sumologicMock:
3 | enabled: true
4 | instrumentation:
5 | tracesSampler:
6 | print: true
7 | # enable metrics forwarding
8 | forwardToSumologicMock: true
9 |
--------------------------------------------------------------------------------
/tests/helm/testdata/node-selector.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | nodeSelector:
3 | disktype: hdd
4 | tolerations:
5 | - key: "key"
6 | value: "value"
7 | operator: Exists
8 | effect: "NoSchedule"
9 | affinity:
10 | nodeAffinity:
11 | requiredDuringSchedulingIgnoredDuringExecution:
12 | nodeSelectorTerms:
13 | - matchExpressions:
14 | - key: kubernetes.io/os
15 | operator: NotIn
16 | values:
17 | - linux
18 |
19 | # Override these to satisfy the tests
20 | otellogs:
21 | daemonset:
22 | tolerations: []
23 | kube-prometheus-stack:
24 | kube-state-metrics:
25 | nodeSelector:
26 | disktype: hdd
27 | prometheus-node-exporter:
28 | nodeSelector:
29 | disktype: hdd
30 | tolerations:
31 | - key: "key"
32 | value: "value"
33 | operator: Exists
34 | effect: "NoSchedule"
35 | opentelemetry-operator:
36 | nodeSelector:
37 | disktype: hdd
38 |
--------------------------------------------------------------------------------
/tests/helm/testdata/opentelemetry-metrics-extra-processors.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | otelcol:
4 | extraProcessors:
5 | - filter/1:
6 | metrics:
7 | include:
8 | match_type: regexp
9 | metric_names:
10 | - receiver_mock_.*
11 | resource_attributes:
12 | - key: k8s.pod.name
13 | value: app.*
14 | exclude:
15 | match_type: strict
16 | metric_names:
17 | - receiver_mock_logs_count
18 | - transform/rename_metric:
19 | metric_statements:
20 | - context: metric
21 | statements:
22 | - set(name, "rrreceiver_mock_metrics_count") where name == "receiver_mock_metrics_count"
23 | - transform/rename_metadata:
24 | metric_statements:
25 | - context: resource
26 | statements:
27 | - set(attributes["k8s.pod.pod_name_new"], attributes["k8s.pod.pod_name"])
28 | - delete_key(attributes, "k8s.pod.pod_name")
29 | - set(attributes["my.static.value"], "")
30 |
--------------------------------------------------------------------------------
/tests/helm/testdata/operator-crds-disabled.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | pullSecrets:
3 | - name: pullSecret
4 | setup:
5 | job:
6 | pullSecrets:
7 | - name: pullSecret
8 | logs:
9 | collector:
10 | allowSideBySide: true
11 | otelcloudwatch:
12 | enabled: true
13 |
14 | metrics-server:
15 | enabled: true
16 |
17 | telegraf-operator:
18 | enabled: true
19 |
20 | falco:
21 | enabled: true
22 |
23 | opentelemetry-operator:
24 | enabled: true
25 |
26 | tailing-sidecar-operator:
27 | enabled: true
28 |
--------------------------------------------------------------------------------
/tests/helm/testdata/remotewrite/metrics-disabled.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | enabled: false
4 |
5 | kube-prometheus-stack:
6 | prometheus:
7 | prometheusSpec:
8 | additionalRemoteWrites:
9 | - remoteTimeout: 5s
10 | url: http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888/prometheus.metrics.applications.custom
11 | writeRelabelConfigs:
12 | - action: keep
13 | regex: ^true$
14 | sourceLabels:
15 | - _sumo_forward_
16 | - action: labeldrop
17 | regex: _sumo_forward_
18 | - remoteTimeout: 5s
19 | url: http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888/prometheus.metrics.istio
20 | writeRelabelConfigs:
21 | - action: keep
22 | regex: (?:galley_validation_(passed|failed|config_updates|config_update_error))
23 | sourceLabels:
24 | - __name__
25 |
--------------------------------------------------------------------------------
/tests/helm/testdata/remotewrite/remotewrites-defined-prometheus-disabled.yaml:
--------------------------------------------------------------------------------
1 | kube-prometheus-stack:
2 | prometheus:
3 | prometheusSpec:
4 | additionalRemoteWrites:
5 | - remoteTimeout: 5s
6 | url: http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888/prometheus.metrics.applications.custom
7 | writeRelabelConfigs:
8 | - action: keep
9 | regex: ^true$
10 | sourceLabels:
11 | - _sumo_forward_
12 | - action: labeldrop
13 | regex: _sumo_forward_
14 | - remoteTimeout: 5s
15 | url: http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888/prometheus.metrics.istio
16 | writeRelabelConfigs:
17 | - action: keep
18 | regex: (?:galley_validation_(passed|failed|config_updates|config_update_error))
19 | sourceLabels:
20 | - __name__
21 |
--------------------------------------------------------------------------------
/tests/helm/testdata/remotewrite/remotewrites-defined-prometheus-enabled.yaml:
--------------------------------------------------------------------------------
1 | kube-prometheus-stack:
2 | prometheus:
3 | enabled: true
4 | prometheusSpec:
5 | additionalRemoteWrites:
6 | - remoteTimeout: 5s
7 | url: http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888/prometheus.metrics.applications.custom
8 | writeRelabelConfigs:
9 | - action: keep
10 | regex: ^true$
11 | sourceLabels:
12 | - _sumo_forward_
13 | - action: labeldrop
14 | regex: _sumo_forward_
15 | - remoteTimeout: 5s
16 | url: http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888/prometheus.metrics.istio
17 | writeRelabelConfigs:
18 | - action: keep
19 | regex: (?:galley_validation_(passed|failed|config_updates|config_update_error))
20 | sourceLabels:
21 | - __name__
22 |
--------------------------------------------------------------------------------
/tests/integration/.gitignore:
--------------------------------------------------------------------------------
1 | *.tar
2 |
--------------------------------------------------------------------------------
/tests/integration/.golangci.yaml:
--------------------------------------------------------------------------------
1 | run:
2 | timeout: 10m
3 | allow-parallel-runners: true
4 |
5 | linters-settings:
6 | errcheck:
7 | check-type-assertions: false
8 | check-blank: true
9 |
10 | lll:
11 | # max line length, lines longer will be reported. Default is 120.
12 | # '\t' is counted as 1 character by default, and can be changed with the tab-width option
13 | line-length: 185
14 | # tab width in spaces. Default to 1.
15 | tab-width: 8
16 |
17 | linters:
18 | disable-all: true
19 | enable:
20 | - gofmt
21 | - errcheck
22 | - goimports
23 | - misspell
24 | - lll
25 | - govet
26 | - ineffassign
27 | - typecheck
28 | - unused
29 | - gosimple
30 | - staticcheck
31 |
32 | issues:
33 | # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
34 | max-issues-per-linter: 0
35 | # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
36 | max-same-issues: 0
37 |
--------------------------------------------------------------------------------
/tests/integration/helm_annotations_test.go:
--------------------------------------------------------------------------------
1 | //go:build onlylatest
2 | // +build onlylatest
3 |
4 | package integration
5 |
6 | import (
7 | "testing"
8 | )
9 |
10 | func Test_Helm_Annotations(t *testing.T) {
11 | installChecks := []featureCheck{
12 | CheckOtelcolMetadataLogsInstall,
13 | }
14 |
15 | featInstall := GetInstallFeature(installChecks)
16 |
17 | featAnnotationsTest := GetAnnotationsFeature()
18 |
19 | testenv.Test(t, featInstall, featAnnotationsTest)
20 | }
21 |
--------------------------------------------------------------------------------
/tests/integration/helm_k8s_processor_test.go:
--------------------------------------------------------------------------------
1 | //go:build allversions
2 | // +build allversions
3 |
4 | package integration
5 |
6 | import (
7 | "testing"
8 |
9 | "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal"
10 | "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal/stepfuncs"
11 | )
12 |
13 | func Test_Helm_K8s_Processor(t *testing.T) {
14 |
15 | expectedMetrics := internal.DefaultExpectedMetrics
16 | // we have tracing enabled, so check tracing-specific metrics
17 | expectedMetrics = append(expectedMetrics, internal.TracingOtelcolMetrics...)
18 |
19 | installChecks := []featureCheck{
20 | CheckSumologicSecret(15),
21 | CheckOtelcolMetadataLogsInstall,
22 | CheckOtelcolMetadataMetricsInstall,
23 | CheckOtelcolEventsInstall,
24 | CheckOtelcolMetricsCollectorInstall,
25 | CheckOtelcolLogsCollectorInstall,
26 | CheckTracesInstall,
27 | }
28 |
29 | featInstall := GetInstallFeature(installChecks)
30 |
31 | featMetrics := GetMetricsK8sattributes(expectedMetrics, Otelcol)
32 |
33 | featLogs := GetAllLogsFeature(stepfuncs.WaitUntilExpectedExactLogsPresent, true)
34 |
35 | featMultilineLogs := GetMultipleMultilineLogsFeature()
36 |
37 | featEvents := GetEventsFeature()
38 |
39 | featTraces := GetTracesFeature()
40 |
41 | testenv.Test(t, featInstall, featMetrics, featLogs, featMultilineLogs, featEvents, featTraces)
42 | }
43 |
--------------------------------------------------------------------------------
/tests/integration/helm_namespace_annotations_test.go:
--------------------------------------------------------------------------------
1 | //go:build onlylatest
2 | // +build onlylatest
3 |
4 | package integration
5 |
6 | import (
7 | "testing"
8 | )
9 |
10 | func Test_Helm_Namespace_Annotations(t *testing.T) {
11 | installChecks := []featureCheck{
12 | CheckOtelcolMetadataLogsInstall,
13 | }
14 |
15 | featInstall := GetInstallFeature(installChecks)
16 |
17 | featAnnotationsTest := GetNamespaceAnnotationsFeature()
18 |
19 | testenv.Test(t, featInstall, featAnnotationsTest)
20 | }
21 |
--------------------------------------------------------------------------------
/tests/integration/helm_ot_routing_additional_partially_test.go:
--------------------------------------------------------------------------------
1 | //go:build onlylatest
2 | // +build onlylatest
3 |
4 | package integration
5 |
6 | import (
7 | "testing"
8 |
9 | "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal/stepfuncs"
10 | )
11 |
12 | func Test_Helm_Routing_Additional_Partially(t *testing.T) {
13 |
14 | installChecks := []featureCheck{
15 | CheckOtelcolMetadataLogsInstall,
16 | CheckOtelcolLogsCollectorInstall,
17 | }
18 |
19 | featInstall := GetInstallFeature(installChecks)
20 |
21 | featLogs := GetAllLogsFeature(stepfuncs.WaitUntilExpectedExactLogsPresent, true)
22 | featAdditionalLogs := GetAdditionalPartiallyLogsFeature()
23 |
24 | featDeployMock := DeployAdditionalSumologicMock()
25 | featDeleteMock := DeleteAdditionalSumologicMock()
26 |
27 | testenv.Test(t, featInstall, featDeployMock, featLogs, featAdditionalLogs, featDeleteMock)
28 | }
29 |
--------------------------------------------------------------------------------
/tests/integration/helm_ot_routing_partial_test.go:
--------------------------------------------------------------------------------
1 | //go:build onlylatest
2 | // +build onlylatest
3 |
4 | package integration
5 |
6 | import (
7 | "testing"
8 | )
9 |
10 | func Test_Helm_Routing_Partial(t *testing.T) {
11 |
12 | installChecks := []featureCheck{
13 | CheckOtelcolMetadataLogsInstall,
14 | CheckOtelcolLogsCollectorInstall,
15 | }
16 |
17 | featInstall := GetInstallFeature(installChecks)
18 |
19 | featLogs := GetPartialLogsFeature()
20 |
21 | featDeployMock := DeployAdditionalSumologicMock()
22 | featDeleteMock := DeleteAdditionalSumologicMock()
23 |
24 | testenv.Test(t, featInstall, featDeployMock, featLogs, featDeleteMock)
25 | }
26 |
--------------------------------------------------------------------------------
/tests/integration/helm_ot_routing_test.go:
--------------------------------------------------------------------------------
1 | //go:build onlylatest
2 | // +build onlylatest
3 |
4 | package integration
5 |
6 | import (
7 | "testing"
8 |
9 | "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal/stepfuncs"
10 | )
11 |
12 | func Test_Helm_Routing_OT(t *testing.T) {
13 |
14 | installChecks := []featureCheck{
15 | CheckOtelcolMetadataLogsInstall,
16 | CheckOtelcolLogsCollectorInstall,
17 | }
18 |
19 | featInstall := GetInstallFeature(installChecks)
20 |
21 | featLogs := GetAllLogsFeature(stepfuncs.WaitUntilExpectedExactLogsPresent, true)
22 | featAdditionalLogs := GetAllLogsFeature(stepfuncs.WaitUntilExpectedAdditionalLogsPresent, false)
23 |
24 | featDeployMock := DeployAdditionalSumologicMock()
25 | featDeleteMock := DeleteAdditionalSumologicMock()
26 |
27 | testenv.Test(t, featInstall, featDeployMock, featLogs, featAdditionalLogs, featDeleteMock)
28 | }
29 |
--------------------------------------------------------------------------------
/tests/integration/helm_prometheus_metrics_test.go:
--------------------------------------------------------------------------------
1 | //go:build onlylatest
2 | // +build onlylatest
3 |
4 | package integration
5 |
6 | import (
7 | "testing"
8 |
9 | "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal"
10 | )
11 |
12 | func Test_Helm_Prometheus_Metrics(t *testing.T) {
13 | expectedMetrics := []string{}
14 | // defaults without otel metrics collector metrics, but with Prometheus metrics
15 | expectedMetricsGroups := make([][]string, len(internal.DefaultExpectedMetricsGroups))
16 | copy(expectedMetricsGroups, internal.DefaultExpectedMetricsGroups)
17 | expectedMetricsGroups = append(expectedMetricsGroups, internal.PrometheusMetrics, internal.DefaultOtelcolMetrics)
18 | for _, metrics := range expectedMetricsGroups {
19 | expectedMetrics = append(expectedMetrics, metrics...)
20 | }
21 |
22 | installChecks := []featureCheck{
23 | CheckSumologicSecret(9),
24 | CheckOtelcolMetadataMetricsInstall,
25 | CheckPrometheusInstall,
26 | }
27 |
28 | featInstall := GetInstallFeature(installChecks)
29 |
30 | featMetrics := GetMetricsFeature(expectedMetrics, Prometheus)
31 |
32 | featTelegrafMetrics := GetTelegrafMetricsFeature(internal.DefaultExpectedNginxAnnotatedMetrics, Prometheus, true)
33 |
34 | testenv.Test(t, featInstall, featMetrics, featTelegrafMetrics)
35 | }
36 |
--------------------------------------------------------------------------------
/tests/integration/helm_tailing_sidecar_test.go:
--------------------------------------------------------------------------------
1 | //go:build onlylatest
2 | // +build onlylatest
3 |
4 | package integration
5 |
6 | import (
7 | "testing"
8 | )
9 |
10 | func Test_Helm_Tailing_Sidecar(t *testing.T) {
11 | installChecks := []featureCheck{
12 | CheckOtelcolMetadataLogsInstall,
13 | CheckTailingSidecarOperatorInstall,
14 | }
15 |
16 | featInstall := GetInstallFeature(installChecks)
17 |
18 | featTailingSidecarTest := GetTailingSidecarFeature()
19 |
20 | testenv.Test(t, featInstall, featTailingSidecarTest)
21 | }
22 |
--------------------------------------------------------------------------------
/tests/integration/helm_traces_gateway_disabled_test.go:
--------------------------------------------------------------------------------
1 | //go:build allversions
2 | // +build allversions
3 |
4 | package integration
5 |
6 | import (
7 | "testing"
8 | )
9 |
10 | func Test_Helm_Traces_Gateway_Disabled(t *testing.T) {
11 |
12 | installChecks := []featureCheck{
13 | CheckSumologicSecret(3),
14 | CheckTracesWithoutGatewayInstall,
15 | }
16 |
17 | featInstall := GetInstallFeature(installChecks)
18 |
19 | featTraces := GetTracesFeature()
20 |
21 | testenv.Test(t, featInstall, featTraces)
22 | }
23 |
--------------------------------------------------------------------------------
/tests/integration/instrumentation/dotnet-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: dotnet-app
5 | labels:
6 | app: dotnet-app
7 | spec:
8 | selector:
9 | matchLabels:
10 | app: dotnet-app
11 | replicas: 1
12 | template:
13 | metadata:
14 | labels:
15 | app: dotnet-app
16 | annotations:
17 | instrumentation.opentelemetry.io/inject-dotnet: "true"
18 | spec:
19 | containers:
20 | - name: dotnetapp
21 | image: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-dotnet@sha256:fa7305f4cecd10bf67dc57c8a8bb65e912de950a1cce8877568735368b8b6729
22 | ports:
23 | - containerPort: 80
24 | protocol: TCP
25 |
--------------------------------------------------------------------------------
/tests/integration/instrumentation/dotnet-service.yaml:
--------------------------------------------------------------------------------
1 | kind: Service
2 | apiVersion: v1
3 | metadata:
4 | name: dotnet-app-service
5 | labels:
6 | app: dotnet-svc
7 | spec:
8 | selector:
9 | app: dotnet-app
10 | ports:
11 | - protocol: TCP
12 | targetPort: 80
13 | port: 8080
14 | type: LoadBalancer
15 |
--------------------------------------------------------------------------------
/tests/integration/instrumentation/java-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: java-app
5 | labels:
6 | app: java-app
7 | spec:
8 | selector:
9 | matchLabels:
10 | app: java-app
11 | replicas: 1
12 | template:
13 | metadata:
14 | labels:
15 | app: java-app
16 | annotations:
17 | instrumentation.opentelemetry.io/inject-java: "true"
18 | spec:
19 | containers:
20 | - name: javaapp
21 | image: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-java:main
22 | ports:
23 | - containerPort: 8080
24 | protocol: TCP
25 | securityContext:
26 | allowPrivilegeEscalation: false
27 | capabilities:
28 | drop: ["ALL"]
29 |
--------------------------------------------------------------------------------
/tests/integration/instrumentation/java-service.yaml:
--------------------------------------------------------------------------------
1 | kind: Service
2 | apiVersion: v1
3 | metadata:
4 | name: java-app-service
5 | labels:
6 | app: java-svc
7 | spec:
8 | selector:
9 | app: java-app
10 | ports:
11 | - protocol: TCP
12 | targetPort: 8080
13 | port: 8080
14 | type: LoadBalancer
15 |
--------------------------------------------------------------------------------
/tests/integration/instrumentation/nodejs-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: nodejs-app
5 | labels:
6 | app: nodejs-app
7 | spec:
8 | selector:
9 | matchLabels:
10 | app: nodejs-app
11 | replicas: 1
12 | template:
13 | metadata:
14 | labels:
15 | app: nodejs-app
16 | annotations:
17 | instrumentation.opentelemetry.io/inject-nodejs: "true"
18 | spec:
19 | containers:
20 | - name: nodejsapp
21 | image: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-nodejs:main
22 | env:
23 | - name: NODE_PATH
24 | value: /usr/local/lib/node_modules
25 | ports:
26 | - containerPort: 3000
27 | protocol: TCP
28 | securityContext:
29 | allowPrivilegeEscalation: false
30 | capabilities:
31 | drop: ["ALL"]
32 |
--------------------------------------------------------------------------------
/tests/integration/instrumentation/nodejs-service.yaml:
--------------------------------------------------------------------------------
1 | kind: Service
2 | apiVersion: v1
3 | metadata:
4 | name: nodejs-app-service
5 | labels:
6 | app: nodejs-svc
7 | spec:
8 | selector:
9 | app: nodejs-app
10 | ports:
11 | - protocol: TCP
12 | targetPort: 3000
13 | port: 8080
14 | type: LoadBalancer
15 |
--------------------------------------------------------------------------------
/tests/integration/instrumentation/python-deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: python-app
5 | labels:
6 | app: python-app
7 | spec:
8 | selector:
9 | matchLabels:
10 | app: python-app
11 | replicas: 1
12 | template:
13 | metadata:
14 | labels:
15 | app: python-app
16 | annotations:
17 | instrumentation.opentelemetry.io/inject-python: "true"
18 | spec:
19 | containers:
20 | - name: pythonapp
21 | image: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-python:main
22 | ports:
23 | - containerPort: 8080
24 | protocol: TCP
25 | securityContext:
26 | allowPrivilegeEscalation: false
27 | capabilities:
28 | drop: ["ALL"]
29 |
--------------------------------------------------------------------------------
/tests/integration/instrumentation/python-service.yaml:
--------------------------------------------------------------------------------
1 | kind: Service
2 | apiVersion: v1
3 | metadata:
4 | name: python-app-service
5 | labels:
6 | app: python-svc
7 | spec:
8 | selector:
9 | app: python-app
10 | ports:
11 | - protocol: TCP
12 | targetPort: 8080
13 | port: 8080
14 | type: LoadBalancer
15 |
--------------------------------------------------------------------------------
/tests/integration/internal/ctxopts/context_opts.go:
--------------------------------------------------------------------------------
1 | package ctxopts
2 |
3 | import (
4 | "context"
5 |
6 | "github.com/gruntwork-io/terratest/modules/k8s"
7 | "sigs.k8s.io/e2e-framework/pkg/envconf"
8 | )
9 |
10 | type ctxKey string
11 |
12 | const (
13 | ctxKeyNameNamespace ctxKey = "namespace"
14 | )
15 |
16 | func KubectlOptions(ctx context.Context, envConf *envconf.Config) *k8s.KubectlOptions {
17 | namespace := Namespace(ctx)
18 | return k8s.NewKubectlOptions("", envConf.KubeContext(), namespace)
19 | }
20 |
21 | // NOTE: It's possible to put the namespace in the environment config instead, but this makes running tests in parallel impossible.
22 | // Each test gets its own copy of the context, but they use the same environment config.
23 | func WithNamespace(ctx context.Context, namespace string) context.Context {
24 | return context.WithValue(ctx, ctxKeyNameNamespace, namespace)
25 | }
26 |
27 | func Namespace(ctx context.Context) string {
28 | v := ctx.Value(ctxKeyNameNamespace)
29 | if v == nil {
30 | return ""
31 | }
32 | return v.(string)
33 | }
34 |
--------------------------------------------------------------------------------
/tests/integration/internal/k8s/tunnel.go:
--------------------------------------------------------------------------------
1 | package k8s
2 |
3 | import (
4 | "context"
5 | "testing"
6 |
7 | terrak8s "github.com/gruntwork-io/terratest/modules/k8s"
8 | "sigs.k8s.io/e2e-framework/pkg/envconf"
9 |
10 | "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal"
11 | "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal/ctxopts"
12 | )
13 |
14 | // TunnelForSumologicMock creates a tunnel with port forward to sumologic-mock service.
15 | func TunnelForSumologicMock(
16 | ctx context.Context,
17 | envConf *envconf.Config,
18 | t *testing.T,
19 | serviceName string,
20 | ) *terrak8s.Tunnel {
21 | kubectlOptions := *ctxopts.KubectlOptions(ctx, envConf)
22 | kubectlOptions.Namespace = ctxopts.Namespace(ctx)
23 |
24 | tunnel := terrak8s.NewTunnel(
25 | &kubectlOptions,
26 | terrak8s.ResourceTypeService,
27 | serviceName,
28 | 0,
29 | internal.SumologicMockServicePort,
30 | )
31 | tunnel.ForwardPort(t)
32 | return tunnel
33 | }
34 |
--------------------------------------------------------------------------------
/tests/integration/internal/stepfuncs/adapters.go:
--------------------------------------------------------------------------------
1 | package stepfuncs
2 |
3 | import (
4 | "context"
5 | "testing"
6 |
7 | "sigs.k8s.io/e2e-framework/pkg/envconf"
8 | "sigs.k8s.io/e2e-framework/pkg/features"
9 |
10 | "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal"
11 | )
12 |
13 | func IntoTestEnvFunc(stepFn features.Func) internal.TestEnvFunc {
14 | return func(ctx context.Context, e *envconf.Config, t *testing.T) (context.Context, error) {
15 | return stepFn(ctx, t, e), nil
16 | }
17 | }
18 |
19 | func IntoTestEnvFuncs(stepFns ...features.Func) []internal.TestEnvFunc {
20 | ret := make([]internal.TestEnvFunc, 0, len(stepFns))
21 | for _, fn := range stepFns {
22 | fn := fn
23 | ret = append(ret,
24 | func(ctx context.Context, e *envconf.Config, t *testing.T) (context.Context, error) {
25 | return fn(ctx, t, e), nil
26 | },
27 | )
28 | }
29 |
30 | return ret
31 | }
32 |
--------------------------------------------------------------------------------
/tests/integration/internal/stepfuncs/autoscaler.go:
--------------------------------------------------------------------------------
1 | package stepfuncs
2 |
3 | import (
4 | "context"
5 | "fmt"
6 | "strconv"
7 | "testing"
8 |
9 | "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal/ctxopts"
10 | strings_internal "github.com/SumoLogic/sumologic-kubernetes-collection/tests/integration/internal/strings"
11 | "github.com/gruntwork-io/terratest/modules/k8s"
12 | "sigs.k8s.io/e2e-framework/pkg/envconf"
13 | "sigs.k8s.io/e2e-framework/pkg/features"
14 | )
15 |
16 | func ChangeMinMaxStatefulsetPods(app string, newMin uint64, newMax uint64) features.Func {
17 | return func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
18 | kubectlOptions := ctxopts.KubectlOptions(ctx, c)
19 | strings_internal.ReleaseNameFromT(t)
20 | appName := fmt.Sprintf("%s-%s", strings_internal.ReleaseNameFromT(t), app)
21 |
22 | k8s.RunKubectl(t, kubectlOptions, "delete", "hpa", appName)
23 | k8s.RunKubectl(t, kubectlOptions, "autoscale", "statefulset", appName,
24 | "--min", strconv.FormatUint(newMin, 10),
25 | "--max", strconv.FormatUint(newMax, 10),
26 | )
27 |
28 | return ctx
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/tests/integration/internal/strings/strings.go:
--------------------------------------------------------------------------------
1 | package strings
2 |
3 | import (
4 | "fmt"
5 | "hash/fnv"
6 | "strings"
7 | "testing"
8 | "time"
9 | )
10 |
11 | const (
12 | maxReleaseNameLength = 12
13 | )
14 |
15 | func NameFromT(t *testing.T) string {
16 | return strings.ReplaceAll(strings.ToLower(t.Name()), "_", "-")
17 | }
18 |
19 | func NamespaceFromT(t *testing.T) string {
20 | return fmt.Sprintf("%s-%d", NameFromT(t), time.Now().UnixMilli()%1000)
21 | }
22 |
23 | func ValueFileFromT(t *testing.T) string {
24 | testname := strings.ToLower(t.Name())
25 | testname = strings.TrimPrefix(testname, "test")
26 | testname = strings.TrimPrefix(testname, "_")
27 | testname = strings.ReplaceAll(testname, "-", "_")
28 | return fmt.Sprintf(
29 | "values_%s.yaml", testname,
30 | )
31 | }
32 |
33 | func ReleaseNameFromT(t *testing.T) string {
34 | fullTestName := t.Name()
35 | // take only the top-level test name, so we get a consistent result in all subtests
36 | parts := strings.SplitN(fullTestName, "/", 2)
37 | baseTestName := parts[0]
38 | h := fnv.New32a()
39 | h.Write([]byte(baseTestName))
40 | return fmt.Sprintf("rel-%d", h.Sum32())[:maxReleaseNameLength]
41 | }
42 |
--------------------------------------------------------------------------------
/tests/integration/internal/strings/strings_test.go:
--------------------------------------------------------------------------------
1 | package strings
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/stretchr/testify/assert"
7 | )
8 |
9 | // Even though the two tests below look identical, they actually take the *test name* itself
10 | // as the input - the fact that function returns the same result is the point. They are
11 | // *not* duplicates.
12 | func Test_ValuesFileFromT(t *testing.T) {
13 | assert.Equal(t, "values_valuesfilefromt.yaml", ValueFileFromT(t))
14 | }
15 |
16 | func TestValuesFileFromT(t *testing.T) {
17 | assert.Equal(t, "values_valuesfilefromt.yaml", ValueFileFromT(t))
18 | }
19 |
--------------------------------------------------------------------------------
/tests/integration/internal/types.go:
--------------------------------------------------------------------------------
1 | package internal
2 |
3 | import (
4 | "context"
5 | "testing"
6 |
7 | "sigs.k8s.io/e2e-framework/pkg/envconf"
8 | )
9 |
10 | type TestEnvFunc = func(context.Context, *envconf.Config, *testing.T) (context.Context, error)
11 |
--------------------------------------------------------------------------------
/tests/integration/kind_images.json:
--------------------------------------------------------------------------------
1 | {
2 | "supported": [
3 | "kindest/node:v1.32.0@sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027",
4 | "kindest/node:v1.29.0@sha256:eaa1450915475849a73a9227b8f201df25e55e268e5d619312131292e324d570",
5 | "kindest/node:v1.28.0@sha256:b7a4cad12c197af3ba43202d3efe03246b3f0793f162afb40a33c923952d5b31",
6 | "kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72",
7 | "kindest/node:v1.26.6@sha256:6e2d8b28a5b601defe327b98bd1c2d1930b49e5d8c512e1895099e4504007adb",
8 | "kindest/node:v1.25.11@sha256:227fa11ce74ea76a0474eeefb84cb75d8dad1b08638371ecf0e86259b35be0c8"
9 | ],
10 | "default": "kindest/node:v1.32.0@sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027"
11 | }
12 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_annotations.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | events:
3 | enabled: false
4 | metrics:
5 | enabled: false
6 | traces:
7 | enabled: false
8 | logs:
9 | container:
10 | perContainerAnnotationsEnabled: true
11 | perContainerAnnotationPrefixes: ["sumologic.com/"]
12 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_default_ot.yaml:
--------------------------------------------------------------------------------
1 | metadata:
2 | logs:
3 | multiline:
4 | additional:
5 | - condition: attributes["k8s.container.name"] == "another-container-multiline-logs-long-lines"
6 | first_line_regex: "^@@@"
7 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_default_ot_fips.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | otelcolImage:
3 | addFipsSuffix: true
4 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_default_ot_namespaceoverride.yaml:
--------------------------------------------------------------------------------
1 | # This file uses Prometheus metrics, as the opentelemetry-operator Helm Chart doesn't support namespaceOverride
2 | namespaceOverride: "test-override"
3 |
4 | kube-prometheus-stack:
5 | namespaceOverride: "test-override"
6 |
7 | kube-state-metrics:
8 | namespaceOverride: "test-override"
9 |
10 | prometheus-node-exporter:
11 | namespaceOverride: "test-override"
12 |
13 | prometheus:
14 | enabled: true
15 | prometheusOperator:
16 | enabled: true
17 |
18 | sumologic:
19 | metrics:
20 | collector:
21 | otelcol:
22 | enabled: false
23 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_http_source.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | sourceType: http
4 | events:
5 | sourceType: http
6 | logs:
7 | sourceType: http
8 | traces:
9 | sourceType: http
10 |
11 | ## Adding /v1/traces just for testing purposes.
12 | ## Sumo HTTP Traces endpoint doesn't require "/v1/traces" path.
13 | tracesSampler:
14 | config:
15 | merge:
16 | exporters:
17 | otlphttp:
18 | traces_endpoint: ${SUMO_ENDPOINT_DEFAULT_TRACES_SOURCE}/v1/traces
19 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_k8s_processor.yaml:
--------------------------------------------------------------------------------
1 | metadata:
2 | metrics:
3 | useSumoK8sProcessor: false
4 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_namespace_annotations.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | events:
3 | enabled: false
4 | metrics:
5 | enabled: false
6 | traces:
7 | enabled: false
8 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_opentelemetry_operator_enabled.yaml:
--------------------------------------------------------------------------------
1 | # Request less resources so that this fits on Github actions runners environment
2 | sumologic:
3 | events:
4 | enabled: false
5 | logs:
6 | enabled: false
7 | metrics:
8 | enabled: false
9 |
10 | opentelemetry-operator:
11 | enabled: true
12 |
13 | manager:
14 | resources:
15 | requests:
16 | cpu: 10m
17 | memory: 64Mi
18 |
19 | kubeRBACProxy:
20 | resources:
21 | requests:
22 | cpu: 5m
23 | memory: 64Mi
24 |
25 | instrumentation:
26 | createDefaultInstrumentation: true
27 | instrumentationNamespaces: "ot-operator-enabled-1,ot-operator-enabled-2"
28 |
29 | otelcolInstrumentation:
30 | enabled: true
31 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_ot_histograms.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | allowHistogramRegex: "^(apiserver_request_duration_seconds)$"
4 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_otellogs_metrics_disabled.yaml:
--------------------------------------------------------------------------------
1 | otellogs:
2 | metrics:
3 | enabled: false
4 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_prometheus_metrics.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | logs:
3 | enabled: false
4 | traces:
5 | enabled: false
6 | events:
7 | enabled: false
8 | metrics:
9 | enabled: true
10 | collector:
11 | otelcol:
12 | enabled: false
13 | remoteWriteProxy:
14 | enabled: true
15 |
16 | kube-prometheus-stack:
17 | prometheus:
18 | enabled: true
19 | prometheusOperator:
20 | enabled: true
21 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_pvc_cleaner.yaml:
--------------------------------------------------------------------------------
1 | metadata:
2 | metrics:
3 | autoscaling:
4 | minReplicas: 2
5 | maxReplicas: 2
6 |
7 | logs:
8 | autoscaling:
9 | minReplicas: 2
10 | maxReplicas: 2
11 |
12 | pvcCleaner:
13 | job:
14 | schedule: "*/1 * * * *"
15 | resources:
16 | limits:
17 | memory: 64Mi
18 | cpu: 20m
19 | requests:
20 | memory: 16Mi
21 | cpu: 10m
22 |
23 | logs:
24 | enabled: true
25 |
26 | metrics:
27 | enabled: true
28 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_routing_additional_partially.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | enabled: false
4 | traces:
5 | enabled: false
6 | events:
7 | enabled: false
8 | logs:
9 | otelcol:
10 | extraExporters:
11 | sumologic/additional-sumologic-mock:
12 | endpoint: http://additional-sumologic-mock:3000/receiver
13 | routing:
14 | table:
15 | - exporter: sumologic/additional-sumologic-mock
16 | statement: route() where resource.attributes["deployment"] == "logs-generator"
17 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_routing_ot.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | enabled: false
4 | traces:
5 | enabled: false
6 | events:
7 | enabled: false
8 | logs:
9 | otelcol:
10 | extraExporters:
11 | sumologic/additional-sumologic-mock:
12 | endpoint: http://additional-sumologic-mock:3000/receiver
13 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_routing_partial.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | metrics:
3 | enabled: false
4 | traces:
5 | enabled: false
6 | events:
7 | enabled: false
8 | logs:
9 | otelcol:
10 | useDefaultExporters: false
11 | extraExporters:
12 | sumologic/additional-sumologic-mock:
13 | endpoint: http://additional-sumologic-mock:3000/receiver
14 | routing:
15 | fallbackExporters:
16 | - sumologic
17 | table:
18 | - exporter: sumologic/additional-sumologic-mock
19 | statement: route() where resource.attributes["deployment"] == "logs-generator"
20 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_tailing_sidecar.yaml:
--------------------------------------------------------------------------------
1 | sumologic:
2 | events:
3 | enabled: false
4 | metrics:
5 | enabled: false
6 | traces:
7 | enabled: false
8 |
9 | tailing-sidecar-operator:
10 | enabled: true
11 |
--------------------------------------------------------------------------------
/tests/integration/values/values_helm_traces_gateway_disabled.yaml:
--------------------------------------------------------------------------------
1 | # Request less resources so that this fits on Github actions runners environment
2 | sumologic:
3 | events:
4 | enabled: false
5 | logs:
6 | enabled: false
7 | metrics:
8 | enabled: false
9 |
10 | tracesGateway:
11 | enabled: false
12 |
13 | opentelemetry-operator:
14 | enabled: false
15 |
--------------------------------------------------------------------------------
/tests/integration/values/values_opentelemetry_operator_instrumentation.yaml:
--------------------------------------------------------------------------------
1 | # Request less resources so that this fits on Github actions runners environment
2 | sumologic:
3 | events:
4 | enabled: false
5 | logs:
6 | enabled: false
7 | metrics:
8 | enabled: false
9 |
10 | opentelemetry-operator:
11 | enabled: true
12 |
13 | manager:
14 | resources:
15 | requests:
16 | cpu: 10m
17 | memory: 64Mi
18 |
19 | kubeRBACProxy:
20 | resources:
21 | requests:
22 | cpu: 5m
23 | memory: 64Mi
24 |
25 | instrumentation:
26 | createDefaultInstrumentation: true
27 | instrumentationNamespaces: "ot-operator-instr-1,ot-operator-instr-2,test-apps"
28 |
29 | otelcolInstrumentation:
30 | enabled: true
31 |
32 | tracesGateway:
33 | enabled: false
34 |
--------------------------------------------------------------------------------
/tests/integration/yamls/cluster.yaml:
--------------------------------------------------------------------------------
1 | kind: Cluster
2 | apiVersion: kind.x-k8s.io/v1alpha4
3 | nodes:
4 | - role: control-plane
5 | kubeadmConfigPatches:
6 | # these changes allow us to scrape control plane metrics
7 | # see kind docs on customizing kubeadm: https://kind.sigs.k8s.io/docs/user/configuration/#kubeadm-config-patches
8 | # and kubeadm docs on configuring control plane components: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/control-plane-flags/
9 | # The DNS domain is changed to verify we work correctly in that environment
10 | - |
11 | kind: ClusterConfiguration
12 | scheduler:
13 | extraArgs:
14 | bind-address: 0.0.0.0
15 | controllerManager:
16 | extraArgs:
17 | bind-address: 0.0.0.0
18 | etcd:
19 | local:
20 | dataDir: /tmp/etcd
21 | extraArgs:
22 | listen-metrics-urls: http://0.0.0.0:2381
23 | networking:
24 | dnsDomain: "my.cluster"
25 |
--------------------------------------------------------------------------------
/towncrier.toml:
--------------------------------------------------------------------------------
1 | [tool.towncrier]
2 | directory = ".changelog"
3 | filename = "CHANGELOG.md"
4 | start_string = "\n"
5 | underlines = ["", "", ""]
6 | template = ".changelog/changelog_template.jinja"
7 | title_format = "## [v{version}]"
8 | issue_format = "[#{issue}]"
9 |
10 | [[tool.towncrier.type]]
11 | directory = "breaking"
12 | name = "Breaking Changes"
13 | showcontent = true
14 |
15 | [[tool.towncrier.type]]
16 | directory = "added"
17 | name = "Added"
18 | showcontent = true
19 |
20 | [[tool.towncrier.type]]
21 | directory = "changed"
22 | name = "Changed"
23 | showcontent = true
24 |
25 | [[tool.towncrier.type]]
26 | directory = "fixed"
27 | name = "Fixed"
28 | showcontent = true
29 |
--------------------------------------------------------------------------------
/vagrant/.gitignore:
--------------------------------------------------------------------------------
1 | envs.sh
2 | values.*.yaml
3 |
--------------------------------------------------------------------------------
/vagrant/forwarding/forward-dashboard.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -euo pipefail
4 |
5 | DASHBOARD_POD="$(kubectl get pods --all-namespaces | grep -i kubernetes-dashboard | awk '{print $2}')"
6 |
7 | kubectl -n kube-system port-forward "${DASHBOARD_POD}" --address 0.0.0.0 8443:8443
8 |
--------------------------------------------------------------------------------
/vagrant/forwarding/forward-prometheus.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -euo pipefail
4 |
5 | PROM_POD="$(kubectl get pods --all-namespaces | grep -i prometheus-0 | awk '{print $2}')"
6 |
7 | kubectl -n sumologic port-forward "${PROM_POD}" --address 0.0.0.0 9090:9090
8 |
--------------------------------------------------------------------------------
/vagrant/k8s/application_metrics/jmx/jmxexporter/docker/configmap.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ConfigMap
3 | metadata:
4 | name: jmxexporter-config
5 | namespace: demo-jmxexporter-docker
6 | data:
7 | config.yaml: |-
8 | ---
9 | rules: []
10 |
--------------------------------------------------------------------------------
/vagrant/k8s/application_metrics/nginx/docker/statefulset.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: apps/v1
3 | kind: StatefulSet
4 | metadata:
5 | name: nginx
6 | namespace: demo-nginx-docker
7 | spec:
8 | selector:
9 | matchLabels:
10 | app: nginx
11 | serviceName: nginx
12 | template:
13 | metadata:
14 | labels:
15 | app: nginx
16 | annotations:
17 | telegraf.influxdata.com/inputs: |+
18 | [[inputs.nginx]]
19 | urls = ["http://localhost/nginx_status"]
20 | telegraf.influxdata.com/class: sumologic-prometheus
21 | telegraf.influxdata.com/limits-cpu: "750m"
22 | prometheus.io/scrape: "true"
23 | prometheus.io/port: "9273"
24 | spec:
25 | containers:
26 | - name: nginx
27 | image: nginx:alpine
28 | volumeMounts:
29 | - name: config-volume
30 | mountPath: /etc/nginx/conf.d/default.conf
31 | subPath: default.conf
32 | volumes:
33 | - name: config-volume
34 | configMap:
35 | # Provide the name of the ConfigMap containing the files you want
36 | # to add to the container
37 | name: nginx-config
38 |
--------------------------------------------------------------------------------
/vagrant/k8s/application_metrics/nginx/docker/values.yaml:
--------------------------------------------------------------------------------
1 | telegraf:
2 | namespaces:
3 | - demo-nginx-docker
4 | enabled: true
5 | replicaCount: 1
6 |
--------------------------------------------------------------------------------
/vagrant/k8s/application_metrics/nginx/ingress_official/values.prometheus.yaml:
--------------------------------------------------------------------------------
1 | prometheus:
2 | create: true
3 | controller:
4 | pod:
5 | annotations:
6 | prometheus.io/scrape: "true"
7 | prometheus.io/port: "9113"
8 |
--------------------------------------------------------------------------------
/vagrant/k8s/application_metrics/nginx/ingress_official/values.telegraf.yaml:
--------------------------------------------------------------------------------
1 | controller:
2 | pod:
3 | annotations:
4 | prometheus.io/scrape: "true"
5 | prometheus.io/port: "9273"
6 | telegraf.influxdata.com/inputs: |+
7 | [[inputs.nginx]]
8 | urls = ["http://localhost:8080/stub_status"]
9 | telegraf.influxdata.com/class: sumologic-prometheus
10 | telegraf.influxdata.com/limits-cpu: "750m"
11 |
--------------------------------------------------------------------------------
/vagrant/k8s/application_metrics/redis/bitnami/values.prometheus.yaml:
--------------------------------------------------------------------------------
1 | metrics:
2 | enabled: true
3 |
--------------------------------------------------------------------------------
/vagrant/k8s/application_metrics/redis/bitnami/values.telegraf.yaml:
--------------------------------------------------------------------------------
1 | master:
2 | podAnnotations:
3 | prometheus.io/port: "9273"
4 | prometheus.io/scrape: "true"
5 | telegraf.influxdata.com/inputs: |+
6 | [[inputs.redis]]
7 | servers = ["tcp://:test_password@localhost:6379"]
8 | password = "test_password"
9 | telegraf.influxdata.com/class: sumologic-prometheus
10 | telegraf.influxdata.com/limits-cpu: "750m"
11 | slave:
12 | podAnnotations:
13 | prometheus.io/port: "9273"
14 | prometheus.io/scrape: "true"
15 | telegraf.influxdata.com/inputs: |+
16 | [[inputs.redis]]
17 | servers = ["tcp://:test_password@localhost:6379"]
18 | password = "test_password"
19 | telegraf.influxdata.com/class: sumologic-prometheus
20 | telegraf.influxdata.com/limits-cpu: "750m"
21 | password: test_password
22 |
--------------------------------------------------------------------------------
/vagrant/k8s/application_metrics/redis/docker/statefulset.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: apps/v1
3 | kind: StatefulSet
4 | metadata:
5 | name: redis
6 | namespace: demo-redis-docker
7 | spec:
8 | selector:
9 | matchLabels:
10 | app: redis
11 | serviceName: redis
12 | template:
13 | metadata:
14 | labels:
15 | app: redis
16 | annotations:
17 | telegraf.influxdata.com/inputs: |+
18 | [[inputs.redis]]
19 | servers = ["tcp://localhost:6379"]
20 | telegraf.influxdata.com/class: sumologic-prometheus
21 | telegraf.influxdata.com/limits-cpu: "750m"
22 | prometheus.io/scrape: "true"
23 | prometheus.io/port: "9273"
24 |
25 | spec:
26 | containers:
27 | - name: redis
28 | image: redis:alpine
29 |
--------------------------------------------------------------------------------
/vagrant/k8s/argo.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: argoproj.io/v1alpha1
2 | kind: Application
3 | metadata:
4 | name: collection
5 | namespace: argocd
6 | spec:
7 | destination:
8 | namespace: sumologic
9 | server: https://kubernetes.default.svc
10 | project: default
11 | source:
12 | chart: sumologic
13 | helm:
14 | releaseName: collection2
15 | values:
16 | '{"sumologic": {"accessId": "dummy", "accessKey": "dummy", "endpoint": "http://receiver-mock.receiver-mock:3000/terraform/api/"}}'
17 | repoURL: https://sumologic.github.io/sumologic-kubernetes-collection
18 | targetRevision: 4.3.1
19 | syncPolicy:
20 | syncOptions:
21 | - CreateNamespace=true
22 | - ServerSideApply=true
23 |
--------------------------------------------------------------------------------
/vagrant/k8s/customer-trace-tester.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: v1
3 | kind: Namespace
4 | metadata:
5 | name: customer-trace-tester
6 | spec:
7 | finalizers:
8 | - kubernetes
9 |
10 | ---
11 | apiVersion: v1
12 | kind: Pod
13 | metadata:
14 | name: customer-trace-tester
15 | namespace: customer-trace-tester
16 | spec:
17 | containers:
18 | - args:
19 | - bash
20 | - -c
21 | - while true; do customer-trace-tester; sleep 60; done
22 | env:
23 | - name: COLLECTOR_HOSTNAME
24 | value: collection-sumologic-otelcol.sumologic
25 | - name: TOTAL_TRACES
26 | value: "1"
27 | - name: SPANS_PER_TRACE
28 | value: "10"
29 | - name: OTLP_HTTP
30 | value: "true"
31 | - name: OTLP_GRPC
32 | value: "true"
33 | - name: ZIPKIN
34 | value: "true"
35 | - name: JAEGER_THRIFT_HTTP
36 | value: "true"
37 | image: sumologic/kubernetes-tools
38 | name: customer-trace-tester
39 |
--------------------------------------------------------------------------------
/vagrant/k8s/istio-peer-authentication.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: security.istio.io/v1beta1
2 | kind: PeerAuthentication
3 | metadata:
4 | name: "default"
5 | spec:
6 | mtls:
7 | mode: STRICT
8 |
--------------------------------------------------------------------------------
/vagrant/k8s/logs-generator.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: v1
3 | kind: Namespace
4 | metadata:
5 | name: logs-generator
6 |
7 | ---
8 | apiVersion: apps/v1
9 | kind: Deployment
10 | metadata:
11 | name: logs-generator
12 | namespace: logs-generator
13 | spec:
14 | replicas: 1
15 | selector:
16 | matchLabels:
17 | name: logs-generator
18 | template:
19 | metadata:
20 | labels:
21 | name: logs-generator
22 | spec:
23 | containers:
24 | - image: sumologic/kubernetes-tools:2.22.0
25 | imagePullPolicy: Always
26 | name: logs-generator
27 | command:
28 | - logs-generator
29 | - --time-resolution=1
30 | - --random-patterns=10
31 | - --logs-throughput=100
32 |
--------------------------------------------------------------------------------
/vagrant/k8s/prometheus-adapter.yaml:
--------------------------------------------------------------------------------
1 | # https://github.com/kubernetes-sigs/prometheus-adapter/blob/9008b12a0173e2604e794c1614081b63c17e0340/docs/config.md#metrics-discovery-and-presentation-configuration
2 | rules:
3 | default: false
4 | custom:
5 | - seriesQuery: 'kube_pod_info{namespace!="",pod!=""}'
6 | # Renames kube_pod_info to pod_info
7 | name:
8 | matches: "kube_pod_info"
9 | as: "pod_info"
10 | resources:
11 | overrides:
12 | # overrides query namespace label with the namespace from kubernetes api
13 | namespace: { resource: "namespace" }
14 | # overrides query pod label with the pod from kubernetes api
15 | pod: { resource: "pod" }
16 | metricsQuery: "sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>)"
17 |
18 | prometheus:
19 | url: http://collection-kube-prometheus-prometheus.sumologic.svc
20 |
--------------------------------------------------------------------------------
/vagrant/k8s/service-monitors.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: monitoring.coreos.com/v1
3 | kind: ServiceMonitor
4 | metadata:
5 | name: receiver-mock
6 | namespace: sumologic
7 | labels:
8 | release: collection # Ensure this matches the `release` label on your Prometheus pod
9 | spec:
10 | selector:
11 | matchLabels:
12 | app: receiver-mock
13 | namespaceSelector:
14 | matchNames:
15 | - receiver-mock
16 | endpoints:
17 | - port: "3000" # Same as service's port name
18 | interval: 1s
19 | ---
20 | apiVersion: monitoring.coreos.com/v1
21 | kind: ServiceMonitor
22 | metadata:
23 | name: avalanche
24 | namespace: sumologic
25 | labels:
26 | release: collection # Ensure this matches the `release` label on your Prometheus pod
27 | spec:
28 | selector:
29 | matchLabels:
30 | app: avalanche
31 | namespaceSelector:
32 | matchNames:
33 | - avalanche
34 | endpoints:
35 | - port: "http-avalanche" # Same as service's port name
36 | interval: 10s
37 |
--------------------------------------------------------------------------------
/vagrant/k8s/sumologic.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: v1
3 | kind: Namespace
4 | metadata:
5 | name: sumologic
6 | spec:
7 | finalizers:
8 | - kubernetes
9 |
--------------------------------------------------------------------------------
/vagrant/scripts/README.md:
--------------------------------------------------------------------------------
1 | # Helper Scripts
2 |
3 | This directory contains scripts which may be useful inside and/or outside of vagrant environment.
4 |
5 | ## Diff values
6 |
7 | [diff_values.py](./diff_values.py) is for extracting non-default values from `user-values.yaml`. It compares given `user-values.yaml` with
8 | the helm chart `values.yaml` for specified `--version` and outputs only overrides. If `--version` is not set, script is going to compare
9 | with latest helm chart version.
10 |
11 | Let's consider the following example:
12 |
13 | `user-values.yaml`:
14 |
15 | ```yaml
16 | sumologic:
17 | events:
18 | sourceType: otlp
19 | ```
20 |
21 | ```bash
22 | $ ./vagrant/scripts/diff_values.py --version=v3.15.0 user-values.yaml
23 | sumologic:
24 | events:
25 | sourceType: otlp
26 |
27 | $ ./vagrant/scripts/diff_values.py --version=v4.0.0 user-values.yaml
28 | {}
29 | ```
30 |
--------------------------------------------------------------------------------
/vagrant/scripts/generate-local-config.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | readonly SCRIPT_PATH="$( dirname "$(realpath "${0}")" )"
4 | touch "${SCRIPT_PATH}"/../values.local.yaml
5 |
--------------------------------------------------------------------------------
/vagrant/scripts/get-dashboard-token.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -euo pipefail
4 |
5 | kubectl -n kube-system describe secret default | awk '$1=="token:"{print $2}'
6 |
--------------------------------------------------------------------------------
/vagrant/scripts/get-kubeconfig.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -euo pipefail
3 |
4 | # This script replaces kubeconfig with configuration for vagrant cluster
5 |
6 | clean_up() {
7 | rm "${SSH_CONFIG_PATH}" || true
8 | rm "${CONFIG_PATH}" || true
9 | rmdir "${TEMP_DIR}" || true
10 | popd > /dev/null || true
11 | }
12 |
13 | err_report() {
14 | echo "Script error on line $1"
15 | clean_up
16 | exit 1
17 | }
18 | trap 'err_report $LINENO' ERR
19 |
20 | readonly DIR="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
21 | readonly ROOT_DIR="${DIR}/../../"
22 | readonly TEMP_DIR="$(mktemp -d)"
23 | readonly SSH_CONFIG_PATH="${TEMP_DIR}/ssh-connect.conf"
24 | readonly VAGRANT_IP="192.168.56.2"
25 | readonly CONFIG_PATH="${TEMP_DIR}/config"
26 | readonly KUBECONFIG_PATH=~/.kube/config
27 |
28 | pushd "${ROOT_DIR}" > /dev/null
29 | vagrant ssh-config > "${SSH_CONFIG_PATH}"
30 | ssh -o StrictHostKeyChecking=no -F "${SSH_CONFIG_PATH}" default 'kubectl config view --raw' | \
31 | sed "s/127.0.0.1/${VAGRANT_IP}/g" > "${CONFIG_PATH}"
32 |
33 | TODAY="$(date +%s)"
34 | mv -v "${KUBECONFIG_PATH}" "${KUBECONFIG_PATH}.bkp.${TODAY}"
35 | cp "${CONFIG_PATH}" "${KUBECONFIG_PATH}"
36 |
37 | # Set default namespace to sumologic
38 | kubectl config set-context --current --namespace sumologic
39 |
40 | clean_up
41 |
--------------------------------------------------------------------------------
/vagrant/scripts/prometheus-rules-getter.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | """
3 | This script search prometheus rules files by name and prints
4 | which object contains it and what is the expression to describe it
5 | Usage:
6 |
7 | kubectl get prometheusrules -oyaml > out.yaml
8 | ./prometheus-rules-getter.py out.yaml
9 | """
10 | import sys
11 |
12 | import yaml
13 | from yaml.loader import SafeLoader
14 |
15 | if len(sys.argv) < 3:
16 | sys.exit()
17 |
18 | with open(sys.argv[1]) as f:
19 | monitors = yaml.load(f.read(), Loader=SafeLoader)
20 |
21 | for monitor in monitors['items']:
22 | for group in monitor['spec']['groups']:
23 | for rule in group['rules']:
24 | if rule.get('record') == sys.argv[2]:
25 | print(monitor['metadata']['namespace'], monitor['metadata']['name'])
26 | print(rule['expr'])
27 |
--------------------------------------------------------------------------------
/vagrant/scripts/sumo-make-completion.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -euo pipefail
4 |
5 | targets=$(grep -oE '^\S*\:' /sumologic/vagrant/Makefile | sed 's/\:$//g')
6 | complete -W "${targets}" sumo-make
7 |
8 | # Restore default behavior for bash
9 | set +euo pipefail
10 |
--------------------------------------------------------------------------------
/vagrant/scripts/sumo-make.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | /sumologic/vagrant/Makefile "$@"
4 |
--------------------------------------------------------------------------------
/vagrant/scripts/yq/avalanche-remote-write.yaml:
--------------------------------------------------------------------------------
1 | kube-prometheus-stack:
2 | prometheus:
3 | prometheusSpec:
4 | additionalRemoteWrite:
5 | - url: http://$(METADATA_METRICS_SVC).$(NAMESPACE).svc.cluster.local.:9888/prometheus.metrics.avalanche
6 | writeRelabelConfigs:
7 | - action: keep
8 | regex: avalanche.*
9 | sourceLabels: [__name__]
10 |
--------------------------------------------------------------------------------