added repo

This commit is contained in:
Your Name
2026-08-26 03:39:42 +05:30
parent 45c25a95af
commit b8575bb8b9
6889 changed files with 1217125 additions and 0 deletions
@@ -0,0 +1,25 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# Release related files
release/
@@ -0,0 +1,10 @@
# Operator Chart Contributing Guide
## Bumping Default Operator Version
1. Increase the minor version of the chart by one and set the patch version to zero.
1. Update the chart's `appVersion` to match the new operator version.
1. In the values.yaml, update `manager.collectorImage.tag` to match the version of the collector managed by default by the operator.
1. Run `make generate-examples CHARTS=opentelemetry-operator`.
1. Run `make update-operator-crds` to update the CRDs in this chart to match the operator's.
1. Review the [Operator release notes](https://github.com/open-telemetry/opentelemetry-operator/releases). If any changes affect the helm chart, adjust the helm chart accordingly.
@@ -0,0 +1,15 @@
apiVersion: v2
appVersion: 0.113.0
description: OpenTelemetry Operator Helm chart for Kubernetes
home: https://opentelemetry.io/
icon: https://raw.githubusercontent.com/cncf/artwork/a718fa97fffec1b9fd14147682e9e3ac0c8817cb/projects/opentelemetry/icon/color/opentelemetry-icon-color.png
maintainers:
- name: Allex1
- name: dmitryax
- name: jaronoff97
- name: TylerHelmuth
name: opentelemetry-operator
sources:
- https://github.com/open-telemetry/opentelemetry-operator
type: application
version: 0.74.2
@@ -0,0 +1,300 @@
# OpenTelemetry Operator Helm Chart
> [!WARNING]
> Version 0.58.0 of this Chart includes a new version of the `OpenTelemetryCollector` CRD. See [this document][v1beta1_migration] for upgrade instructions for the new Operator CRD. Please make sure you also follow the [helm upgrade instructions](./UPGRADING.md#0560-to-0570) for helm chart 0.57.0.
The Helm chart installs [OpenTelemetry Operator](https://github.com/open-telemetry/opentelemetry-operator) in Kubernetes cluster.
The OpenTelemetry Operator is an implementation of a [Kubernetes Operator](https://www.openshift.com/learn/topics/operators).
At this point, it has [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector) as the only managed component.
## Prerequisites
- Kubernetes 1.24+ is required for OpenTelemetry Operator installation
- Helm 3.9+
### TLS Certificate Requirement
In Kubernetes, in order for the API server to communicate with the webhook component, the webhook requires a TLS
certificate that the API server is configured to trust. There are a few different ways you can use to generate/configure the required TLS certificate.
- The easiest and default method is to install the [cert-manager](https://cert-manager.io/docs/) and set `admissionWebhooks.certManager.enabled` to `true`.
In this way, cert-manager will generate a self-signed certificate. _See [cert-manager installation](https://cert-manager.io/docs/installation/kubernetes/) for more details._
- You can provide your own Issuer by configuring the `admissionWebhooks.certManager.issuerRef` value. You will need
to specify the `kind` (Issuer or ClusterIssuer) and the `name`. Note that this method also requires the installation of cert-manager.
- You can use an automatically generated self-signed certificate by setting `admissionWebhooks.certManager.enabled` to `false` and `admissionWebhooks.autoGenerateCert.enabled` to `true`. Helm will create a self-signed cert and a secret for you.
- You can use your own generated self-signed certificate by setting both `admissionWebhooks.certManager.enabled` and `admissionWebhooks.autoGenerateCert.enabled` to `false`. You should provide the necessary values to `admissionWebhooks.certFile`, `admissionWebhooks.keyFile`, and `admissionWebhooks.caFile`.
- You can sideload custom webhooks and certificate by disabling `.Values.admissionWebhooks.create` and `admissionWebhooks.certManager.enabled` while setting your custom cert secret name in `admissionWebhooks.secretName`
- You can disable webhooks altogether by disabling `.Values.admissionWebhooks.create` and setting env var to `ENABLE_WEBHOOKS: "false"`
## Add Repository
```console
$ helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
$ helm repo update
```
_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._
## Install Chart
> [!NOTE]
> This Chart uses templated CRDs, and therefore does not support `--skip-crds`. Use `crds.create=false` instead if you do not want the chart to install the OpenTelemetry Operator's CRDs.
```console
$ helm install opentelemetry-operator open-telemetry/opentelemetry-operator \
--set "manager.collectorImage.repository=otel/opentelemetry-collector-k8s"
```
If you created a custom namespace, like in the TLS Certificate Requirement section above, you will need to specify the namespace with the `--namespace` helm option:
```console
$ helm install opentelemetry-operator open-telemetry/opentelemetry-operator \
--namespace opentelemetry-operator-system \
--set "manager.collectorImage.repository=otel/opentelemetry-collector-k8s"
```
If you wish for helm to create an automatically generated self-signed certificate, make sure to set the appropriate values when installing the chart:
```console
$ helm install opentelemetry-operator open-telemetry/opentelemetry-operator \
--set "manager.collectorImage.repository=otel/opentelemetry-collector-k8s" \
--set admissionWebhooks.certManager.enabled=false \
--set admissionWebhooks.autoGenerateCert.enabled=true
```
_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._
## Uninstall Chart
The following command uninstalls the chart whose release name is my-opentelemetry-operator.
```console
$ helm uninstall opentelemetry-operator
```
_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._
This will remove all the Kubernetes components associated with the chart and deletes the release.
The OpenTelemetry Collector CRD created by this chart won't be removed by default and should be manually deleted:
```console
$ kubectl delete crd opentelemetrycollectors.opentelemetry.io
$ kubectl delete crd opampbridges.opentelemetry.io
$ kubectl delete crd instrumentations.opentelemetry.io
```
## Upgrade Chart
```console
$ helm upgrade my-opentelemetry-operator open-telemetry/opentelemetry-operator
```
Please note that by default, the chart will be upgraded to the latest version. If you want to upgrade to a specific version,
use `--version` flag.
With Helm v3.0, CRDs created by this chart are not updated by default and should be manually updated.
Consult also the [Helm Documentation on CRDs](https://helm.sh/docs/chart_best_practices/custom_resource_definitions).
_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._
## Configuration
The following command will show all the configurable options with detailed comments.
```console
$ helm show values open-telemetry/opentelemetry-operator
```
When using this chart as a subchart, you may want to unset certain default values. Since Helm v3.13 values handling is improved and null can now consistently be used to remove values (e.g. to remove the default CPU limits).
### Role-based Access Control (RBAC) Configuration
The OpenTelemetry Collector requires specific RBAC permissions to function correctly, especially when using the `k8sattributesprocessor`. Depending on your deployment's scope, you may need to configure Cluster-scoped or Namespace-scoped RBAC permissions.
- **Cluster-scoped RBAC**: Necessary if the collector is to receive telemetry from across multiple namespaces. This setup requires `get`, `watch`, and `list` permissions on `pods`, `namespaces`, and `nodes`, plus `replicasets` if using deployment-related attributes.
- **Namespace-scoped RBAC**: Suitable for collecting telemetry within a specific namespace. This requires setting up a `Role` and `RoleBinding` to grant access to `pods` and `replicasets` within the target namespace. This setup limits the collector's access to resources within the specified namespace only.
**Important**: The `manager.createRbacPermissions` flag in the Helm chart values should be set to `false` if you are manually configuring RBAC permissions for the collector. Manual configuration allows for more granular control over the permissions granted to the OpenTelemetry Collector, ensuring it has exactly the access it needs based on your specific deployment requirements. Conversely, setting `manager.createRbacPermissions` to `true` will allow the operator to automatically configure RBAC for your collectors.
For detailed instructions and examples on configuring RBAC permissions, please refer to the [official documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/k8sattributesprocessor/README.md).
## Install OpenTelemetry Collector
_See [OpenTelemetry website](https://opentelemetry.io/docs/collector/) for more details about the Collector_
Once the opentelemetry-operator deployment is ready, you can deploy OpenTelemetry Collector in our Kubernetes
cluster.
The Collector can be deployed as one of four modes: Deployment, DaemonSet, StatefulSet and Sidecar. The default
mode is Deployment. We will introduce the benefits and use cases of each mode as well as giving an example for each.
### Deployment Mode
If you want to get more control of the OpenTelemetry Collector and create a standalone application, Deployment would
be your choice. With Deployment, you can relatively easily scale up the Collector to monitor more targets, roll back
to an early version if anything unexpected happens, pause the Collector, etc. In general, you can manage your Collector
instance just as an application.
The following example configuration deploys the Collector as Deployment resource. The receiver is Jaeger receiver and
the exporter is [debug exporter](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/debugexporter).
```console
$ kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: my-collector
spec:
mode: deployment # This configuration is omittable.
config:
receivers:
jaeger:
protocols:
grpc: {}
processors: {}
exporters:
debug: {}
service:
pipelines:
traces:
receivers: [jaeger]
processors: []
exporters: [debug]
EOF
```
### DaemonSet Mode
DaemonSet should satisfy your needs if you want the Collector to run as an agent on your Kubernetes nodes.
In this case, every Kubernetes node will have its own Collector copy which would monitor the pods in it.
The following example configuration deploys the Collector as DaemonSet resource. The receiver is Jaeger receiver and
the exporter is debug exporter.
```console
$ kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: my-collector
spec:
mode: daemonset
hostNetwork: true
config:
receivers:
jaeger:
protocols:
grpc: {}
processors: {}
exporters:
debug:
verbosity: detailed
service:
pipelines:
traces:
receivers: [jaeger]
processors: []
exporters: [debug]
EOF
```
### StatefulSet Mode
There are basically three main advantages to deploy the Collector as the StatefulSet:
- Predictable names of the Collector instance will be expected \
If you use above two approaches to deploy the Collector, the pod name of your Collector instance will be unique (its name plus random sequence).
However, each Pod in a StatefulSet derives its hostname from the name of the StatefulSet and the ordinal of the Pod (my-col-0, my-col-1, my-col-2, etc.).
- Rescheduling will be arranged when a Collector replica fails \
If a Collector pod fails in the StatefulSet, Kubernetes will attempt to reschedule a new pod with the same name to the same node. Kubernetes will also attempt
to attach the same sticky identity (e.g., volumes) to the new pod.
The following example configuration deploys the Collector as StatefulSet resource with three replicas. The receiver
is Jaeger receiver and the exporter is debug exporter.
```console
$ kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: my-collector
spec:
mode: statefulset
replicas: 3
config:
receivers:
jaeger:
protocols:
grpc: {}
processors: {}
exporters:
debug: {}
service:
pipelines:
traces:
receivers: [jaeger]
processors: []
exporters: [debug]
EOF
```
### Sidecar Mode
The biggest advantage of the sidecar mode is that it allows people to offload their telemetry data as fast and reliable as possible from their applications.
This Collector instance will work on the container level and no new pod will be created, which is perfect to keep your Kubernetes cluster clean and easily to be managed.
Moreover, you can also use the sidecar mode when you want to use a different collect/export strategy, which just suits this application.
Once a Sidecar instance exists in a given namespace, you can have your deployments from that namespace to get a sidecar
by either adding the annotation `sidecar.opentelemetry.io/inject: true` to the pod spec of your application, or to the namespace.
_See the [OpenTelemetry Operator github repository](https://github.com/open-telemetry/opentelemetry-operator) for more detailed information._
```console
$ kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: sidecar-for-my-app
spec:
mode: sidecar
config:
receivers:
jaeger:
protocols:
thrift_compact: {}
processors: {}
exporters:
debug: {}
service:
pipelines:
traces:
receivers: [jaeger]
processors: []
exporters: [debug]
EOF
$ kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
name: myapp
annotations:
sidecar.opentelemetry.io/inject: "true"
spec:
containers:
- name: myapp
image: jaegertracing/vertx-create-span:operator-e2e-tests
ports:
- containerPort: 8080
protocol: TCP
EOF
```
[v1beta1_migration]: https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/crd-changelog.md#opentelemetrycollectoropentelemetryiov1beta1
@@ -0,0 +1,112 @@
# Upgrade guidelines
## 0.74.0 to 0.74.1
Prior to 0.72.1, feature gates could be enabled via the `manager.featureGates` property. As feature gates may require extra configuration to work properly, e.g. deploying extra permissions on the ClusterRole, the chart has been updated to make use of the `manager.featureGatesMap` property which allows the chart to smartly configure feature gates. If the `manager.featureGatesMap` property is set, the old `manager.featureGates` property will be ignored.
## 0.57.0 to 0.58.0
OpenTelemetry Operator [0.99.0](https://github.com/open-telemetry/opentelemetry-operator/releases/tag/v0.99.0) includes a new version of the `OpenTelemetryCollector` CRD. See [this document][v1beta1_migration] for upgrade instructions for the new Operator CRD. Please make sure you also follow the [helm upgrade instructions](./UPGRADING.md#0560-to-0570) for helm chart 0.57.0.
## 0.56.0 to 0.57.0
This Chart now installs CRDs as templates. If you were managing CRDs separately by using the `--skip-crds` Helm flag, you need to set `crds.create=false` in your values.yaml.
The reason for this change is OpenTelemetry Operator rolling out a new version of the OpenTelemetryCollector CRD. For information
about this, see the [following document](https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/crd-changelog.md#opentelemetrycollectoropentelemetryiov1beta1). The new CRD version includes a conversion webhook, which needs to reference a namespaced webhook Service, and therefore needs to include the release namespace. See [the following issue](https://github.com/open-telemetry/opentelemetry-helm-charts/issues/1167) for more information on the CRD change.
As a result, manual steps are necessary to convince Helm to manage existing CRDs. This involves adding some annotations and labels, and needs to
be done before upgrading - otherwise the upgrade will fail.
Set `RELEASE_NAME` and `RELEASE_NAMESPACE` to the values you're using for your Helm release, respectively:
```bash
RELEASE_NAME=my-opentelemetry-operator
RELEASE_NAMESPACE=opentelemetry-operator-system
kubectl annotate crds instrumentations.opentelemetry.io opentelemetrycollectors.opentelemetry.io opampbridges.opentelemetry.io \
meta.helm.sh/release-name=${RELEASE_NAME} \
meta.helm.sh/release-namespace=${RELEASE_NAMESPACE}
kubectl label crds instrumentations.opentelemetry.io opentelemetrycollectors.opentelemetry.io opampbridges.opentelemetry.io app.kubernetes.io/managed-by=Helm
```
You can also delete the CRDs and let Helm recreate them, but doing so will also delete any Custom Resources in your cluster.
## 0.55.3 to 0.56.0
> [!WARNING]
> As part of working towards using the [OpenTelemetry Collector Kubernetes Distro](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-k8s) by default, the chart now requires users to explicitly set a collector image repository. If you are already explicitly setting a collector image repository this breaking change does not affect you.
If you are using a OpenTelemetry Community distribution of the Collector we recommend you use `otel/opentelemetry-collector-k8s`, but carefully review the [components included in this distribution](https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/distributions/otelcol-k8s/manifest.yaml) to make sure it includes all the components you use in your configuration. In the future this distribution will become the default image used for the chart.
You can use the OpenTelemetry Collector Kubernetes Distro by adding these lines to your values.yaml:
```yaml
manager:
collectorImage:
repository: "otel/opentelemetry-collector-k8s"
```
If you want to stick with using the Contrib distribution, add these lines to your values.yaml:
```yaml
manager:
collectorImage:
repository: "otel/opentelemetry-collector-contrib"
```
For more details see [#1153](https://github.com/open-telemetry/opentelemetry-helm-charts/issues/1153).
## <0.54.0 to 0.55.2
> **_NOTE:_** Versions 0.54.0 to 0.55.1 of the opentelemetry-operator helm chart should be avoided if providing user-managed certificates as file paths.
[Changes to functionality, and variable names used for providing user-managed webhook certificates](https://github.com/open-telemetry/opentelemetry-helm-charts/pull/1121)
Below variables have been renamed to be consistent with the chart's naming format. v0.54.0 also has a bug fix which makes the chart now read the contents of the file paths provided by these variables, instead of just using the value of the variables.
```
admissionWebhooks.ca_file -> admissionWebhooks.caFile
admissionWebhooks.cert_file -> admissionWebhooks.certFile
admissionWebhooks.key_file -> admissionWebhooks.keyFile
```
## <0.50.0 to 0.50.0
Additional properties are not allowed anymore, so care must be taken that no old or misspelled ones are present anymore.
`helm show values open-telemetry/opentelemetry-operator --version 0.50.0` can be used to list the allowed values.
## <0.42.3 to 0.42.3
A type of flag `autoGenerateCert` has been changed, now it is an object with two attributes `enabled` and `recreate`.
If you previously set `autoGenerateCert` to `true` or `false` you have to set `autoGenerateCert.enabled` accordingly.
## <0.35.0 to 0.35.0
OpenTelemetry Operator [0.82.0](https://github.com/open-telemetry/opentelemetry-operator/releases/tag/v0.82.0) includes a change that allows setting the management state of custom resources [PR 1888](https://github.com/open-telemetry/opentelemetry-operator/pull/1888). Since helm doesn't upgrade CRDs ([documented](https://github.com/open-telemetry/opentelemetry-helm-charts/tree/main/charts/opentelemetry-operator#upgrade-chart)) it is critical to manually update CRDs from chart `0.35.0` or above, possibly using [this procedure](https://github.com/open-telemetry/opentelemetry-helm-charts/issues/69#issuecomment-1567285625). If this step isn't taken existing otelcol CRs won't be reconciled by the operator.
## 0.27 to 0.28
[Allow using own self-signed certificate](https://github.com/open-telemetry/opentelemetry-helm-charts/pull/760)
A new flag `admissionWebhooks.autoGenerateCert` has been added. If you want to keep benefiting from the helm generated certificate as in previous versions, you must set `admissionWebhooks.certManager.enabled` to `false` and `admissionWebhooks.autoGenerateCert` to `true`.
## 0.21 to 0.22.0
Kubernetes resource names will now use `{{opentelemetry-operator.fullname}}` as the default value which will change the name of many resources.
Some CI/CD tools might create duplicate resources when upgrading from an older version because of this change.
`fullnameOverride` can be used to keep `deployment` resource consistent with the same name during an upgrade.
## 0.16.0 to 0.17.0
The v0.17.0 helm chart version changes OpenTelemetry Collector image to the contrib version. If you want to use the core version, set `manager.collectorImage.repository` to `otel/opentelemetry-collector`.
## 0.15.0 to 0.16.0
Jaeger receiver no longer supports remote sampling. To be able to perform an update, it must be deactivated or replaced by a configuration of the [jaegerremotesampling](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.61.0/extension/jaegerremotesampling) extension.<br/>
It is important that the `jaegerremotesampling` extension and the `jaegerreceiver` do not use the same port.<br/>To increase the collector version afterwards, the update must be triggered again by restarting the operator. Alternatively, the `OpenTelemetryCollector` CRD can be re-created. [otel-contrib#14707](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/14707)
## 0.13.0 to 0.14.0
[Allow byo webhooks and cert](https://github.com/open-telemetry/opentelemetry-helm-charts/pull/411)
The ability to use admission webhooks has been moved from `admissionWebhooks.enabled` to `admissionWebhooks.create` as it now supports more use cases.
In order to completely disable admission webhooks you need to explicitly set the environment variable `ENABLE_WEBHOOKS: "false"` in `.Values.manager.env` .
[v1beta1_migration]: https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/crd-changelog.md#opentelemetrycollectoropentelemetryiov1beta1
@@ -0,0 +1,9 @@
nameOverride: no-cert-manager
admissionWebhooks:
certManager:
enabled: false
manager:
collectorImage:
repository: "otel/opentelemetry-collector-k8s"
@@ -0,0 +1,7 @@
admissionWebhooks:
certManager:
enabled: false
manager:
collectorImage:
repository: "otel/opentelemetry-collector-k8s"
@@ -0,0 +1,5 @@
nameOverride: foobar
manager:
collectorImage:
repository: "otel/opentelemetry-collector-k8s"
@@ -0,0 +1,8 @@
nameOverride: secret-name
admissionWebhooks:
secretName: random-name
manager:
collectorImage:
repository: "otel/opentelemetry-collector-k8s"
@@ -0,0 +1,6 @@
admissionWebhooks:
secretName: random-name
manager:
collectorImage:
repository: "otel/opentelemetry-collector-k8s"
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
# Examples of chart configuration
Here is a collection of common configurations for the OpenTelemetry Operator. Each folder contains an example `values.yaml` and the resulting configurations that are generated by the opentelemetry-operator helm chart.
- [Default configuration](default)
The manifests are rendered using the `helm template` command and the specific example folder's values.yaml.
@@ -0,0 +1,190 @@
---
# Source: opentelemetry-operator/templates/admission-webhooks/operator-webhook-with-cert-manager.yaml
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: default/example-opentelemetry-operator-serving-cert
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: webhook
name: example-opentelemetry-operator-mutation
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /mutate-opentelemetry-io-v1alpha1-instrumentation
port: 443
failurePolicy: Fail
name: minstrumentation.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /mutate-opentelemetry-io-v1beta1-opentelemetrycollector
port: 443
failurePolicy: Fail
name: mopentelemetrycollectorbeta.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /mutate-v1-pod
port: 443
failurePolicy: Ignore
name: mpod.kb.io
rules:
- apiGroups:
- ""
apiVersions:
- v1
operations:
- CREATE
resources:
- pods
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
---
# Source: opentelemetry-operator/templates/admission-webhooks/operator-webhook-with-cert-manager.yaml
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: default/example-opentelemetry-operator-serving-cert
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: webhook
name: example-opentelemetry-operator-validation
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /validate-opentelemetry-io-v1alpha1-instrumentation
port: 443
failurePolicy: Fail
name: vinstrumentationcreateupdate.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /validate-opentelemetry-io-v1alpha1-instrumentation
port: 443
failurePolicy: Ignore
name: vinstrumentationdelete.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- DELETE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /validate-opentelemetry-io-v1beta1-opentelemetrycollector
port: 443
failurePolicy: Fail
name: vopentelemetrycollectorcreateupdatebeta.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /validate-opentelemetry-io-v1beta1-opentelemetrycollector
port: 443
failurePolicy: Ignore
name: vopentelemetrycollectordeletebeta.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- DELETE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
@@ -0,0 +1,41 @@
---
# Source: opentelemetry-operator/templates/certmanager.yaml
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: webhook
name: example-opentelemetry-operator-serving-cert
namespace: default
spec:
dnsNames:
- example-opentelemetry-operator-webhook.default.svc
- example-opentelemetry-operator-webhook.default.svc.cluster.local
issuerRef:
kind: Issuer
name: example-opentelemetry-operator-selfsigned-issuer
secretName: example-opentelemetry-operator-controller-manager-service-cert
subject:
organizationalUnits:
- example-opentelemetry-operator
---
# Source: opentelemetry-operator/templates/certmanager.yaml
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: webhook
name: example-opentelemetry-operator-selfsigned-issuer
namespace: default
spec:
selfSigned: {}
@@ -0,0 +1,262 @@
---
# Source: opentelemetry-operator/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-manager
rules:
- apiGroups:
- ""
resources:
- configmaps
- persistentvolumeclaims
- persistentvolumes
- pods
- serviceaccounts
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- statefulsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
- extensions
resources:
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- config.openshift.io
resources:
- infrastructures
- infrastructures/status
verbs:
- get
- list
- watch
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- get
- list
- update
- apiGroups:
- monitoring.coreos.com
resources:
- podmonitors
- servicemonitors
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- instrumentations
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- opampbridges
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- opampbridges/finalizers
verbs:
- update
- apiGroups:
- opentelemetry.io
resources:
- opampbridges/status
verbs:
- get
- patch
- update
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors/finalizers
verbs:
- get
- patch
- update
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors/status
verbs:
- get
- patch
- update
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- route.openshift.io
resources:
- routes
- routes/custom-host
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
---
# Source: opentelemetry-operator/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-metrics
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
---
# Source: opentelemetry-operator/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-proxy
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
@@ -0,0 +1,42 @@
---
# Source: opentelemetry-operator/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-manager
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: example-opentelemetry-operator-manager
subjects:
- kind: ServiceAccount
name: opentelemetry-operator
namespace: default
---
# Source: opentelemetry-operator/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-proxy
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: example-opentelemetry-operator-proxy
subjects:
- kind: ServiceAccount
name: opentelemetry-operator
namespace: default
@@ -0,0 +1,103 @@
---
# Source: opentelemetry-operator/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/component: controller-manager
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/component: controller-manager
spec:
hostNetwork: false
containers:
- args:
- --metrics-addr=0.0.0.0:8080
- --enable-leader-election
- --health-probe-addr=:8081
- --webhook-port=9443
- --collector-image=otel/opentelemetry-collector-k8s:0.113.0
command:
- /manager
env:
- name: ENABLE_WEBHOOKS
value: "true"
image: "ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.113.0"
name: manager
ports:
- containerPort: 8080
name: metrics
protocol: TCP
- containerPort: 9443
name: webhook-server
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 64Mi
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --v=0
image: "quay.io/brancz/kube-rbac-proxy:v0.18.1"
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
protocol: TCP
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 64Mi
serviceAccountName: opentelemetry-operator
terminationGracePeriodSeconds: 10
volumes:
- name: cert
secret:
defaultMode: 420
secretName: example-opentelemetry-operator-controller-manager-service-cert
securityContext:
fsGroup: 65532
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65532
@@ -0,0 +1,42 @@
---
# Source: opentelemetry-operator/templates/role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-leader-election
namespace: default
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- configmaps/status
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
@@ -0,0 +1,22 @@
---
# Source: opentelemetry-operator/templates/rolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-leader-election
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: example-opentelemetry-operator-leader-election
subjects:
- kind: ServiceAccount
name: opentelemetry-operator
namespace: default
@@ -0,0 +1,49 @@
---
# Source: opentelemetry-operator/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator
namespace: default
spec:
ports:
- name: https
port: 8443
protocol: TCP
targetPort: https
- name: metrics
port: 8080
protocol: TCP
targetPort: metrics
selector:
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/component: controller-manager
---
# Source: opentelemetry-operator/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-webhook
namespace: default
spec:
ports:
- port: 443
protocol: TCP
targetPort: webhook-server
selector:
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/component: controller-manager
@@ -0,0 +1,14 @@
---
# Source: opentelemetry-operator/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: opentelemetry-operator
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
@@ -0,0 +1,37 @@
---
# Source: opentelemetry-operator/templates/tests/test-certmanager-connection.yaml
apiVersion: v1
kind: Pod
metadata:
name: "example-opentelemetry-operator-cert-manager"
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: webhook
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: "busybox:latest"
env:
- name: CERT_MANAGER_CLUSTERIP
value: "cert-manager-webhook"
- name: CERT_MANAGER_PORT
value: "443"
command:
- sh
- -c
# The following shell script tests if the cert-manager service is up. If the service is up, when we try
# to wget its exposed port, we will get an HTTP error 400.
- |
wget_output=$(wget -q "$CERT_MANAGER_CLUSTERIP:$CERT_MANAGER_PORT")
if wget_output=="wget: server returned error: HTTP/1.0 400 Bad Request"
then exit 0
else exit 1
fi
restartPolicy: Never
@@ -0,0 +1,74 @@
---
# Source: opentelemetry-operator/templates/tests/test-service-connection.yaml
apiVersion: v1
kind: Pod
metadata:
name: "example-opentelemetry-operator-metrics"
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: "busybox:latest"
env:
- name: MANAGER_METRICS_SERVICE_CLUSTERIP
value: "example-opentelemetry-operator"
- name: MANAGER_METRICS_SERVICE_PORT
value: "8443"
command:
- sh
- -c
# The following shell script tests if the controller-manager-metrics-service is up.
# If the service is up, when we try to wget its exposed port, we will get an HTTP error 400.
- |
wget_output=$(wget -q "$MANAGER_METRICS_SERVICE_CLUSTERIP:$MANAGER_METRICS_SERVICE_PORT")
if wget_output=="wget: server returned error: HTTP/1.0 400 Bad Request"
then exit 0
else exit 1
fi
restartPolicy: Never
---
# Source: opentelemetry-operator/templates/tests/test-service-connection.yaml
apiVersion: v1
kind: Pod
metadata:
name: "example-opentelemetry-operator-webhook"
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: "busybox:latest"
env:
- name: WEBHOOK_SERVICE_CLUSTERIP
value: "example-opentelemetry-operator-webhook"
- name: WEBHOOK_SERVICE_PORT
value: "443"
command:
- sh
- -c
# The following shell script tests if the webhook service is up. If the service is up, when we try
# to wget its exposed port, we will get an HTTP error 400.
- |
wget_output=$(wget -q "$WEBHOOK_SERVICE_CLUSTERIP:$WEBHOOK_SERVICE_PORT")
if wget_output=="wget: server returned error: HTTP/1.0 400 Bad Request"
then exit 0
else exit 1
fi
restartPolicy: Never
@@ -0,0 +1,3 @@
manager:
collectorImage:
repository: "otel/opentelemetry-collector-k8s"
@@ -0,0 +1,190 @@
---
# Source: opentelemetry-operator/templates/admission-webhooks/operator-webhook-with-cert-manager.yaml
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: default/example-opentelemetry-operator-serving-cert
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: webhook
name: example-opentelemetry-operator-mutation
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /mutate-opentelemetry-io-v1alpha1-instrumentation
port: 443
failurePolicy: Fail
name: minstrumentation.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /mutate-opentelemetry-io-v1beta1-opentelemetrycollector
port: 443
failurePolicy: Fail
name: mopentelemetrycollectorbeta.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /mutate-v1-pod
port: 443
failurePolicy: Ignore
name: mpod.kb.io
rules:
- apiGroups:
- ""
apiVersions:
- v1
operations:
- CREATE
resources:
- pods
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
---
# Source: opentelemetry-operator/templates/admission-webhooks/operator-webhook-with-cert-manager.yaml
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: default/example-opentelemetry-operator-serving-cert
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: webhook
name: example-opentelemetry-operator-validation
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /validate-opentelemetry-io-v1alpha1-instrumentation
port: 443
failurePolicy: Fail
name: vinstrumentationcreateupdate.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /validate-opentelemetry-io-v1alpha1-instrumentation
port: 443
failurePolicy: Ignore
name: vinstrumentationdelete.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- DELETE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /validate-opentelemetry-io-v1beta1-opentelemetrycollector
port: 443
failurePolicy: Fail
name: vopentelemetrycollectorcreateupdatebeta.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
- admissionReviewVersions:
- v1
clientConfig:
service:
name: example-opentelemetry-operator-webhook
namespace: default
path: /validate-opentelemetry-io-v1beta1-opentelemetrycollector
port: 443
failurePolicy: Ignore
name: vopentelemetrycollectordeletebeta.kb.io
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- DELETE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: 10
@@ -0,0 +1,41 @@
---
# Source: opentelemetry-operator/templates/certmanager.yaml
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: webhook
name: example-opentelemetry-operator-serving-cert
namespace: default
spec:
dnsNames:
- example-opentelemetry-operator-webhook.default.svc
- example-opentelemetry-operator-webhook.default.svc.cluster.local
issuerRef:
kind: Issuer
name: example-opentelemetry-operator-selfsigned-issuer
secretName: example-opentelemetry-operator-controller-manager-service-cert
subject:
organizationalUnits:
- example-opentelemetry-operator
---
# Source: opentelemetry-operator/templates/certmanager.yaml
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: webhook
name: example-opentelemetry-operator-selfsigned-issuer
namespace: default
spec:
selfSigned: {}
@@ -0,0 +1,276 @@
---
# Source: opentelemetry-operator/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-manager
rules:
- apiGroups:
- ""
resources:
- configmaps
- persistentvolumeclaims
- persistentvolumes
- pods
- serviceaccounts
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- statefulsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
- extensions
resources:
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- config.openshift.io
resources:
- infrastructures
- infrastructures/status
verbs:
- get
- list
- watch
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- get
- list
- update
- apiGroups:
- monitoring.coreos.com
resources:
- podmonitors
- servicemonitors
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- instrumentations
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- opampbridges
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- opampbridges/finalizers
verbs:
- update
- apiGroups:
- opentelemetry.io
resources:
- opampbridges/status
verbs:
- get
- patch
- update
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors/finalizers
verbs:
- get
- patch
- update
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors/status
verbs:
- get
- patch
- update
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- route.openshift.io
resources:
- routes
- routes/custom-host
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cert-manager.io
resources:
- issuers
- certificaterequests
- certificates
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
---
# Source: opentelemetry-operator/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-metrics
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
---
# Source: opentelemetry-operator/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-proxy
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
@@ -0,0 +1,42 @@
---
# Source: opentelemetry-operator/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-manager
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: example-opentelemetry-operator-manager
subjects:
- kind: ServiceAccount
name: opentelemetry-operator
namespace: default
---
# Source: opentelemetry-operator/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-proxy
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: example-opentelemetry-operator-proxy
subjects:
- kind: ServiceAccount
name: opentelemetry-operator
namespace: default
@@ -0,0 +1,104 @@
---
# Source: opentelemetry-operator/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/component: controller-manager
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/component: controller-manager
spec:
hostNetwork: false
containers:
- args:
- --metrics-addr=0.0.0.0:8080
- --enable-leader-election
- --health-probe-addr=:8081
- --webhook-port=9443
- --collector-image=otel/opentelemetry-collector-k8s:0.113.0
- --feature-gates=operator.targetallocator.mtls
command:
- /manager
env:
- name: ENABLE_WEBHOOKS
value: "true"
image: "ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.113.0"
name: manager
ports:
- containerPort: 8080
name: metrics
protocol: TCP
- containerPort: 9443
name: webhook-server
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 64Mi
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --v=0
image: "quay.io/brancz/kube-rbac-proxy:v0.18.1"
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
protocol: TCP
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 64Mi
serviceAccountName: opentelemetry-operator
terminationGracePeriodSeconds: 10
volumes:
- name: cert
secret:
defaultMode: 420
secretName: example-opentelemetry-operator-controller-manager-service-cert
securityContext:
fsGroup: 65532
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65532
@@ -0,0 +1,42 @@
---
# Source: opentelemetry-operator/templates/role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-leader-election
namespace: default
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- configmaps/status
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
@@ -0,0 +1,22 @@
---
# Source: opentelemetry-operator/templates/rolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-leader-election
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: example-opentelemetry-operator-leader-election
subjects:
- kind: ServiceAccount
name: opentelemetry-operator
namespace: default
@@ -0,0 +1,49 @@
---
# Source: opentelemetry-operator/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator
namespace: default
spec:
ports:
- name: https
port: 8443
protocol: TCP
targetPort: https
- name: metrics
port: 8080
protocol: TCP
targetPort: metrics
selector:
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/component: controller-manager
---
# Source: opentelemetry-operator/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
name: example-opentelemetry-operator-webhook
namespace: default
spec:
ports:
- port: 443
protocol: TCP
targetPort: webhook-server
selector:
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/component: controller-manager
@@ -0,0 +1,14 @@
---
# Source: opentelemetry-operator/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: opentelemetry-operator
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
@@ -0,0 +1,37 @@
---
# Source: opentelemetry-operator/templates/tests/test-certmanager-connection.yaml
apiVersion: v1
kind: Pod
metadata:
name: "example-opentelemetry-operator-cert-manager"
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: webhook
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: "busybox:latest"
env:
- name: CERT_MANAGER_CLUSTERIP
value: "cert-manager-webhook"
- name: CERT_MANAGER_PORT
value: "443"
command:
- sh
- -c
# The following shell script tests if the cert-manager service is up. If the service is up, when we try
# to wget its exposed port, we will get an HTTP error 400.
- |
wget_output=$(wget -q "$CERT_MANAGER_CLUSTERIP:$CERT_MANAGER_PORT")
if wget_output=="wget: server returned error: HTTP/1.0 400 Bad Request"
then exit 0
else exit 1
fi
restartPolicy: Never
@@ -0,0 +1,74 @@
---
# Source: opentelemetry-operator/templates/tests/test-service-connection.yaml
apiVersion: v1
kind: Pod
metadata:
name: "example-opentelemetry-operator-metrics"
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: "busybox:latest"
env:
- name: MANAGER_METRICS_SERVICE_CLUSTERIP
value: "example-opentelemetry-operator"
- name: MANAGER_METRICS_SERVICE_PORT
value: "8443"
command:
- sh
- -c
# The following shell script tests if the controller-manager-metrics-service is up.
# If the service is up, when we try to wget its exposed port, we will get an HTTP error 400.
- |
wget_output=$(wget -q "$MANAGER_METRICS_SERVICE_CLUSTERIP:$MANAGER_METRICS_SERVICE_PORT")
if wget_output=="wget: server returned error: HTTP/1.0 400 Bad Request"
then exit 0
else exit 1
fi
restartPolicy: Never
---
# Source: opentelemetry-operator/templates/tests/test-service-connection.yaml
apiVersion: v1
kind: Pod
metadata:
name: "example-opentelemetry-operator-webhook"
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.74.2
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.113.0"
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: example
app.kubernetes.io/component: controller-manager
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: "busybox:latest"
env:
- name: WEBHOOK_SERVICE_CLUSTERIP
value: "example-opentelemetry-operator-webhook"
- name: WEBHOOK_SERVICE_PORT
value: "443"
command:
- sh
- -c
# The following shell script tests if the webhook service is up. If the service is up, when we try
# to wget its exposed port, we will get an HTTP error 400.
- |
wget_output=$(wget -q "$WEBHOOK_SERVICE_CLUSTERIP:$WEBHOOK_SERVICE_PORT")
if wget_output=="wget: server returned error: HTTP/1.0 400 Bad Request"
then exit 0
else exit 1
fi
restartPolicy: Never
@@ -0,0 +1,5 @@
manager:
collectorImage:
repository: "otel/opentelemetry-collector-k8s"
featureGatesMap:
operator.targetallocator.mtls: true
@@ -0,0 +1,14 @@
{{- if not .Values.manager.collectorImage.repository }}
{{ fail "[ERROR] 'manager.collectorImage.repository' must be set. See https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-operator/UPGRADING.md for instructions." }}
{{ end }}
{{- if and .Values.manager.featureGates .Values.manager.featureGatesMap }}
{{ fail "[ERROR] only one of 'manager.featureGates' and 'manager.featureGatesMap' can be set at a time" }}
{{ end }}
{{- if .Values.manager.featureGates }}
The 'manager.featureGates' value is deprecated. Please migrate to use the 'manager.featureGatesMap' value.
{{ end }}
{{ $.Chart.Name }} has been installed. Check its status by running:
kubectl --namespace {{ .Release.Namespace }} get pods -l "app.kubernetes.io/name={{ $.Release.Name }}"
Visit https://github.com/open-telemetry/opentelemetry-operator for instructions on how to create & configure OpenTelemetryCollector and Instrumentation custom resources by using the Operator.
@@ -0,0 +1,168 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "opentelemetry-operator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "opentelemetry-operator.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "opentelemetry-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "opentelemetry-operator.labels" -}}
helm.sh/chart: {{ include "opentelemetry-operator.chart" . }}
{{ include "opentelemetry-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.additionalLabels }}
{{ include "opentelemetry-operator.additionalLabels" . }}
{{- end }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "opentelemetry-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "opentelemetry-operator.name" . }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "opentelemetry-operator.serviceAccountName" -}}
{{- if .Values.manager.serviceAccount.create }}
{{- default (include "opentelemetry-operator.name" .) .Values.manager.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.manager.serviceAccount.name }}
{{- end }}
{{- end }}
{{- define "opentelemetry-operator.podAnnotations" -}}
{{- if .Values.manager.podAnnotations }}
{{- .Values.manager.podAnnotations | toYaml }}
{{- end }}
{{- end }}
{{- define "opentelemetry-operator.podLabels" -}}
{{- if .Values.manager.podLabels }}
{{- .Values.manager.podLabels | toYaml }}
{{- end }}
{{- end }}
{{- define "opentelemetry-operator.additionalLabels" -}}
{{- if .Values.additionalLabels }}
{{- tpl (.Values.additionalLabels | toYaml) . }}
{{- end }}
{{- end }}
{{/*
Create an ordered name of the MutatingWebhookConfiguration
*/}}
{{- define "opentelemetry-operator.MutatingWebhookName" -}}
{{- printf "%s-%s" (.Values.admissionWebhooks.namePrefix | toString) (include "opentelemetry-operator.fullname" .) | trimPrefix "-" }}
{{- end }}
{{/*
Return certificate and CA for Webhooks.
It handles variants when a cert has to be generated by Helm,
a cert is loaded from an existing secret or is provided via `.Values`
*/}}
{{- define "opentelemetry-operator.WebhookCert" -}}
{{- $caCertEnc := "" }}
{{- $certCrtEnc := "" }}
{{- $certKeyEnc := "" }}
{{- if .Values.admissionWebhooks.autoGenerateCert.enabled }}
{{- $prevSecret := (lookup "v1" "Secret" .Release.Namespace (default (printf "%s-controller-manager-service-cert" (include "opentelemetry-operator.fullname" .)) .Values.admissionWebhooks.secretName )) }}
{{- if and (not .Values.admissionWebhooks.autoGenerateCert.recreate) $prevSecret }}
{{- $certCrtEnc = index $prevSecret "data" "tls.crt" }}
{{- $certKeyEnc = index $prevSecret "data" "tls.key" }}
{{- $caCertEnc = index $prevSecret "data" "ca.crt" }}
{{- if not $caCertEnc }}
{{- $prevHook := (lookup "admissionregistration.k8s.io/v1" "MutatingWebhookConfiguration" .Release.Namespace (print (include "opentelemetry-operator.MutatingWebhookName" . ) "-mutation")) }}
{{- if not (eq (toString $prevHook) "<nil>") }}
{{- $caCertEnc = (first $prevHook.webhooks).clientConfig.caBundle }}
{{- end }}
{{- end }}
{{- else }}
{{- $altNames := list ( printf "%s-webhook.%s" (include "opentelemetry-operator.fullname" .) .Release.Namespace ) ( printf "%s-webhook.%s.svc" (include "opentelemetry-operator.fullname" .) .Release.Namespace ) -}}
{{- $tmpperioddays := int .Values.admissionWebhooks.autoGenerateCert.certPeriodDays | default 365 }}
{{- $ca := genCA "opentelemetry-operator-operator-ca" $tmpperioddays }}
{{- $cert := genSignedCert (include "opentelemetry-operator.fullname" .) nil $altNames $tmpperioddays $ca }}
{{- $certCrtEnc = b64enc $cert.Cert }}
{{- $certKeyEnc = b64enc $cert.Key }}
{{- $caCertEnc = b64enc $ca.Cert }}
{{- end }}
{{- else }}
{{- $certCrtEnc = .Files.Get .Values.admissionWebhooks.certFile | b64enc }}
{{- $certKeyEnc = .Files.Get .Values.admissionWebhooks.keyFile | b64enc }}
{{- $caCertEnc = .Files.Get .Values.admissionWebhooks.caFile | b64enc }}
{{- end }}
{{- $result := dict "crt" $certCrtEnc "key" $certKeyEnc "ca" $caCertEnc }}
{{- $result | toYaml }}
{{- end }}
{{/*
Return the name of cert-manager's Certificate resources for webhooks.
*/}}
{{- define "opentelemetry-operator.webhookCertName" -}}
{{ template "opentelemetry-operator.fullname" . }}-serving-cert
{{- end }}
{{/*
Return the name of the cert-manager.io/inject-ca-from annotation for webhooks and CRDs.
*/}}
{{- define "opentelemetry-operator.webhookCertAnnotation" -}}
{{- if not .Values.admissionWebhooks.certManager.enabled }}
{{- "none" }}
{{- else }}
{{- printf "%s/%s" .Release.Namespace (include "opentelemetry-operator.webhookCertName" .) }}
{{- end }}
{{- end }}
{{/*
The image to use for opentelemetry-operator.
*/}}
{{- define "opentelemetry-operator.image" -}}
{{- printf "%s:%s" .Values.manager.image.repository (default .Chart.AppVersion .Values.manager.image.tag) }}
{{- end }}
{{- define "opentelemetry-operator.featureGatesMap" -}}
{{$first := true}}
{{- range $key, $value := .Values.manager.featureGatesMap -}}
{{- if $first -}}
{{ $first = false }}
{{- else -}}
,
{{- end -}}
{{- if $value -}}
{{- $key }}
{{- end -}}
{{- end -}}
{{- end }}
@@ -0,0 +1,237 @@
{{- if and (.Values.admissionWebhooks.create) (.Values.admissionWebhooks.certManager.enabled) }}
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: {{ include "opentelemetry-operator.webhookCertAnnotation" . }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: webhook
name: {{ template "opentelemetry-operator.MutatingWebhookName" . }}-mutation
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutate-opentelemetry-io-v1alpha1-instrumentation
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
name: minstrumentation.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutate-opentelemetry-io-v1beta1-opentelemetrycollector
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
name: mopentelemetrycollectorbeta.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutate-v1-pod
port: {{ .Values.admissionWebhooks.servicePort }}
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
failurePolicy: {{ .Values.admissionWebhooks.pods.failurePolicy }}
name: mpod.kb.io
rules:
- apiGroups:
- ""
apiVersions:
- v1
operations:
- CREATE
resources:
- pods
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: {{ include "opentelemetry-operator.webhookCertAnnotation" . }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: webhook
name: {{ template "opentelemetry-operator.fullname" . }}-validation
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-opentelemetry-io-v1alpha1-instrumentation
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
name: vinstrumentationcreateupdate.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-opentelemetry-io-v1alpha1-instrumentation
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: Ignore
name: vinstrumentationdelete.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- DELETE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-opentelemetry-io-v1beta1-opentelemetrycollector
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
name: vopentelemetrycollectorcreateupdatebeta.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-opentelemetry-io-v1beta1-opentelemetrycollector
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: Ignore
name: vopentelemetrycollectordeletebeta.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- DELETE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
{{- end }}
@@ -0,0 +1,282 @@
{{- if and (.Values.admissionWebhooks.create) (not .Values.admissionWebhooks.certManager.enabled) }}
{{- $cert := fromYaml (include "opentelemetry-operator.WebhookCert" .) }}
{{- $caCertEnc := $cert.ca }}
{{- $certCrtEnc := $cert.crt }}
{{- $certKeyEnc := $cert.key }}
apiVersion: v1
kind: Secret
type: kubernetes.io/tls
metadata:
annotations:
"helm.sh/hook": "pre-install,pre-upgrade"
"helm.sh/hook-delete-policy": "before-hook-creation"
{{- if .Values.admissionWebhooks.secretAnnotations }}
{{- toYaml .Values.admissionWebhooks.secretAnnotations | nindent 4 }}
{{- end }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: webhook
{{- if .Values.admissionWebhooks.secretLabels }}
{{- toYaml .Values.admissionWebhooks.secretLabels | nindent 4 }}
{{- end }}
name: {{ default (printf "%s-controller-manager-service-cert" (include "opentelemetry-operator.fullname" .)) .Values.admissionWebhooks.secretName }}
namespace: {{ .Release.Namespace }}
data:
tls.crt: {{ $certCrtEnc }}
tls.key: {{ $certKeyEnc }}
ca.crt: {{ $caCertEnc }}
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: webhook
name: {{ template "opentelemetry-operator.MutatingWebhookName" . }}-mutation
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ $caCertEnc }}
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutate-opentelemetry-io-v1alpha1-instrumentation
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
name: minstrumentation.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ $caCertEnc }}
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutate-opentelemetry-io-v1beta1-opentelemetrycollector
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
name: mopentelemetrycollectorbeta.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ $caCertEnc }}
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutate-v1-pod
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: {{ .Values.admissionWebhooks.pods.failurePolicy }}
name: mpod.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- ""
apiVersions:
- v1
operations:
- CREATE
resources:
- pods
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: {{ include "opentelemetry-operator.webhookCertAnnotation" . }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: webhook
name: {{ template "opentelemetry-operator.fullname" . }}-validation
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ $caCertEnc }}
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-opentelemetry-io-v1alpha1-instrumentation
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
name: vinstrumentationcreateupdate.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ $caCertEnc }}
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-opentelemetry-io-v1alpha1-instrumentation
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: Ignore
name: vinstrumentationdelete.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1alpha1
operations:
- DELETE
resources:
- instrumentations
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ $caCertEnc }}
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-opentelemetry-io-v1beta1-opentelemetrycollector
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: {{ .Values.admissionWebhooks.failurePolicy }}
name: vopentelemetrycollectorcreateupdatebeta.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- CREATE
- UPDATE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ $caCertEnc }}
service:
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-opentelemetry-io-v1beta1-opentelemetrycollector
port: {{ .Values.admissionWebhooks.servicePort }}
failurePolicy: Ignore
name: vopentelemetrycollectordeletebeta.kb.io
{{- if .Values.admissionWebhooks.namespaceSelector }}
namespaceSelector:
{{- toYaml .Values.admissionWebhooks.namespaceSelector | nindent 6 }}
{{- end }}
{{- if .Values.admissionWebhooks.objectSelector }}
objectSelector:
{{- toYaml .Values.admissionWebhooks.objectSelector | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- opentelemetry.io
apiVersions:
- v1beta1
operations:
- DELETE
resources:
- opentelemetrycollectors
scope: Namespaced
sideEffects: None
timeoutSeconds: {{ .Values.admissionWebhooks.timeoutSeconds }}
---
{{- $contextWithCaBundle := merge $ (dict "caBundle" $caCertEnc) }}
{{- tpl (.Files.Get "conf/crds/crd-opentelemetry.io_opampbridges.yaml") $contextWithCaBundle }}
---
{{- tpl (.Files.Get "conf/crds/crd-opentelemetrycollector.yaml") $contextWithCaBundle }}
---
{{- tpl (.Files.Get "conf/crds/crd-opentelemetryinstrumentation.yaml") $contextWithCaBundle }}
{{- else }}
{{- tpl (.Files.Get "conf/crds/crd-opentelemetry.io_opampbridges.yaml") . }}
---
{{- tpl (.Files.Get "conf/crds/crd-opentelemetrycollector.yaml") . }}
---
{{- tpl (.Files.Get "conf/crds/crd-opentelemetryinstrumentation.yaml") . }}
{{- end }}
@@ -0,0 +1,52 @@
{{- if and .Values.admissionWebhooks.create .Values.admissionWebhooks.certManager.enabled }}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
{{- if .Values.admissionWebhooks.certManager.certificateAnnotations }}
annotations:
{{- toYaml .Values.admissionWebhooks.certManager.certificateAnnotations | nindent 4 }}
{{- end }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: webhook
name: {{ template "opentelemetry-operator.webhookCertName" . }}
namespace: {{ .Release.Namespace }}
spec:
{{- if .Values.admissionWebhooks.certManager.duration }}
duration: {{ .Values.admissionWebhooks.certManager.duration }}
{{- end }}
{{- if .Values.admissionWebhooks.certManager.renewBefore }}
renewBefore: {{ .Values.admissionWebhooks.certManager.renewBefore }}
{{- end }}
dnsNames:
- {{ template "opentelemetry-operator.fullname" . }}-webhook.{{ .Release.Namespace }}.svc
- {{ template "opentelemetry-operator.fullname" . }}-webhook.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
issuerRef:
{{- if .Values.admissionWebhooks.certManager.issuerRef }}
{{- toYaml .Values.admissionWebhooks.certManager.issuerRef | nindent 4 }}
{{- else }}
kind: Issuer
name: {{ template "opentelemetry-operator.fullname" . }}-selfsigned-issuer
{{- end }}
secretName: {{ default (printf "%s-controller-manager-service-cert" (include "opentelemetry-operator.fullname" .)) .Values.admissionWebhooks.secretName }}
subject:
organizationalUnits:
- {{ template "opentelemetry-operator.fullname" . }}
{{- if not .Values.admissionWebhooks.certManager.issuerRef }}
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
{{- if .Values.admissionWebhooks.certManager.issuerAnnotations }}
annotations:
{{- toYaml .Values.admissionWebhooks.certManager.issuerAnnotations | nindent 4 }}
{{- end }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: webhook
name: {{ template "opentelemetry-operator.fullname" . }}-selfsigned-issuer
namespace: {{ .Release.Namespace }}
spec:
selfSigned: {}
{{- end }}
{{- end }}
@@ -0,0 +1,293 @@
{{- if .Values.clusterRole.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
name: {{ template "opentelemetry-operator.fullname" . }}-manager
rules:
- apiGroups:
- ""
resources:
- configmaps
- persistentvolumeclaims
- persistentvolumes
- pods
- serviceaccounts
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- statefulsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
- extensions
resources:
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
{{- if .Values.manager.createRbacPermissions }}
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterroles
- clusterrolebindings
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- nodes
- namespaces
verbs:
- get
- list
- watch
{{- end }}
- apiGroups:
- batch
resources:
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- config.openshift.io
resources:
- infrastructures
- infrastructures/status
verbs:
- get
- list
- watch
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- get
- list
- update
- apiGroups:
- monitoring.coreos.com
resources:
- podmonitors
- servicemonitors
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- instrumentations
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- opampbridges
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- opampbridges/finalizers
verbs:
- update
- apiGroups:
- opentelemetry.io
resources:
- opampbridges/status
verbs:
- get
- patch
- update
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors
verbs:
- get
- list
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors/finalizers
verbs:
- get
- patch
- update
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors/status
verbs:
- get
- patch
- update
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- route.openshift.io
resources:
- routes
- routes/custom-host
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
{{- if .Values.manager.featureGatesMap }}
{{- if ".Values.manager.featureGatesMap.operator.targetallocator.mtls" }}
- apiGroups:
- cert-manager.io
resources:
- issuers
- certificaterequests
- certificates
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
{{- end }}
{{- end }}
{{ if .Values.kubeRBACProxy.enabled }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
name: {{ template "opentelemetry-operator.fullname" . }}-metrics
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
name: {{ template "opentelemetry-operator.fullname" . }}-proxy
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
{{- end }}
{{ end }}
@@ -0,0 +1,36 @@
{{- if .Values.clusterRole.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
name: {{ template "opentelemetry-operator.fullname" . }}-manager
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "opentelemetry-operator.fullname" . }}-manager
subjects:
- kind: ServiceAccount
name: {{ template "opentelemetry-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{ if .Values.kubeRBACProxy.enabled }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
name: {{ template "opentelemetry-operator.fullname" . }}-proxy
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "opentelemetry-operator.fullname" . }}-proxy
subjects:
- kind: ServiceAccount
name: {{ template "opentelemetry-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{ end }}
@@ -0,0 +1,182 @@
apiVersion: apps/v1
kind: Deployment
metadata:
{{- with .Values.manager.deploymentAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
name: {{ template "opentelemetry-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "opentelemetry-operator.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: controller-manager
template:
metadata:
annotations:
{{- if .Values.manager.rolling }}
rollme: {{ randAlphaNum 5 | quote }}
{{- end }}
kubectl.kubernetes.io/default-container: manager
{{- if .Values.manager.podAnnotations }}
{{- include "opentelemetry-operator.podAnnotations" . | nindent 8 }}
{{- end }}
labels:
{{- include "opentelemetry-operator.selectorLabels" . | nindent 8 }}
{{- if .Values.manager.podLabels }}
{{- include "opentelemetry-operator.podLabels" . | nindent 8 }}
{{- end }}
app.kubernetes.io/component: controller-manager
spec:
hostNetwork: {{ .Values.hostNetwork }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName | quote }}
{{- end }}
containers:
- args:
- --metrics-addr=0.0.0.0:{{ .Values.manager.ports.metricsPort }}
{{- if .Values.manager.leaderElection.enabled }}
- --enable-leader-election
{{- end }}
- --health-probe-addr=:{{ .Values.manager.ports.healthzPort }}
{{- if or .Values.admissionWebhooks.create .Values.admissionWebhooks.secretName }}
- --webhook-port={{ .Values.manager.ports.webhookPort }}
{{- end }}
{{- if and .Values.manager.collectorImage.repository .Values.manager.collectorImage.tag }}
- --collector-image={{ .Values.manager.collectorImage.repository }}:{{ .Values.manager.collectorImage.tag }}
{{- end }}
{{- if and .Values.manager.opampBridgeImage.repository .Values.manager.opampBridgeImage.tag }}
- --operator-opamp-bridge-image={{ .Values.manager.opampBridgeImage.repository }}:{{ .Values.manager.opampBridgeImage.tag }}
{{- end }}
{{- if and .Values.manager.targetAllocatorImage.repository .Values.manager.targetAllocatorImage.tag }}
- --target-allocator-image={{ .Values.manager.targetAllocatorImage.repository }}:{{ .Values.manager.targetAllocatorImage.tag }}
{{- end }}
{{- if and .Values.manager.autoInstrumentationImage.java.repository .Values.manager.autoInstrumentationImage.java.tag }}
- --auto-instrumentation-java-image={{ .Values.manager.autoInstrumentationImage.java.repository }}:{{ .Values.manager.autoInstrumentationImage.java.tag }}
{{- end }}
{{- if and .Values.manager.autoInstrumentationImage.nodejs.repository .Values.manager.autoInstrumentationImage.nodejs.tag }}
- --auto-instrumentation-nodejs-image={{ .Values.manager.autoInstrumentationImage.nodejs.repository }}:{{ .Values.manager.autoInstrumentationImage.nodejs.tag }}
{{- end }}
{{- if and .Values.manager.autoInstrumentationImage.python.repository .Values.manager.autoInstrumentationImage.python.tag }}
- --auto-instrumentation-python-image={{ .Values.manager.autoInstrumentationImage.python.repository }}:{{ .Values.manager.autoInstrumentationImage.python.tag }}
{{- end }}
{{- if and .Values.manager.autoInstrumentationImage.dotnet.repository .Values.manager.autoInstrumentationImage.dotnet.tag }}
- --auto-instrumentation-dotnet-image={{ .Values.manager.autoInstrumentationImage.dotnet.repository }}:{{ .Values.manager.autoInstrumentationImage.dotnet.tag }}
{{- end }}
{{- if and .Values.manager.autoInstrumentationImage.go.repository .Values.manager.autoInstrumentationImage.go.tag }}
- --auto-instrumentation-go-image={{ .Values.manager.autoInstrumentationImage.go.repository }}:{{ .Values.manager.autoInstrumentationImage.go.tag }}
{{- end }}
{{- if and .Values.manager.autoInstrumentationImage.apacheHttpd.repository .Values.manager.autoInstrumentationImage.apacheHttpd.tag }}
- --auto-instrumentation-apache-httpd-image={{ .Values.manager.autoInstrumentationImage.apacheHttpd.repository }}:{{ .Values.manager.autoInstrumentationImage.apacheHttpd.tag }}
{{- end }}
{{- if .Values.manager.featureGatesMap }}
- --feature-gates={{ include "opentelemetry-operator.featureGatesMap" . }}
{{- else if ne .Values.manager.featureGates "" }}
- --feature-gates={{ .Values.manager.featureGates }}
{{- end }}
{{- if .Values.manager.extraArgs }}
{{- .Values.manager.extraArgs | toYaml | nindent 12 }}
{{- end }}
command:
- /manager
{{- if or .Values.manager.env .Values.manager.createRbacPermissions }}
env:
{{- if .Values.manager.env }}
{{- range $name, $value := .Values.manager.env }}
- name: {{ $name }}
value: {{ $value | quote -}}
{{- end }}
{{- end }}
{{- if .Values.manager.createRbacPermissions }}
- name: SERVICE_ACCOUNT_NAME
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
{{- end }}
{{- end }}
image: {{ include "opentelemetry-operator.image" . | quote }}
name: manager
ports:
- containerPort: {{ .Values.manager.ports.metricsPort }}
name: metrics
protocol: TCP
{{- if or .Values.admissionWebhooks.create .Values.admissionWebhooks.secretName }}
- containerPort: {{ .Values.manager.ports.webhookPort }}
name: webhook-server
protocol: TCP
{{- end }}
livenessProbe:
httpGet:
path: /healthz
port: {{ .Values.manager.ports.healthzPort }}
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: {{ .Values.manager.ports.healthzPort }}
initialDelaySeconds: 5
periodSeconds: 10
resources: {{ toYaml .Values.manager.resources | nindent 12 }}
{{- if or .Values.admissionWebhooks.create .Values.admissionWebhooks.secretName }}
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
{{- end }}
{{- with .Values.manager.securityContext }}
securityContext: {{ toYaml . | nindent 12 }}
{{- end }}
{{ if .Values.kubeRBACProxy.enabled }}
- args:
- --secure-listen-address=0.0.0.0:{{ .Values.kubeRBACProxy.ports.proxyPort }}
- --upstream=http://127.0.0.1:{{ .Values.manager.ports.metricsPort }}/
- --v=0
{{- if .Values.kubeRBACProxy.extraArgs }}
{{- .Values.kubeRBACProxy.extraArgs | toYaml | nindent 12 }}
{{- end }}
image: "{{ .Values.kubeRBACProxy.image.repository }}:{{ .Values.kubeRBACProxy.image.tag }}"
name: kube-rbac-proxy
ports:
- containerPort: {{ .Values.kubeRBACProxy.ports.proxyPort }}
name: https
protocol: TCP
{{- with .Values.kubeRBACProxy.resources }}
resources: {{ toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.kubeRBACProxy.securityContext }}
securityContext: {{ toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints: {{ toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "opentelemetry-operator.serviceAccountName" . }}
terminationGracePeriodSeconds: 10
{{- if or .Values.admissionWebhooks.create .Values.admissionWebhooks.secretName }}
volumes:
- name: cert
secret:
defaultMode: 420
secretName: {{ default (printf "%s-controller-manager-service-cert" (include "opentelemetry-operator.fullname" .)) .Values.admissionWebhooks.secretName }}
{{- end }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
@@ -0,0 +1,21 @@
{{- if .Values.pdb.create }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
name: {{ template "opentelemetry-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
{{- if .Values.pdb.minAvailable }}
minAvailable: {{ .Values.pdb.minAvailable }}
{{- end }}
{{- if .Values.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{- include "opentelemetry-operator.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: controller-manager
{{- end }}
@@ -0,0 +1,54 @@
{{- if and .Values.manager.prometheusRule.enabled .Values.manager.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ include "opentelemetry-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
{{- range $key, $value := .Values.manager.prometheusRule.extraLabels }}
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
{{- end }}
annotations:
{{- range $key, $value := .Values.manager.prometheusRule.annotations }}
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
{{- end }}
spec:
groups:
{{- if .Values.manager.prometheusRule.groups }}
{{- toYaml .Values.manager.prometheusRule.groups | nindent 4 }}
{{- end }}
{{- if .Values.manager.prometheusRule.defaultRules.enabled }}
- name: managerRules
rules:
- alert: ReconcileErrors
expr: rate(controller_runtime_reconcile_total{controller="opentelemetrycollector",result="error"}[5m]) > 0
for: 5m
labels:
severity: warning
{{- with .Values.manager.prometheusRule.defaultRules.additionalRuleLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
description: '{{`Reconciliation errors for {{ $labels.controller }} is increasing and has now reached {{ humanize $value }} `}}'
runbook_url: '{{ default "https://opentelemetry.io/docs/kubernetes/operator/troubleshooting/prometheus-alerts-runbooks/" .Values.manager.prometheusRule.runbookUrl }}#reconcileerrors'
{{- with .Values.manager.prometheusRule.defaultRules.additionalRuleAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
- alert: WorkqueueDepth
expr: workqueue_depth{name="opentelemetrycollector"} > 0
for: 5m
labels:
severity: warning
{{- with .Values.manager.prometheusRule.defaultRules.additionalRuleLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
description: '{{`Queue depth for {{ $labels.name }} has reached {{ $value }} `}}'
runbook_url: '{{ default "https://opentelemetry.io/docs/kubernetes/operator/troubleshooting/prometheus-alerts-runbooks/" .Values.manager.prometheusRule.runbookUrl }}#workqueuedepth'
{{- with .Values.manager.prometheusRule.defaultRules.additionalRuleAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,38 @@
{{- if and .Values.role.create .Values.manager.leaderElection.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
name: {{ template "opentelemetry-operator.fullname" . }}-leader-election
namespace: {{ .Release.Namespace }}
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- configmaps/status
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
{{- end }}
@@ -0,0 +1,18 @@
{{- if and .Values.role.create .Values.manager.leaderElection.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
name: {{ template "opentelemetry-operator.fullname" . }}-leader-election
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "opentelemetry-operator.fullname" . }}-leader-election
subjects:
- kind: ServiceAccount
name: {{ template "opentelemetry-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
@@ -0,0 +1,51 @@
apiVersion: v1
kind: Service
metadata:
{{- with .Values.manager.serviceAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
name: {{ template "opentelemetry-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
ports:
{{- if .Values.kubeRBACProxy.enabled }}
- name: https
port: {{ .Values.kubeRBACProxy.ports.proxyPort }}
protocol: TCP
targetPort: https
{{- end }}
- name: metrics
port: {{ .Values.manager.ports.metricsPort }}
protocol: TCP
targetPort: metrics
selector:
{{- include "opentelemetry-operator.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: controller-manager
{{- if or .Values.admissionWebhooks.create .Values.admissionWebhooks.secretName }}
---
apiVersion: v1
kind: Service
metadata:
{{- with .Values.admissionWebhooks.serviceAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
name: {{ template "opentelemetry-operator.fullname" . }}-webhook
namespace: {{ .Release.Namespace }}
spec:
ports:
- port: {{ .Values.admissionWebhooks.servicePort }}
protocol: TCP
targetPort: webhook-server
selector:
{{- include "opentelemetry-operator.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: controller-manager
{{- end }}
@@ -0,0 +1,16 @@
{{- if .Values.manager.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "opentelemetry-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
{{- if .Values.manager.serviceAccount.annotations }}
annotations:
{{- range $key, $value := .Values.manager.serviceAccount.annotations }}
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,37 @@
{{- if .Values.manager.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "opentelemetry-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
{{- range $key, $value := .Values.manager.serviceMonitor.extraLabels }}
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
{{- end }}
{{- if .Values.manager.serviceMonitor.annotations }}
annotations:
{{- range $key, $value := .Values.manager.serviceMonitor.annotations }}
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
{{- end }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "opentelemetry-operator.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: controller-manager
endpoints:
{{- toYaml .Values.manager.serviceMonitor.metricsEndpoints | nindent 4 }}
{{- with .Values.manager.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.manager.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
{{- end }}
@@ -0,0 +1,42 @@
{{- if and .Values.admissionWebhooks.create .Values.admissionWebhooks.certManager.enabled }}
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "opentelemetry-operator.fullname" . }}-cert-manager"
namespace: {{ .Release.Namespace }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: webhook
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: "{{ .Values.testFramework.image.repository }}:{{ .Values.testFramework.image.tag }}"
env:
- name: CERT_MANAGER_CLUSTERIP
value: "cert-manager-webhook"
- name: CERT_MANAGER_PORT
value: "443"
command:
- sh
- -c
# The following shell script tests if the cert-manager service is up. If the service is up, when we try
# to wget its exposed port, we will get an HTTP error 400.
- |
wget_output=$(wget -q "$CERT_MANAGER_CLUSTERIP:$CERT_MANAGER_PORT")
if wget_output=="wget: server returned error: HTTP/1.0 400 Bad Request"
then exit 0
else exit 1
fi
restartPolicy: Never
{{- with .Values.affinity }}
affinity: {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations: {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 4 }}
{{- end }}
{{- end }}
@@ -0,0 +1,84 @@
{{ if .Values.kubeRBACProxy.enabled }}
---
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "opentelemetry-operator.fullname" . }}-metrics"
namespace: {{ .Release.Namespace }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: "{{ .Values.testFramework.image.repository }}:{{ .Values.testFramework.image.tag }}"
env:
- name: MANAGER_METRICS_SERVICE_CLUSTERIP
value: "{{ include "opentelemetry-operator.fullname" . }}"
- name: MANAGER_METRICS_SERVICE_PORT
value: "{{ .Values.kubeRBACProxy.ports.proxyPort }}"
command:
- sh
- -c
# The following shell script tests if the controller-manager-metrics-service is up.
# If the service is up, when we try to wget its exposed port, we will get an HTTP error 400.
- |
wget_output=$(wget -q "$MANAGER_METRICS_SERVICE_CLUSTERIP:$MANAGER_METRICS_SERVICE_PORT")
if wget_output=="wget: server returned error: HTTP/1.0 400 Bad Request"
then exit 0
else exit 1
fi
restartPolicy: Never
{{- with .Values.affinity }}
affinity: {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations: {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 4 }}
{{- end }}
{{- end }}
---
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "opentelemetry-operator.fullname" . }}-webhook"
namespace: {{ .Release.Namespace }}
labels:
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: controller-manager
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: "{{ .Values.testFramework.image.repository }}:{{ .Values.testFramework.image.tag }}"
env:
- name: WEBHOOK_SERVICE_CLUSTERIP
value: "{{ include "opentelemetry-operator.fullname" . }}-webhook"
- name: WEBHOOK_SERVICE_PORT
value: "{{ .Values.admissionWebhooks.servicePort }}"
command:
- sh
- -c
# The following shell script tests if the webhook service is up. If the service is up, when we try
# to wget its exposed port, we will get an HTTP error 400.
- |
wget_output=$(wget -q "$WEBHOOK_SERVICE_CLUSTERIP:$WEBHOOK_SERVICE_PORT")
if wget_output=="wget: server returned error: HTTP/1.0 400 Bad Request"
then exit 0
else exit 1
fi
restartPolicy: Never
{{- with .Values.affinity }}
affinity: {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations: {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 4 }}
{{- end }}
@@ -0,0 +1,38 @@
{{- if and (.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1") (.Values.manager.verticalPodAutoscaler.enabled) }}
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: {{ template "opentelemetry-operator.fullname" . }}-operator
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "opentelemetry-operator.name" . }}-operator
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
spec:
resourcePolicy:
containerPolicies:
- containerName: manager
{{- if .Values.manager.verticalPodAutoscaler.controlledResources }}
controlledResources: {{ .Values.manager.verticalPodAutoscaler.controlledResources }}
{{- end }}
{{- if .Values.manager.verticalPodAutoscaler.maxAllowed }}
maxAllowed:
{{- toYaml .Values.manager.verticalPodAutoscaler.maxAllowed | nindent 8 }}
{{- end }}
{{- if .Values.manager.verticalPodAutoscaler.minAllowed }}
minAllowed:
{{- toYaml .Values.manager.verticalPodAutoscaler.minAllowed | nindent 8 }}
{{- end }}
targetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "opentelemetry-operator.fullname" . }}
{{- if .Values.manager.verticalPodAutoscaler.updatePolicy }}
updatePolicy:
{{- if .Values.manager.verticalPodAutoscaler.updatePolicy.updateMode }}
updateMode: {{ .Values.manager.verticalPodAutoscaler.updatePolicy.updateMode }}
{{- end }}
{{- if .Values.manager.verticalPodAutoscaler.updatePolicy.minReplicas }}
minReplicas: {{ .Values.manager.verticalPodAutoscaler.updatePolicy.minReplicas }}
{{- end }}
{{- end }}
{{- end }}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,339 @@
# Default values for opentelemetry-operator.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
## Provide a name in place of opentelemetry-operator (includes the chart's release name).
##
nameOverride: ""
## Fully override the name (excludes the chart's release name).
##
fullnameOverride: ""
## Reference one or more secrets to be used when pulling images from authenticated repositories.
imagePullSecrets: []
## Kubernetes cluster domain suffix
clusterDomain: cluster.local
# Common labels to add to all otel-operator resources. Evaluated as a template.
additionalLabels: {}
## Pod Disruption Budget configuration
##
pdb:
## Enable/disable a Pod Disruption Budget creation
##
create: false
## Minimum number/percentage of pods that should remain scheduled
##
minAvailable: 1
## Maximum number/percentage of pods that may be made unavailable
##
maxUnavailable: ""
## Provide OpenTelemetry Operator manager container image and resources.
##
manager:
image:
repository: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
tag: ""
collectorImage:
repository: ""
tag: 0.113.0
opampBridgeImage:
repository: ""
tag: ""
targetAllocatorImage:
repository: ""
tag: ""
autoInstrumentationImage:
java:
repository: ""
tag: ""
nodejs:
repository: ""
tag: ""
python:
repository: ""
tag: ""
dotnet:
repository: ""
tag: ""
apacheHttpd:
repository: ""
tag: ""
# The Go instrumentation support in the operator is disabled by default.
# To enable it, use the operator.autoinstrumentation.go feature gate.
go:
repository: ""
tag: ""
# Feature Gates are a comma-delimited list of feature gate identifiers.
# Prefix a gate with '-' to disable support.
# Prefixing a gate with '+' or no prefix will enable support.
# A full list of valid identifiers can be found here: https://github.com/open-telemetry/opentelemetry-operator/blob/main/pkg/featuregate/featuregate.go
# NOTE: the featureGates value is deprecated and will be replaced by featureGatesMap in the future.
featureGates: ""
# The featureGatesMap will enable or disable specific feature gates in the operator as well as deploy any prerequisites for the feature gate.
# If this property is not an empty map, the featureGates property will be ignored.
featureGatesMap: {}
# targetAllocatorMtls: false
# targetAllocatorCR: false
# nativeSideCarContainers: false
# prometheusOperator: false
# golangFlags: false
# collectorDefaultConfig: false
ports:
metricsPort: 8080
webhookPort: 9443
healthzPort: 8081
resources:
limits:
cpu: 100m
memory: 128Mi
# ephemeral-storage: 50Mi
requests:
cpu: 100m
memory: 64Mi
# ephemeral-storage: 50Mi
## Adds additional environment variables
## e.g ENV_VAR: env_value
env:
ENABLE_WEBHOOKS: "true"
# -- Create the manager ServiceAccount
serviceAccount:
create: true
annotations: {}
## Override the default name of the serviceaccount (the name of your installation)
name: ""
## Enable ServiceMonitor for Prometheus metrics scrape
serviceMonitor:
enabled: false
# additional labels on the ServiceMonitor
extraLabels: {}
# add annotations on the ServiceMonitor
annotations: {}
metricsEndpoints:
- port: metrics
# Used to set relabeling and metricRelabeling configs on the ServiceMonitor
# https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
relabelings: []
metricRelabelings: []
# Adds additional annotations to the manager Deployment
deploymentAnnotations: {}
# Adds additional annotations to the manager Service
serviceAnnotations: {}
podAnnotations: {}
podLabels: {}
prometheusRule:
enabled: false
groups: []
# Create default rules for monitoring the manager
defaultRules:
enabled: false
## Additional labels for PrometheusRule alerts
additionalRuleLabels: {}
## Additional annotations for PrometheusRule alerts
additionalRuleAnnotations: {}
# additional labels on the PrometheusRule object
extraLabels: {}
# add annotations on the PrometheusRule object
annotations: {}
# change the default runbook urls.
# the alert name will get appended at the end of the url as an anchor.
runbookUrl: ""
# Whether the operator should create RBAC permissions for collectors. See README.md for more information.
createRbacPermissions: false
## List of additional cli arguments to configure the manager
## for example: --labels, etc.
extraArgs: []
## Enable leader election mechanism for protecting against split brain if multiple operator pods/replicas are started.
## See more at https://docs.openshift.com/container-platform/4.10/operators/operator_sdk/osdk-leader-election.html
leaderElection:
enabled: true
# Enable vertical pod autoscaler support for the manager
verticalPodAutoscaler:
enabled: false
# List of resources that the vertical pod autoscaler can control. Defaults to cpu, memory and ephemeral-storage.
controlledResources: []
# Define the max allowed resources for the pod
maxAllowed: {}
# cpu: 200m
# memory: 100Mi
# ephemeral-storage: 50Mi
# Define the min allowed resources for the pod
minAllowed: {}
# cpu: 200m
# memory: 100Mi
# ephemeral-storage: 50Mi
updatePolicy:
# Specifies whether recommended updates are applied when a Pod is started and whether recommended updates
# are applied during the life of a Pod. Possible values are "Off", "Initial", "Recreate", and "Auto".
updateMode: Auto
# Minimal number of replicas which need to be alive for Updater to attempt pod eviction.
# Only positive values are allowed. The default is 2.
minReplicas: 2
# Enable manager pod automatically rolling
rolling: false
## Container specific securityContext
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
securityContext: {}
# allowPrivilegeEscalation: false
# capabilities:
# drop:
# - ALL
## Provide OpenTelemetry Operator kube-rbac-proxy container image.
##
kubeRBACProxy:
enabled: true
image:
repository: quay.io/brancz/kube-rbac-proxy
tag: v0.18.1
ports:
proxyPort: 8443
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 64Mi
## List of additional cli arguments to configure the kube-rbac-proxy
## for example: --tls-cipher-suites, --tls-min-version, etc.
extraArgs: []
## Container specific securityContext
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
securityContext: {}
# allowPrivilegeEscalation: false
# capabilities:
# drop:
# - ALL
## Admission webhooks make sure only requests with correctly formatted rules will get into the Operator.
## They also enable the sidecar injection for OpenTelemetryCollector and Instrumentation CR's
admissionWebhooks:
create: true
servicePort: 443
failurePolicy: Fail
secretName: ""
## Defines the sidecar injection logic in Pods.
## - Ignore, the injection is fail-open. The pod will be created, but the sidecar won't be injected.
## - Fail, the injection is fail-close. If the webhook pod is not ready, pods cannot be created.
pods:
failurePolicy: Ignore
## Adds a prefix to the mutating webhook name.
## This can be used to order this mutating webhook with all your cluster's mutating webhooks.
namePrefix: ""
## Customize webhook timeout duration
timeoutSeconds: 10
## Provide selectors for your objects
namespaceSelector: {}
objectSelector: {}
## https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-operator/README.md#tls-certificate-requirement
## TLS Certificate Option 1: Use certManager to generate self-signed certificate.
## certManager must be enabled. If enabled, always takes precedence over options 2 and 3.
certManager:
enabled: true
## Provide the issuer kind and name to do the cert auth job.
## By default, OpenTelemetry Operator will use self-signer issuer.
issuerRef: {}
# kind:
# name:
## Annotations for the cert and issuer if cert-manager is enabled.
certificateAnnotations: {}
issuerAnnotations: {}
# duration must be specified by a Go time.Duration (ending in s, m or h)
duration: ""
# renewBefore must be specified by a Go time.Duration (ending in s, m or h)
# Take care when setting the renewBefore field to be very close to the duration
# as this can lead to a renewal loop, where the Certificate is always in the renewal period.
renewBefore: ""
## TLS Certificate Option 2: Use Helm to automatically generate self-signed certificate.
## certManager must be disabled and autoGenerateCert must be enabled.
## If true and certManager.enabled is false, Helm will automatically create a self-signed cert and secret for you.
autoGenerateCert:
enabled: true
# If set to true, new webhook key/certificate is generated on helm upgrade.
recreate: true
# Cert period time in days. The default is 365 days.
certPeriodDays: 365
## TLS Certificate Option 3: Use your own self-signed certificate.
## certManager and autoGenerateCert must be disabled and certFile, keyFile, and caFile must be set.
## The chart reads the contents of the file paths with the helm .Files.Get function.
## Refer to this doc https://helm.sh/docs/chart_template_guide/accessing_files/ to understand
## limitations of file paths accessible to the chart.
## Path to your own PEM-encoded certificate.
certFile: ""
## Path to your own PEM-encoded private key.
keyFile: ""
## Path to the CA cert.
caFile: ""
# Adds additional annotations to the admissionWebhook Service
serviceAnnotations: {}
## Secret annotations
secretAnnotations: {}
## Secret labels
secretLabels: {}
## Install CRDS with the right webhook settings
## These are installed as templates, so they will clash with existing OpenTelemetry Operator CRDs in your cluster that are not already managed by the helm chart.
## See https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-operator/UPGRADING.md#0560-to-0570 for more details.
crds:
create: true
## Create the provided Roles and RoleBindings
##
role:
create: true
## Create the provided ClusterRoles and ClusterRoleBindings
##
clusterRole:
create: true
affinity: {}
tolerations: []
nodeSelector: {}
topologySpreadConstraints: []
hostNetwork: false
# Allows for pod scheduler prioritisation
priorityClassName: ""
## SecurityContext holds pod-level security attributes and common container settings.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
securityContext:
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65532
fsGroup: 65532
testFramework:
image:
repository: busybox
tag: latest