Skip to content

Commit

Permalink
Adding PodDNSConfig (open-telemetry#3077)
Browse files Browse the repository at this point in the history
* Adding PodDNSConfig

* Adding PodDNSConfig
  • Loading branch information
yuriolisa authored Jun 27, 2024
1 parent 9f5bc2c commit 5c6bf59
Show file tree
Hide file tree
Showing 27 changed files with 556 additions and 35 deletions.
16 changes: 16 additions & 0 deletions .chloggen/implement-dnsconfig.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: collector, target allocator, opamp

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Enabling PodDnsConfig for OpenTelemetry Collector, TargetAllocator and OpAMPBridge.

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

# (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:
2 changes: 2 additions & 0 deletions apis/v1alpha1/opampbridge_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ type OpAMPBridgeSpec struct {
// https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
// +optional
TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.
PodDNSConfig v1.PodDNSConfig `json:"podDnsConfig,omitempty"`
}

// OpAMPBridgeStatus defines the observed state of OpAMPBridge.
Expand Down
1 change: 1 addition & 0 deletions apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions apis/v1beta1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ type OpenTelemetryCommonFields struct {
//
// +optional
AdditionalContainers []v1.Container `json:"additionalContainers,omitempty"`
// PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.
PodDNSConfig v1.PodDNSConfig `json:"podDnsConfig,omitempty"`
}

type StatefulSetCommonFields struct {
Expand Down
1 change: 1 addition & 0 deletions apis/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions bundle/manifests/opentelemetry.io_opampbridges.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,29 @@ spec:
additionalProperties:
type: string
type: object
podDnsConfig:
properties:
nameservers:
items:
type: string
type: array
x-kubernetes-list-type: atomic
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
x-kubernetes-list-type: atomic
searches:
items:
type: string
type: array
x-kubernetes-list-type: atomic
type: object
podSecurityContext:
properties:
appArmorProfile:
Expand Down
23 changes: 23 additions & 0 deletions bundle/manifests/opentelemetry.io_opentelemetrycollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6928,6 +6928,29 @@ spec:
- type: string
x-kubernetes-int-or-string: true
type: object
podDnsConfig:
properties:
nameservers:
items:
type: string
type: array
x-kubernetes-list-type: atomic
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
x-kubernetes-list-type: atomic
searches:
items:
type: string
type: array
x-kubernetes-list-type: atomic
type: object
podSecurityContext:
properties:
appArmorProfile:
Expand Down
23 changes: 23 additions & 0 deletions config/crd/bases/opentelemetry.io_opampbridges.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,29 @@ spec:
additionalProperties:
type: string
type: object
podDnsConfig:
properties:
nameservers:
items:
type: string
type: array
x-kubernetes-list-type: atomic
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
x-kubernetes-list-type: atomic
searches:
items:
type: string
type: array
x-kubernetes-list-type: atomic
type: object
podSecurityContext:
properties:
appArmorProfile:
Expand Down
23 changes: 23 additions & 0 deletions config/crd/bases/opentelemetry.io_opentelemetrycollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6914,6 +6914,29 @@ spec:
- type: string
x-kubernetes-int-or-string: true
type: object
podDnsConfig:
properties:
nameservers:
items:
type: string
type: array
x-kubernetes-list-type: atomic
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
x-kubernetes-list-type: atomic
searches:
items:
type: string
type: array
x-kubernetes-list-type: atomic
type: object
podSecurityContext:
properties:
appArmorProfile:
Expand Down
23 changes: 23 additions & 0 deletions config/crd/bases/opentelemetry.io_targetallocators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2089,6 +2089,29 @@ spec:
- type: string
x-kubernetes-int-or-string: true
type: object
podDnsConfig:
properties:
nameservers:
items:
type: string
type: array
x-kubernetes-list-type: atomic
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
x-kubernetes-list-type: atomic
searches:
items:
type: string
type: array
x-kubernetes-list-type: atomic
type: object
podSecurityContext:
properties:
appArmorProfile:
Expand Down
8 changes: 8 additions & 0 deletions controllers/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ service:
},
ShareProcessNamespace: ptr.To(false),
DNSPolicy: "ClusterFirst",
DNSConfig: &corev1.PodDNSConfig{},
ServiceAccountName: "test-collector",
},
},
Expand Down Expand Up @@ -471,6 +472,7 @@ service:
},
ShareProcessNamespace: ptr.To(false),
DNSPolicy: "ClusterFirst",
DNSConfig: &corev1.PodDNSConfig{},
ServiceAccountName: "test-collector",
},
},
Expand Down Expand Up @@ -757,6 +759,7 @@ service:
},
ShareProcessNamespace: ptr.To(false),
DNSPolicy: "ClusterFirst",
DNSConfig: &corev1.PodDNSConfig{},
ServiceAccountName: "my-special-sa",
},
},
Expand Down Expand Up @@ -1005,6 +1008,7 @@ func TestBuildAll_OpAMPBridge(t *testing.T) {
},
},
DNSPolicy: "ClusterFirst",
DNSConfig: &corev1.PodDNSConfig{},
ServiceAccountName: "test-opamp-bridge",
},
},
Expand Down Expand Up @@ -1285,6 +1289,7 @@ service:
},
ShareProcessNamespace: ptr.To(false),
DNSPolicy: "ClusterFirst",
DNSConfig: &corev1.PodDNSConfig{},
ServiceAccountName: "test-collector",
},
},
Expand Down Expand Up @@ -1496,6 +1501,7 @@ prometheus_cr:
},
},
DNSPolicy: "ClusterFirst",
DNSConfig: &corev1.PodDNSConfig{},
ShareProcessNamespace: ptr.To(false),
ServiceAccountName: "test-targetallocator",
},
Expand Down Expand Up @@ -1679,6 +1685,7 @@ prometheus_cr:
},
ShareProcessNamespace: ptr.To(false),
DNSPolicy: "ClusterFirst",
DNSConfig: &corev1.PodDNSConfig{},
ServiceAccountName: "test-collector",
},
},
Expand Down Expand Up @@ -1890,6 +1897,7 @@ prometheus_cr:
},
},
DNSPolicy: "ClusterFirst",
DNSConfig: &corev1.PodDNSConfig{},
ShareProcessNamespace: ptr.To(false),
ServiceAccountName: "test-targetallocator",
},
Expand Down
Loading

0 comments on commit 5c6bf59

Please sign in to comment.