Skip to content

Commit c6ce360

Browse files
committed
deploy HelmRelease for external-dns
1 parent c3ebee8 commit c6ce360

File tree

10 files changed

+239
-88
lines changed

10 files changed

+239
-88
lines changed

api/crds/manifests/dns.openmcp.cloud_dnsserviceconfigs.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ spec:
5353
description: ExternalDNSPurposeConfig holds a purpose selector and
5454
the DNS configuration to apply if the selector matches.
5555
properties:
56-
config:
56+
helmReleaseReconciliationInterval:
57+
description: |-
58+
HelmReleaseReconciliationInterval is the interval at which the HelmRelease for external-dns is reconciled.
59+
If not set, the global HelmReleaseReconciliationInterval is used.
60+
type: string
61+
helmValues:
5762
description: HelmValues are the helm values to deploy external-dns
5863
with, if the purpose selector matches.
5964
name:
@@ -82,7 +87,7 @@ spec:
8287
rule: size(self.filter(property, size(self[property]) > 0))
8388
== 1
8489
required:
85-
- config
90+
- helmValues
8691
type: object
8792
type: array
8893
externalDNSSource:
@@ -653,6 +658,12 @@ spec:
653658
- message: Exactly one of 'helm', 'git', or 'oci' must be set
654659
rule: size(self.filter(property, (property != "copyAuthSecret")
655660
&& (size(self[property]) > 0))) == 1
661+
helmReleaseReconciliationInterval:
662+
description: |-
663+
HelmReleaseReconciliationInterval is the interval at which the HelmRelease for external-dns is reconciled.
664+
The value can be overwritten for specific purposes using ExternalDNSForPurposes.
665+
If not set, a default of 1h is used.
666+
type: string
656667
selector:
657668
description: |-
658669
Selector is a label selector.

api/dns/v1alpha1/config_types.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package v1alpha1
33
import (
44
"slices"
55

6+
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
67
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
7-
"k8s.io/apimachinery/pkg/runtime"
88

99
fluxv1 "github.com/fluxcd/source-controller/api/v1"
1010

@@ -21,6 +21,12 @@ type DNSServiceConfigSpec struct {
2121
// ExternalDNSSource is the source of the external-dns helm chart.
2222
ExternalDNSSource ExternalDNSSource `json:"externalDNSSource"`
2323

24+
// HelmReleaseReconciliationInterval is the interval at which the HelmRelease for external-dns is reconciled.
25+
// The value can be overwritten for specific purposes using ExternalDNSForPurposes.
26+
// If not set, a default of 1h is used.
27+
// +optional
28+
HelmReleaseReconciliationInterval *metav1.Duration `json:"helmReleaseReconciliationInterval,omitempty"`
29+
2430
// ExternalDNSForPurposes is a list of DNS configurations in combination with purpose selectors.
2531
// The first matching purpose selector will be applied to the Cluster.
2632
// If no selector matches, no configuration will be applied.
@@ -52,13 +58,20 @@ type ExternalDNSPurposeConfig struct {
5258
// It can be set to more easily identify the configuration in logs and events.
5359
// +optional
5460
Name string `json:"name,omitempty"`
61+
5562
// PurposeSelector is a selector to match against the list of purposes of a Cluster.
5663
// If not set, all Clusters are matched.
5764
// +optional
5865
PurposeSelector *PurposeSelector `json:"purposeSelector,omitempty"`
66+
67+
// HelmReleaseReconciliationInterval is the interval at which the HelmRelease for external-dns is reconciled.
68+
// If not set, the global HelmReleaseReconciliationInterval is used.
69+
// +optional
70+
HelmReleaseReconciliationInterval *metav1.Duration `json:"helmReleaseReconciliationInterval,omitempty"`
71+
5972
// HelmValues are the helm values to deploy external-dns with, if the purpose selector matches.
6073
// +kubebuilder:validation:Schemaless
61-
HelmValues runtime.RawExtension `json:"config"`
74+
HelmValues *apiextensionsv1.JSON `json:"helmValues"`
6275
}
6376

6477
// PurposeSelector is a selector to match against the list of purposes of a Cluster.

api/dns/v1alpha1/zz_generated.deepcopy.go

Lines changed: 17 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/openmcp-project/platform-service-dns/api
33
go 1.25.1
44

55
require (
6+
github.com/fluxcd/helm-controller/api v1.3.0
67
github.com/fluxcd/source-controller/api v1.6.2
78
github.com/openmcp-project/openmcp-operator/api v0.14.0
89
k8s.io/apiextensions-apiserver v0.34.0
@@ -13,12 +14,12 @@ require (
1314

1415
require (
1516
github.com/fluxcd/pkg/apis/acl v0.7.0 // indirect
17+
github.com/fluxcd/pkg/apis/kustomize v1.10.0 // indirect
1618
github.com/fluxcd/pkg/apis/meta v1.12.0 // indirect
1719
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
1820
github.com/go-logr/logr v1.4.3 // indirect
1921
github.com/gogo/protobuf v1.3.2 // indirect
2022
github.com/json-iterator/go v1.1.12 // indirect
21-
github.com/kr/text v0.2.0 // indirect
2223
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
2324
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
2425
github.com/x448/float16 v0.8.4 // indirect

api/go.sum

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
21
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
32
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
43
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
54
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5+
github.com/fluxcd/helm-controller/api v1.3.0 h1:PupXPuQbksmU0g2Lc6NjIYal2HJGL+6xohsf82eGVjo=
6+
github.com/fluxcd/helm-controller/api v1.3.0/go.mod h1:4b8PfdH0e/9Pfol2ogdMYbQ1nLjcVu9gAv27cQzIPK4=
67
github.com/fluxcd/pkg/apis/acl v0.7.0 h1:dMhZJH+g6ZRPjs4zVOAN9vHBd1DcavFgcIFkg5ooOE0=
78
github.com/fluxcd/pkg/apis/acl v0.7.0/go.mod h1:uv7pXXR/gydiX4MUwlQa7vS8JONEDztynnjTvY3JxKQ=
9+
github.com/fluxcd/pkg/apis/kustomize v1.10.0 h1:47EeSzkQvlQZdH92vHMe2lK2iR8aOSEJq95avw5idts=
10+
github.com/fluxcd/pkg/apis/kustomize v1.10.0/go.mod h1:UsqMV4sqNa1Yg0pmTsdkHRJr7bafBOENIJoAN+3ezaQ=
811
github.com/fluxcd/pkg/apis/meta v1.12.0 h1:XW15TKZieC2b7MN8VS85stqZJOx+/b8jATQ/xTUhVYg=
912
github.com/fluxcd/pkg/apis/meta v1.12.0/go.mod h1:+son1Va60x2eiDcTwd7lcctbI6C+K3gM7R+ULmEq1SI=
1013
github.com/fluxcd/source-controller/api v1.6.2 h1:UmodAeqLIeF29HdTqf2GiacZyO+hJydJlepDaYsMvhc=

api/install/install.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import (
66
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
77
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
88

9+
fluxhelmv2 "github.com/fluxcd/helm-controller/api/v2"
10+
fluxsourcev1 "github.com/fluxcd/source-controller/api/v1"
11+
912
dnsv1alpha1 "github.com/openmcp-project/platform-service-dns/api/dns/v1alpha1"
1013
)
1114

@@ -21,6 +24,8 @@ func InstallCRDAPIs(scheme *runtime.Scheme) *runtime.Scheme {
2124
func InstallOperatorAPIsPlatform(scheme *runtime.Scheme) *runtime.Scheme {
2225
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
2326
utilruntime.Must(dnsv1alpha1.AddToScheme(scheme))
27+
utilruntime.Must(fluxsourcev1.AddToScheme(scheme))
28+
utilruntime.Must(fluxhelmv2.AddToScheme(scheme))
2429

2530
return scheme
2631
}

cmd/platform-service-dns/app/run.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import (
1717
"sigs.k8s.io/controller-runtime/pkg/webhook"
1818

1919
"github.com/openmcp-project/controller-utils/pkg/logging"
20+
21+
providerscheme "github.com/openmcp-project/platform-service-dns/api/install"
2022
)
2123

2224
var setupLog logging.Logger
@@ -184,10 +186,9 @@ func (o *RunOptions) Complete(ctx context.Context) error {
184186
}
185187

186188
func (o *RunOptions) Run(ctx context.Context) error {
187-
// TODO: CRDs required?
188-
// if err := o.PlatformCluster.InitializeClient(providerscheme.InstallProviderAPIs(runtime.NewScheme())); err != nil {
189-
// return err
190-
// }
189+
if err := o.PlatformCluster.InitializeClient(providerscheme.InstallOperatorAPIsPlatform(runtime.NewScheme())); err != nil {
190+
return err
191+
}
191192

192193
setupLog = o.Log.WithName("setup")
193194
setupLog.Info("Environment", "value", o.Environment)

go.mod

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ go 1.25.1
55
replace github.com/openmcp-project/platform-service-dns/api => ./api
66

77
require (
8+
github.com/fluxcd/helm-controller/api v1.3.0
9+
github.com/fluxcd/pkg/apis/meta v1.12.0
810
github.com/fluxcd/source-controller/api v1.6.2
9-
github.com/openmcp-project/controller-utils v0.19.0
11+
github.com/openmcp-project/controller-utils v0.21.1-0.20250916143313-911636c58c14
1012
github.com/openmcp-project/openmcp-operator/api v0.14.0
1113
github.com/openmcp-project/openmcp-operator/lib v0.14.1-0.20250910074108-2166b543cee3
1214
github.com/openmcp-project/platform-service-dns/api v0.0.0-00010101000000-000000000000
1315
github.com/spf13/cobra v1.9.1
14-
k8s.io/api v0.34.0
15-
k8s.io/apimachinery v0.34.0
16-
k8s.io/client-go v0.34.0
16+
k8s.io/api v0.34.1
17+
k8s.io/apimachinery v0.34.1
18+
k8s.io/client-go v0.34.1
1719
sigs.k8s.io/controller-runtime v0.22.1
1820
sigs.k8s.io/yaml v1.6.0
1921
)
@@ -30,7 +32,7 @@ require (
3032
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
3133
github.com/felixge/httpsnoop v1.0.4 // indirect
3234
github.com/fluxcd/pkg/apis/acl v0.7.0 // indirect
33-
github.com/fluxcd/pkg/apis/meta v1.12.0 // indirect
35+
github.com/fluxcd/pkg/apis/kustomize v1.12.0 // indirect
3436
github.com/fsnotify/fsnotify v1.9.0 // indirect
3537
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
3638
github.com/go-logr/logr v1.4.3 // indirect
@@ -59,7 +61,7 @@ require (
5961
github.com/prometheus/client_model v0.6.1 // indirect
6062
github.com/prometheus/common v0.62.0 // indirect
6163
github.com/prometheus/procfs v0.15.1 // indirect
62-
github.com/spf13/pflag v1.0.9 // indirect
64+
github.com/spf13/pflag v1.0.10 // indirect
6365
github.com/stoewer/go-strcase v1.3.0 // indirect
6466
github.com/x448/float16 v0.8.4 // indirect
6567
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
@@ -75,13 +77,13 @@ require (
7577
go.uber.org/zap v1.27.0 // indirect
7678
go.yaml.in/yaml/v2 v2.4.2 // indirect
7779
go.yaml.in/yaml/v3 v3.0.4 // indirect
78-
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b // indirect
79-
golang.org/x/net v0.43.0 // indirect
80+
golang.org/x/exp v0.0.0-20250911091902-df9299821621 // indirect
81+
golang.org/x/net v0.44.0 // indirect
8082
golang.org/x/oauth2 v0.27.0 // indirect
81-
golang.org/x/sync v0.16.0 // indirect
82-
golang.org/x/sys v0.35.0 // indirect
83-
golang.org/x/term v0.34.0 // indirect
84-
golang.org/x/text v0.28.0 // indirect
83+
golang.org/x/sync v0.17.0 // indirect
84+
golang.org/x/sys v0.36.0 // indirect
85+
golang.org/x/term v0.35.0 // indirect
86+
golang.org/x/text v0.29.0 // indirect
8587
golang.org/x/time v0.10.0 // indirect
8688
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
8789
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
@@ -91,9 +93,9 @@ require (
9193
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
9294
gopkg.in/inf.v0 v0.9.1 // indirect
9395
gopkg.in/yaml.v3 v3.0.1 // indirect
94-
k8s.io/apiextensions-apiserver v0.34.0 // indirect
95-
k8s.io/apiserver v0.34.0 // indirect
96-
k8s.io/component-base v0.34.0 // indirect
96+
k8s.io/apiextensions-apiserver v0.34.1 // indirect
97+
k8s.io/apiserver v0.34.1 // indirect
98+
k8s.io/component-base v0.34.1 // indirect
9799
k8s.io/klog/v2 v2.130.1 // indirect
98100
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
99101
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d // indirect

0 commit comments

Comments
 (0)