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

Adding PodDNSConfig #2712

Closed
wants to merge 12 commits into from
Closed
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/add-poddns.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. operator, target allocator, github action)
component: collector

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Added Pod DNSConfig

# 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: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ KUSTOMIZE_VERSION ?= v5.0.3
CONTROLLER_TOOLS_VERSION ?= v0.14.0
GOLANGCI_LINT_VERSION ?= v1.57.2
KIND_VERSION ?= v0.20.0
CHAINSAW_VERSION ?= v0.1.7
CHAINSAW_VERSION ?= v0.1.8

.PHONY: install-tools
install-tools: kustomize golangci-lint kind controller-gen envtest crdoc kind operator-sdk chainsaw
Expand Down
4 changes: 4 additions & 0 deletions apis/v1alpha1/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ func tov1beta1(in OpenTelemetryCollector) (v1beta1.OpenTelemetryCollector, error
PriorityClassName: copy.Spec.PriorityClassName,
InitContainers: copy.Spec.InitContainers,
AdditionalContainers: copy.Spec.AdditionalContainers,
PodDNSPolicy: copy.Spec.PodDNSPolicy,
PodDNSConfig: copy.Spec.PodDNSConfig,
},
TargetAllocator: tov1beta1TA(copy.Spec.TargetAllocator),
Mode: v1beta1.Mode(copy.Spec.Mode),
Expand Down Expand Up @@ -364,6 +366,8 @@ func tov1alpha1(in v1beta1.OpenTelemetryCollector) (*OpenTelemetryCollector, err
ConfigMaps: tov1alpha1ConfigMaps(copy.Spec.ConfigMaps),
UpdateStrategy: copy.Spec.DaemonSetUpdateStrategy,
DeploymentUpdateStrategy: copy.Spec.DeploymentUpdateStrategy,
PodDNSPolicy: copy.Spec.PodDNSPolicy,
PodDNSConfig: copy.Spec.PodDNSConfig,
},
}, nil
}
Expand Down
6 changes: 6 additions & 0 deletions apis/v1alpha1/opampbridge_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ type OpAMPBridgeSpec struct {
// https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
// +optional
TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
//PodDNSPolicy define the DNS policies which can be set on a per-Pod basis. Currently Kubernetes supports the following Pod-specific DNS policies.
//These policies are specified in the dnsPolicy field of a Pod Spec.
// +kubebuilder:default:=ClusterFirst
PodDNSPolicy v1.DNSPolicy `json:"podDnsPolicy,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
6 changes: 6 additions & 0 deletions apis/v1alpha1/opentelemetrycollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ type OpenTelemetryCollectorSpec struct {
// This is only applicable to Deployment mode.
// +optional
DeploymentUpdateStrategy appsv1.DeploymentStrategy `json:"deploymentUpdateStrategy,omitempty"`
//PodDNSPolicy define the DNS policies which can be set on a per-Pod basis. Currently Kubernetes supports the following Pod-specific DNS policies.
//These policies are specified in the dnsPolicy field of a Pod Spec.
// +kubebuilder:default:=ClusterFirst
PodDNSPolicy v1.DNSPolicy `json:"podDnsPolicy,omitempty"`
//PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.
PodDNSConfig v1.PodDNSConfig `json:"podDnsConfig,omitempty"`
}

// PortsSpec defines the OpenTelemetryCollector's container/service ports additional specifications.
Expand Down
2 changes: 2 additions & 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.

5 changes: 5 additions & 0 deletions apis/v1beta1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,9 @@ type OpenTelemetryCommonFields struct {
//
// +optional
AdditionalContainers []v1.Container `json:"additionalContainers,omitempty"`
//PodDNSPolicy define the DNS policies which can be set on a per-Pod basis. Currently Kubernetes supports the following Pod-specific DNS policies.
//These policies are specified in the dnsPolicy field of a Pod Spec.
PodDNSPolicy v1.DNSPolicy `json:"podDnsPolicy,omitempty"`
//PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.
PodDNSConfig v1.PodDNSConfig `json:"podDnsConfig,omitempty"`
}
6 changes: 6 additions & 0 deletions apis/v1beta1/opentelemetrycollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ type OpenTelemetryCollectorSpec struct {
// This is only applicable to Deployment mode.
// +optional
DeploymentUpdateStrategy appsv1.DeploymentStrategy `json:"deploymentUpdateStrategy,omitempty"`
//PodDNSPolicy define the DNS policies which can be set on a per-Pod basis. Currently Kubernetes supports the following Pod-specific DNS policies.
//These policies are specified in the dnsPolicy field of a Pod Spec.
// +kubebuilder:default:=ClusterFirst
PodDNSPolicy v1.DNSPolicy `json:"podDnsPolicy,omitempty"`
//PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.
PodDNSConfig v1.PodDNSConfig `json:"podDnsConfig,omitempty"`
}

// TargetAllocatorEmbedded defines the configuration for the Prometheus target allocator, embedded in the
Expand Down
2 changes: 2 additions & 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 @@ -562,6 +562,29 @@ spec:
additionalProperties:
type: string
type: object
podDnsConfig:
properties:
nameservers:
items:
type: string
type: array
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
items:
type: string
type: array
type: object
podDnsPolicy:
default: ClusterFirst
type: string
podSecurityContext:
properties:
fsGroup:
Expand Down
60 changes: 60 additions & 0 deletions bundle/manifests/opentelemetry.io_opentelemetrycollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2245,6 +2245,29 @@ spec:
- type: string
x-kubernetes-int-or-string: true
type: object
podDnsConfig:
properties:
nameservers:
items:
type: string
type: array
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
items:
type: string
type: array
type: object
podDnsPolicy:
default: ClusterFirst
type: string
podSecurityContext:
properties:
fsGroup:
Expand Down Expand Up @@ -6559,6 +6582,43 @@ spec:
- type: string
x-kubernetes-int-or-string: true
type: object
podDnsConfig:
properties:
nameservers:
allOf:
- items:
type: string
- items:
type: string
type: array
options:
allOf:
- items:
properties:
name:
type: string
value:
type: string
type: object
- items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
allOf:
- items:
type: string
- items:
type: string
type: array
type: object
podDnsPolicy:
default: ClusterFirst
type: string
podSecurityContext:
properties:
fsGroup:
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 @@ -559,6 +559,29 @@ spec:
additionalProperties:
type: string
type: object
podDnsConfig:
properties:
nameservers:
items:
type: string
type: array
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
items:
type: string
type: array
type: object
podDnsPolicy:
default: ClusterFirst
type: string
podSecurityContext:
properties:
fsGroup:
Expand Down
60 changes: 60 additions & 0 deletions config/crd/bases/opentelemetry.io_opentelemetrycollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2231,6 +2231,29 @@ spec:
- type: string
x-kubernetes-int-or-string: true
type: object
podDnsConfig:
properties:
nameservers:
items:
type: string
type: array
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
items:
type: string
type: array
type: object
podDnsPolicy:
default: ClusterFirst
type: string
podSecurityContext:
properties:
fsGroup:
Expand Down Expand Up @@ -6545,6 +6568,43 @@ spec:
- type: string
x-kubernetes-int-or-string: true
type: object
podDnsConfig:
properties:
nameservers:
allOf:
- items:
type: string
- items:
type: string
type: array
options:
allOf:
- items:
properties:
name:
type: string
value:
type: string
type: object
- items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
allOf:
- items:
type: string
- items:
type: string
type: array
type: object
podDnsPolicy:
default: ClusterFirst
type: string
podSecurityContext:
properties:
fsGroup:
Expand Down
22 changes: 22 additions & 0 deletions config/crd/bases/opentelemetry.io_targetallocators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2131,6 +2131,28 @@ spec:
- type: string
x-kubernetes-int-or-string: true
type: object
podDnsConfig:
properties:
nameservers:
items:
type: string
type: array
options:
items:
properties:
name:
type: string
value:
type: string
type: object
type: array
searches:
items:
type: string
type: array
type: object
podDnsPolicy:
type: string
podSecurityContext:
properties:
fsGroup:
Expand Down
Loading
Loading