@@ -11,11 +11,11 @@ spec:
11
11
machineInfrastructure :
12
12
ref :
13
13
kind : OpenStackMachineTemplate
14
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
14
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
15
15
name : {{ .Release.Name }}-{{ .Chart.Version }}-control-plane
16
16
infrastructure :
17
17
ref :
18
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
18
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
19
19
kind : OpenStackClusterTemplate
20
20
name : {{ .Release.Name }}-{{ .Chart.Version }}-cluster
21
21
workers :
29
29
name : {{ .Release.Name }}-{{ .Chart.Version }}
30
30
infrastructure :
31
31
ref :
32
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
32
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
33
33
kind : OpenStackMachineTemplate
34
34
name : {{ .Release.Name }}-{{ .Chart.Version }}
35
35
variables :
@@ -257,12 +257,61 @@ spec:
257
257
description : " CertSANs sets extra Subject Alternative Names for the API Server signing cert."
258
258
items :
259
259
type : string
260
+ - name : oidc_config
261
+ required : false
262
+ schema :
263
+ openAPIV3Schema :
264
+ type : object
265
+ properties :
266
+ client_id :
267
+ type : string
268
+ example : " kubectl"
269
+ description : " A client id that all tokens must be issued for."
270
+ issuer_url :
271
+ type : string
272
+ example : " https://dex.k8s.scs.community"
273
+ description : " URL of the provider that allows the API server to
274
+ discover public signing keys. Only URLs that use the https:// scheme are
275
+ accepted. This is typically the provider's discovery URL, changed to have an
276
+ empty path"
277
+ username_claim :
278
+ type : string
279
+ example : " preferred_username"
280
+ default : " sub"
281
+ description : " JWT claim to use as the user name. By default sub,
282
+ which is expected to be a unique identifier of the end user. Admins can choose
283
+ other claims, such as email or name, depending on their provider. However,
284
+ claims other than email will be prefixed with the issuer URL to prevent naming
285
+ clashes with other plugins."
286
+ groups_claim :
287
+ type : string
288
+ example : " groups"
289
+ default : " groups"
290
+ description : " JWT claim to use as the user's group. If the claim
291
+ is present it must be an array of strings."
292
+ username_prefix :
293
+ type : string
294
+ example : " oidc:"
295
+ default : " oidc:"
296
+ description : " Prefix prepended to username claims to prevent
297
+ clashes with existing names (such as system: users). For example, the value
298
+ oidc: will create usernames like oidc:jane.doe. If this flag isn't provided and
299
+ --oidc-username-claim is a value other than email the prefix defaults to (
300
+ Issuer URL )# where ( Issuer URL ) is the value of --oidc-issuer-url. The value
301
+ - can be used to disable all prefixing."
302
+ groups_prefix :
303
+ type : string
304
+ example : " oidc:"
305
+ default : " oidc:"
306
+ description : " Prefix prepended to group claims to prevent clashes
307
+ with existing names (such as system: groups). For example, the value oidc: will
308
+ create group names like oidc:engineering and oidc:infra."
260
309
patches :
261
310
- name : k8s_version
262
311
description : " Sets the openstack node image for workers and the controlplane to the cluster-api image with the version mentioned in spec.topology.version."
263
312
definitions :
264
313
- selector :
265
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
314
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
266
315
kind : OpenStackMachineTemplate
267
316
matchResources :
268
317
controlPlane : true
@@ -271,15 +320,15 @@ spec:
271
320
- {{ .Release.Name }}-{{ .Chart.Version }}
272
321
jsonPatches :
273
322
- op : add
274
- path : " /spec/template/spec/image"
323
+ path : " /spec/template/spec/image/filter/name "
275
324
valueFrom :
276
325
template : ubuntu-capi-image-{{ `{{ .builtin.cluster.topology.version }}` }}
277
326
- name : apiserver_loadbalancer_octavia-amphora
278
327
description : " Takes care of the patches that should be applied when variable apiserver_loadbalancer is set to octavia-amphora."
279
328
enabledIf : {{ `'{{ eq .apiserver_loadbalancer "octavia-amphora" }}'` }}
280
329
definitions :
281
330
- selector :
282
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
331
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
283
332
kind : OpenStackClusterTemplate
284
333
matchResources :
285
334
infrastructureCluster : true
@@ -295,7 +344,7 @@ spec:
295
344
enabledIf : {{ `'{{ eq .apiserver_loadbalancer "octavia-ovn" }}'` }}
296
345
definitions :
297
346
- selector :
298
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
347
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
299
348
kind : OpenStackClusterTemplate
300
349
matchResources :
301
350
infrastructureCluster : true
@@ -311,7 +360,7 @@ spec:
311
360
enabledIf : {{ `'{{ eq .apiserver_loadbalancer "kube-vip" }}'` }}
312
361
definitions :
313
362
- selector :
314
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
363
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
315
364
kind : OpenStackClusterTemplate
316
365
matchResources :
317
366
infrastructureCluster : true
@@ -329,7 +378,7 @@ spec:
329
378
valueFrom :
330
379
template : {{ `"{{ if .kube_vip_apiserver_public_ip }}{{.kube_vip_apiserver_public_ip}}{{else}}{{.kube_vip_apiserver_virtual_ip}}{{end}}"` }}
331
380
- selector :
332
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
381
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
333
382
kind : OpenStackMachineTemplate
334
383
matchResources :
335
384
controlPlane : true
@@ -443,7 +492,7 @@ spec:
443
492
enabledIf : {{ `'{{ ne .controller_flavor "" }}'` }}
444
493
definitions :
445
494
- selector :
446
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
495
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
447
496
kind : OpenStackMachineTemplate
448
497
matchResources :
449
498
controlPlane : true
@@ -457,7 +506,7 @@ spec:
457
506
enabledIf : {{ `'{{ ne .worker_flavor "" }}'` }}
458
507
definitions :
459
508
- selector :
460
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
509
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
461
510
kind : OpenStackMachineTemplate
462
511
matchResources :
463
512
controlPlane : false
@@ -474,7 +523,7 @@ spec:
474
523
enabledIf : {{ `"{{ if .controller_root_disk }}true{{end}}"` }}
475
524
definitions :
476
525
- selector :
477
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
526
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
478
527
kind : OpenStackMachineTemplate
479
528
matchResources :
480
529
controlPlane : true
@@ -489,7 +538,7 @@ spec:
489
538
enabledIf : {{ `"{{ if .worker_root_disk }}true{{end}}"` }}
490
539
definitions :
491
540
- selector :
492
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
541
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
493
542
kind : OpenStackMachineTemplate
494
543
matchResources :
495
544
controlPlane : false
@@ -507,21 +556,21 @@ spec:
507
556
enabledIf : {{ `'{{ ne .external_id "" }}'` }}
508
557
definitions :
509
558
- selector :
510
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
559
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
511
560
kind : OpenStackClusterTemplate
512
561
matchResources :
513
562
infrastructureCluster : true
514
563
jsonPatches :
515
564
- op : replace
516
- path : " /spec/template/spec/externalNetworkId "
565
+ path : " /spec/template/spec/externalNetwork/id "
517
566
valueFrom :
518
567
variable : external_id
519
568
- name : openstack_security_groups
520
569
description : " Sets the list of the openstack security groups for the worker and the controlplane instances."
521
570
enabledIf : {{ `"{{ if .openstack_security_groups }}true{{end}}"` }}
522
571
definitions :
523
572
- selector :
524
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
573
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
525
574
kind : OpenStackMachineTemplate
526
575
matchResources :
527
576
controlPlane : true
@@ -534,7 +583,7 @@ spec:
534
583
valueFrom :
535
584
template : {{ `"[ {{ range .openstack_security_groups }} { name: {{ . }}}, {{ end }} ]"` }}
536
585
- selector :
537
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
586
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
538
587
kind : OpenStackClusterTemplate
539
588
matchResources :
540
589
infrastructureCluster : true
@@ -547,17 +596,17 @@ spec:
547
596
enabledIf : {{ `'{{ ne .cloud_name "" }}'` }}
548
597
definitions :
549
598
- selector :
550
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
599
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
551
600
kind : OpenStackClusterTemplate
552
601
matchResources :
553
602
infrastructureCluster : true
554
603
jsonPatches :
555
604
- op : replace
556
- path : " /spec/template/spec/cloudName"
605
+ path : " /spec/template/spec/identityRef/ cloudName"
557
606
valueFrom :
558
607
variable : cloud_name
559
608
- selector :
560
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
609
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
561
610
kind : OpenStackMachineTemplate
562
611
matchResources :
563
612
controlPlane : true
@@ -566,15 +615,15 @@ spec:
566
615
- {{ .Release.Name }}-{{ .Chart.Version }}
567
616
jsonPatches :
568
617
- op : replace
569
- path : " /spec/template/spec/cloudName"
618
+ path : " /spec/template/spec/identityRef/ cloudName"
570
619
valueFrom :
571
620
variable : cloud_name
572
621
- name : secret_name
573
622
description : " Sets the name of the clouds secret."
574
623
enabledIf : {{ `'{{ ne .secret_name "" }}'` }}
575
624
definitions :
576
625
- selector :
577
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
626
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
578
627
kind : OpenStackClusterTemplate
579
628
matchResources :
580
629
infrastructureCluster : true
@@ -584,7 +633,7 @@ spec:
584
633
valueFrom :
585
634
variable : secret_name
586
635
- selector :
587
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
636
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
588
637
kind : OpenStackMachineTemplate
589
638
matchResources :
590
639
controlPlane : true
@@ -601,7 +650,7 @@ spec:
601
650
enabledIf : {{ `'{{ ne .controller_server_group_id "" }}'` }}
602
651
definitions :
603
652
- selector :
604
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
653
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
605
654
kind : OpenStackMachineTemplate
606
655
matchResources :
607
656
controlPlane : true
@@ -615,7 +664,7 @@ spec:
615
664
enabledIf : {{ `'{{ ne .worker_server_group_id "" }}'` }}
616
665
definitions :
617
666
- selector :
618
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
667
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
619
668
kind : OpenStackMachineTemplate
620
669
matchResources :
621
670
controlPlane : false
@@ -632,7 +681,7 @@ spec:
632
681
enabledIf : {{ `'{{ ne .ssh_key "" }}'` }}
633
682
definitions :
634
683
- selector :
635
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
684
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
636
685
kind : OpenStackMachineTemplate
637
686
matchResources :
638
687
controlPlane : true
@@ -658,31 +707,56 @@ spec:
658
707
path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/certSANs"
659
708
valueFrom :
660
709
variable : certSANs
661
- - name : dns_nameservers
662
- description : " Sets the list of nameservers for the OpenStack Subnet being created ."
663
- enabledIf : {{ `"{{ if and .dns_nameservers (ne .apiserver_loadbalancer \"kube-vip\") }}true{{end}}"` }}
710
+ - name : oidc_config
711
+ description : " Configure API Server to use external authentication service ."
712
+ enabledIf : {{ `"{{ if and .oidc_config .oidc_config.client_id .oidc_config.issuer_url }}true{{end}}"` }}
664
713
definitions :
665
714
- selector :
666
- apiVersion : infrastructure .cluster.x-k8s.io/v1alpha7
667
- kind : OpenStackClusterTemplate
715
+ apiVersion : controlplane .cluster.x-k8s.io/v1beta1
716
+ kind : KubeadmControlPlaneTemplate
668
717
matchResources :
669
- infrastructureCluster : true
718
+ controlPlane : true
670
719
jsonPatches :
671
720
- op : add
672
- path : " /spec/template/spec/dnsNameservers"
721
+ path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/oidc-client-id"
722
+ valueFrom :
723
+ variable : oidc_config.client_id
724
+ - op : add
725
+ path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/oidc-issuer-url"
673
726
valueFrom :
674
- variable : dns_nameservers
675
- - name : node_cidr
727
+ variable : oidc_config.issuer_url
728
+ - op : add
729
+ path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/oidc-username-claim"
730
+ valueFrom :
731
+ variable : oidc_config.username_claim
732
+ - op : add
733
+ path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/oidc-groups-claim"
734
+ valueFrom :
735
+ variable : oidc_config.groups_claim
736
+ - op : add
737
+ path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/oidc-username-prefix"
738
+ valueFrom :
739
+ variable : oidc_config.username_prefix
740
+ - op : add
741
+ path : " /spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/oidc-groups-prefix"
742
+ valueFrom :
743
+ variable : oidc_config.groups_prefix
744
+ - name : subnet
676
745
description : " Sets the NodeCIDR for the OpenStack Subnet to be created. Cluster actuator will create a network, a subnet with NodeCIDR, and a router connected to this subnet."
677
746
enabledIf : {{ `"{{ if and .node_cidr (ne .apiserver_loadbalancer \"kube-vip\")}}true{{end}}"` }}
678
747
definitions :
679
748
- selector :
680
- apiVersion : infrastructure.cluster.x-k8s.io/v1alpha7
749
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
681
750
kind : OpenStackClusterTemplate
682
751
matchResources :
683
752
infrastructureCluster : true
684
753
jsonPatches :
685
754
- op : add
686
- path : " /spec/template/spec/nodeCidr "
755
+ path : " /spec/template/spec/managedSubnets "
687
756
valueFrom :
688
- variable : node_cidr
757
+ template : |
758
+ - cidr: '{{"{{"}} .node_cidr {{"}}"}}'
759
+ dnsNameservers:
760
+ {{`{{- range .dns_nameservers }}`}}
761
+ - {{`{{ . }}`}}
762
+ {{`{{- end }}`}}
0 commit comments