Skip to content

Commit 3b0930f

Browse files
authored
Merge pull request #115 from mjudeikis/mjudeikis/extra.args
Add extraArgs API for ad-hoc configurations
2 parents 3923c22 + c022286 commit 3b0930f

File tree

15 files changed

+110
-0
lines changed

15 files changed

+110
-0
lines changed

config/crd/bases/operator.kcp.io_frontproxies.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,6 +1524,12 @@ spec:
15241524
Optional: ExternalHostname under which the FrontProxy can be reached. If empty, the RootShard's external hostname will be used only.
15251525
Deprecated: use spec.External for configuration of external access instead.
15261526
type: string
1527+
extraArgs:
1528+
description: 'Optional: ExtraArgs defines additional command line
1529+
arguments to pass to the front-proxy container.'
1530+
items:
1531+
type: string
1532+
type: array
15271533
image:
15281534
description: 'Optional: Image defines the image to use. Defaults to
15291535
the latest versioned image during the release of kcp-operator.'

config/crd/bases/operator.kcp.io_rootshards.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,12 @@ spec:
16821682
- hostname
16831683
- port
16841684
type: object
1685+
extraArgs:
1686+
description: 'Optional: ExtraArgs defines additional command line
1687+
arguments to pass to the shard container.'
1688+
items:
1689+
type: string
1690+
type: array
16851691
image:
16861692
description: ImageSpec defines settings for using a specific image
16871693
and overwriting the default images used.
@@ -3045,6 +3051,12 @@ spec:
30453051
type: object
30463052
type: object
30473053
type: object
3054+
extraArgs:
3055+
description: 'Optional: ExtraArgs defines additional command line
3056+
arguments to pass to the front-proxy container.'
3057+
items:
3058+
type: string
3059+
type: array
30483060
image:
30493061
description: 'Optional: Image allows to override the container
30503062
image used for this proxy.'

config/crd/bases/operator.kcp.io_shards.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,12 @@ spec:
15951595
required:
15961596
- endpoints
15971597
type: object
1598+
extraArgs:
1599+
description: 'Optional: ExtraArgs defines additional command line
1600+
arguments to pass to the shard container.'
1601+
items:
1602+
type: string
1603+
type: array
15981604
image:
15991605
description: ImageSpec defines settings for using a specific image
16001606
and overwriting the default images used.

internal/resources/frontproxy/deployment.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ func (r *reconciler) getArgs() []string {
246246
args = append(args, fmt.Sprintf("--authentication-pass-on-groups=%q", strings.Join(auth.PassOnGroups, ",")))
247247
}
248248
}
249+
if r.frontProxy.Spec.ExtraArgs != nil {
250+
args = append(args, r.frontProxy.Spec.ExtraArgs...)
251+
}
249252

250253
return args
251254
}

internal/resources/rootshard/deployment.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ func getArgs(rootShard *operatorv1alpha1.RootShard) []string {
192192
"--enable-leader-election=true",
193193
"--logging-format=json",
194194
}
195+
if rootShard.Spec.ExtraArgs != nil {
196+
args = append(args, rootShard.Spec.ExtraArgs...)
197+
}
195198

196199
return args
197200
}

internal/resources/shard/deployment.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ func getArgs(shard *operatorv1alpha1.Shard, rootShard *operatorv1alpha1.RootShar
203203
"--enable-leader-election=true",
204204
"--logging-format=json",
205205
}
206+
if shard.Spec.ExtraArgs != nil {
207+
args = append(args, shard.Spec.ExtraArgs...)
208+
}
206209

207210
return args
208211
}

sdk/apis/operator/v1alpha1/frontproxy_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ type FrontProxySpec struct {
6363
// It will NOT be used to configure the API server's own TLS certificate or any other component.
6464
// +optional
6565
CABundleSecretRef *corev1.LocalObjectReference `json:"caBundleSecretRef,omitempty"`
66+
67+
// Optional: ExtraArgs defines additional command line arguments to pass to the front-proxy container.
68+
ExtraArgs []string `json:"extraArgs,omitempty"`
6669
}
6770

6871
type AuthSpec struct {

sdk/apis/operator/v1alpha1/rootshard_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ type RootShardProxySpec struct {
5959
// CertificateTemplates allows to customize the properties on the generated
6060
// certificates for this front-proxy.
6161
CertificateTemplates CertificateTemplateMap `json:"certificateTemplates,omitempty"`
62+
63+
// Optional: ExtraArgs defines additional command line arguments to pass to the front-proxy container.
64+
ExtraArgs []string `json:"extraArgs,omitempty"`
6265
}
6366

6467
type ExternalConfig struct {

sdk/apis/operator/v1alpha1/shard_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ type CommonShardSpec struct {
7373
// It will NOT be used to configure the API server's own TLS certificate or any other component.
7474
// +optional
7575
CABundleSecretRef *corev1.LocalObjectReference `json:"caBundleSecretRef,omitempty"`
76+
77+
// Optional: ExtraArgs defines additional command line arguments to pass to the shard container.
78+
ExtraArgs []string `json:"extraArgs,omitempty"`
7679
}
7780

7881
type AuditSpec struct {

sdk/apis/operator/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)