Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to set image pull policy for agent images #3675

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .chloggen/implement-image-pullpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'enhancement'

# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
component: auto-instrumentation

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add support to set image pull policy for agent images

# One or more tracking issues related to the change
issues: [3575]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
48 changes: 48 additions & 0 deletions apis/v1alpha1/instrumentation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ type InstrumentationSpec struct {
// Nginx defines configuration for Nginx auto-instrumentation.
// +optional
Nginx Nginx `json:"nginx,omitempty"`

// ImagePullPolicy
// One of Always, Never, IfNotPresent.
// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
// +optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

// Resource defines the configuration for the resource attributes, as defined by the OpenTelemetry specification.
Expand Down Expand Up @@ -183,6 +189,12 @@ type Java struct {
// All extensions are copied to a single directory; if a JAR with the same name exists, it will be overwritten.
// +optional
Extensions []Extensions `json:"extensions,omitempty"`

// ImagePullPolicy
// One of Always, Never, IfNotPresent.
// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
// +optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

type Extensions struct {
Expand Down Expand Up @@ -216,6 +228,12 @@ type NodeJS struct {
// Resources describes the compute resource requirements.
// +optional
Resources corev1.ResourceRequirements `json:"resourceRequirements,omitempty"`

// ImagePullPolicy
// One of Always, Never, IfNotPresent.
// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
// +optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

// Python defines Python SDK and instrumentation configuration.
Expand All @@ -241,6 +259,12 @@ type Python struct {
// Resources describes the compute resource requirements.
// +optional
Resources corev1.ResourceRequirements `json:"resourceRequirements,omitempty"`

// ImagePullPolicy
// One of Always, Never, IfNotPresent.
// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
// +optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

// DotNet defines DotNet SDK and instrumentation configuration.
Expand All @@ -265,6 +289,12 @@ type DotNet struct {
// Resources describes the compute resource requirements.
// +optional
Resources corev1.ResourceRequirements `json:"resourceRequirements,omitempty"`

// ImagePullPolicy
// One of Always, Never, IfNotPresent.
// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
// +optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

type Go struct {
Expand All @@ -289,6 +319,12 @@ type Go struct {
// Resources describes the compute resource requirements.
// +optional
Resources corev1.ResourceRequirements `json:"resourceRequirements,omitempty"`

// ImagePullPolicy
// One of Always, Never, IfNotPresent.
// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
// +optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

// ApacheHttpd defines Apache SDK and instrumentation configuration.
Expand Down Expand Up @@ -329,6 +365,12 @@ type ApacheHttpd struct {
// Resources describes the compute resource requirements.
// +optional
Resources corev1.ResourceRequirements `json:"resourceRequirements,omitempty"`

// ImagePullPolicy
// One of Always, Never, IfNotPresent.
// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
// +optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

// Nginx defines Nginx SDK and instrumentation configuration.
Expand Down Expand Up @@ -365,6 +407,12 @@ type Nginx struct {
// Resources describes the compute resource requirements.
// +optional
Resources corev1.ResourceRequirements `json:"resourceRequirements,omitempty"`

// ImagePullPolicy
// One of Always, Never, IfNotPresent.
// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
// +optional
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
}

// InstrumentationStatus defines status of the instrumentation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ metadata:
categories: Logging & Tracing,Monitoring
certified: "false"
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
createdAt: "2025-01-24T11:36:07Z"
createdAt: "2025-01-27T13:19:16Z"
description: Provides the OpenTelemetry components, including the Collector
operators.operatorframework.io/builder: operator-sdk-v1.29.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -411,6 +413,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -717,6 +721,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -869,6 +875,8 @@ spec:
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
imagePullPolicy:
type: string
java:
properties:
env:
Expand Down Expand Up @@ -951,6 +959,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resources:
properties:
claims:
Expand Down Expand Up @@ -1241,6 +1251,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -1463,6 +1475,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -1698,6 +1712,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ metadata:
categories: Logging & Tracing,Monitoring
certified: "false"
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
createdAt: "2025-01-24T11:36:07Z"
createdAt: "2025-01-27T13:19:16Z"
description: Provides the OpenTelemetry components, including the Collector
operators.operatorframework.io/builder: operator-sdk-v1.29.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -411,6 +413,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -717,6 +721,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -869,6 +875,8 @@ spec:
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
imagePullPolicy:
type: string
java:
properties:
env:
Expand Down Expand Up @@ -951,6 +959,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resources:
properties:
claims:
Expand Down Expand Up @@ -1241,6 +1251,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -1463,6 +1475,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -1698,6 +1712,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down
16 changes: 16 additions & 0 deletions config/crd/bases/opentelemetry.io_instrumentations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -409,6 +411,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -715,6 +719,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -867,6 +873,8 @@ spec:
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
imagePullPolicy:
type: string
java:
properties:
env:
Expand Down Expand Up @@ -949,6 +957,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resources:
properties:
claims:
Expand Down Expand Up @@ -1239,6 +1249,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -1461,6 +1473,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down Expand Up @@ -1696,6 +1710,8 @@ spec:
type: array
image:
type: string
imagePullPolicy:
type: string
resourceRequirements:
properties:
claims:
Expand Down
Loading
Loading