Skip to content

Commit 9f72a53

Browse files
Implement product image selection (#482)
# Description For stackabletech/operator-rs#470 Reference implementation of stackabletech/operator-rs#476 Co-authored-by: Malte Sander <[email protected]> Co-authored-by: Malte Sander <[email protected]>
1 parent 9f7cdd2 commit 9f72a53

File tree

24 files changed

+309
-130
lines changed

24 files changed

+309
-130
lines changed

.readme/partials/main.md.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ kind: KafkaCluster
2727
metadata:
2828
name: simple-kafka
2929
spec:
30-
version: 3.2.0-stackable0.2.0
30+
image:
31+
productVersion: 3.3.1
32+
stackableVersion: 0.2.0
3133
zookeeperConfigMapName: simple-kafka-znode
3234
config:
3335
tls: null

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ All notable changes to this project will be documented in this file.
99
- Updated stackable image versions ([#513]).
1010
- operator-rs: 0.26.0 -> 0.27.1 ([#519]).
1111
- Don't run init container as root and avoid chmod and chowning ([#524]).
12+
- [BREAKING] Use Product image selection instead of version. `spec.version` has been replaced by `spec.image` ([#482]).
1213

14+
[#482]: https://github.com/stackabletech/kafka-operator/pull/482
1315
[#513]: https://github.com/stackabletech/kafka-operator/pull/513
1416
[#519]: https://github.com/stackabletech/kafka-operator/pull/519
1517
[#524]: https://github.com/stackabletech/kafka-operator/pull/524

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ kind: KafkaCluster
4747
metadata:
4848
name: simple-kafka
4949
spec:
50-
version: 3.2.0-stackable0.2.0
50+
image:
51+
productVersion: 3.3.1
52+
stackableVersion: 0.2.0
5153
zookeeperConfigMapName: simple-kafka-znode
5254
config:
5355
tls: null

deploy/crd/kafkacluster.crd.yaml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,48 @@ spec:
562562
- secretClass
563563
type: object
564564
type: object
565+
image:
566+
anyOf:
567+
- required:
568+
- custom
569+
- productVersion
570+
- required:
571+
- productVersion
572+
- stackableVersion
573+
properties:
574+
custom:
575+
description: Overwrite the docker image. Specify the full docker image name, e.g. `docker.stackable.tech/stackable/superset:1.4.1-stackable2.1.0`
576+
type: string
577+
productVersion:
578+
description: Version of the product, e.g. `1.4.1`.
579+
type: string
580+
pullPolicy:
581+
default: IfNotPresent
582+
description: '[Pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) used when pulling the Images'
583+
enum:
584+
- IfNotPresent
585+
- Always
586+
- Never
587+
type: string
588+
pullSecrets:
589+
description: '[Image pull secrets](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) to pull images from a private registry'
590+
items:
591+
description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.
592+
properties:
593+
name:
594+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
595+
type: string
596+
type: object
597+
nullable: true
598+
type: array
599+
repo:
600+
description: Name of the docker repo, e.g. `docker.stackable.tech/stackable`
601+
nullable: true
602+
type: string
603+
stackableVersion:
604+
description: Stackable version of the product, e.g. 2.1.0
605+
type: string
606+
type: object
565607
log4j:
566608
nullable: true
567609
type: string
@@ -579,12 +621,10 @@ spec:
579621
stopped:
580622
nullable: true
581623
type: boolean
582-
version:
583-
nullable: true
584-
type: string
585624
zookeeperConfigMapName:
586625
type: string
587626
required:
627+
- image
588628
- zookeeperConfigMapName
589629
type: object
590630
required:

deploy/helm/kafka-operator/crds/crds.yaml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,48 @@ spec:
564564
- secretClass
565565
type: object
566566
type: object
567+
image:
568+
anyOf:
569+
- required:
570+
- custom
571+
- productVersion
572+
- required:
573+
- productVersion
574+
- stackableVersion
575+
properties:
576+
custom:
577+
description: Overwrite the docker image. Specify the full docker image name, e.g. `docker.stackable.tech/stackable/superset:1.4.1-stackable2.1.0`
578+
type: string
579+
productVersion:
580+
description: Version of the product, e.g. `1.4.1`.
581+
type: string
582+
pullPolicy:
583+
default: IfNotPresent
584+
description: '[Pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) used when pulling the Images'
585+
enum:
586+
- IfNotPresent
587+
- Always
588+
- Never
589+
type: string
590+
pullSecrets:
591+
description: '[Image pull secrets](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) to pull images from a private registry'
592+
items:
593+
description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.
594+
properties:
595+
name:
596+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
597+
type: string
598+
type: object
599+
nullable: true
600+
type: array
601+
repo:
602+
description: Name of the docker repo, e.g. `docker.stackable.tech/stackable`
603+
nullable: true
604+
type: string
605+
stackableVersion:
606+
description: Stackable version of the product, e.g. 2.1.0
607+
type: string
608+
type: object
567609
log4j:
568610
nullable: true
569611
type: string
@@ -581,12 +623,10 @@ spec:
581623
stopped:
582624
nullable: true
583625
type: boolean
584-
version:
585-
nullable: true
586-
type: string
587626
zookeeperConfigMapName:
588627
type: string
589628
required:
629+
- image
590630
- zookeeperConfigMapName
591631
type: object
592632
required:

deploy/manifests/crds.yaml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,48 @@ spec:
565565
- secretClass
566566
type: object
567567
type: object
568+
image:
569+
anyOf:
570+
- required:
571+
- custom
572+
- productVersion
573+
- required:
574+
- productVersion
575+
- stackableVersion
576+
properties:
577+
custom:
578+
description: Overwrite the docker image. Specify the full docker image name, e.g. `docker.stackable.tech/stackable/superset:1.4.1-stackable2.1.0`
579+
type: string
580+
productVersion:
581+
description: Version of the product, e.g. `1.4.1`.
582+
type: string
583+
pullPolicy:
584+
default: IfNotPresent
585+
description: '[Pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) used when pulling the Images'
586+
enum:
587+
- IfNotPresent
588+
- Always
589+
- Never
590+
type: string
591+
pullSecrets:
592+
description: '[Image pull secrets](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) to pull images from a private registry'
593+
items:
594+
description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.
595+
properties:
596+
name:
597+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
598+
type: string
599+
type: object
600+
nullable: true
601+
type: array
602+
repo:
603+
description: Name of the docker repo, e.g. `docker.stackable.tech/stackable`
604+
nullable: true
605+
type: string
606+
stackableVersion:
607+
description: Stackable version of the product, e.g. 2.1.0
608+
type: string
609+
type: object
568610
log4j:
569611
nullable: true
570612
type: string
@@ -582,12 +624,10 @@ spec:
582624
stopped:
583625
nullable: true
584626
type: boolean
585-
version:
586-
nullable: true
587-
type: string
588627
zookeeperConfigMapName:
589628
type: string
590629
required:
630+
- image
591631
- zookeeperConfigMapName
592632
type: object
593633
required:

docs/modules/ROOT/pages/config_properties.adoc

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@
22

33
The cluster can be configured via a YAML file. This custom resource specifies the amount of replicas for each role group, role group or role specific configuration like port definitions etc.
44

5-
apiVersion: kafka.stackable.tech/v1alpha1
6-
kind: KafkaCluster
7-
metadata:
8-
name: simple-kafka
9-
spec:
10-
version: 3.2.0-stackable0.2.0
11-
zookeeperConfigMapName: simple-kafka-znode
12-
brokers:
13-
roleGroups:
14-
default:
15-
replicas: 1
5+
[source,yaml]
6+
----
7+
apiVersion: kafka.stackable.tech/v1alpha1
8+
kind: KafkaCluster
9+
metadata:
10+
name: simple-kafka
11+
spec:
12+
image:
13+
productVersion: 3.3.1
14+
stackableVersion: 0.2.0
15+
zookeeperConfigMapName: simple-kafka-znode
16+
brokers:
17+
roleGroups:
18+
default:
19+
replicas: 1
20+
----
1621

1722
=== Structure
1823

docs/modules/ROOT/pages/usage.adoc

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ kind: KafkaCluster
2323
metadata:
2424
name: simple-kafka
2525
spec:
26-
version: 3.2.0-stackable0.2.0
26+
image:
27+
productVersion: 3.2.0
28+
stackableVersion: 0.2.0
2729
zookeeperConfigMapName: simple-kafka-znode
2830
brokers:
2931
roleGroups:
@@ -40,7 +42,9 @@ kind: KafkaCluster
4042
metadata:
4143
name: simple-kafka
4244
spec:
43-
version: 3.2.0-stackable0.2.0
45+
image:
46+
productVersion: 3.2.0
47+
stackableVersion: 0.2.0
4448
zookeeperConfigMapName: simple-kafka-znode
4549
opa:
4650
configMapName: simple-opa
@@ -61,7 +65,9 @@ kind: KafkaCluster
6165
metadata:
6266
name: simple-kafka
6367
spec:
64-
version: 3.2.0-stackable0.2.0
68+
image:
69+
productVersion: 3.2.0
70+
stackableVersion: 0.2.0
6571
zookeeperConfigMapName: simple-kafka-znode
6672
opa:
6773
configMapName: simple-opa
@@ -96,7 +102,9 @@ kind: KafkaCluster
96102
metadata:
97103
name: simple-kafka
98104
spec:
99-
version: 3.2.0-stackable0.2.0
105+
image:
106+
productVersion: 3.2.0
107+
stackableVersion: 0.2.0
100108
zookeeperConfigMapName: simple-kafka-znode
101109
log4j: |-
102110
log4j.rootLogger=INFO, stdout, kafkaAppender
@@ -128,7 +136,9 @@ kind: KafkaCluster
128136
metadata:
129137
name: simple-kafka
130138
spec:
131-
version: 3.2.0-stackable0.2.0
139+
image:
140+
productVersion: 3.2.0
141+
stackableVersion: 0.2.0
132142
zookeeperConfigMapName: simple-kafka-znode
133143
config:
134144
tls:
@@ -198,7 +208,9 @@ kind: KafkaCluster
198208
metadata:
199209
name: simple-kafka
200210
spec:
201-
version: 3.2.0-stackable0.2.0
211+
image:
212+
productVersion: 3.2.0
213+
stackableVersion: 0.2.0
202214
zookeeperConfigMapName: simple-kafka-znode
203215
config:
204216
tls:

docs/modules/getting_started/examples/code/kafka.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ kind: KafkaCluster
44
metadata:
55
name: simple-kafka
66
spec:
7-
version: 3.3.1-stackable0.2.0
7+
image:
8+
productVersion: 3.3.1
9+
stackableVersion: 0.2.0
810
zookeeperConfigMapName: simple-kafka-znode
911
config:
1012
tls: null

examples/logging/simple-kafka-cluster-opa-log4j.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ kind: OpaCluster
2828
metadata:
2929
name: simple-opa
3030
spec:
31-
version: 0.45.0-stackable0.2.0
31+
image:
32+
productVersion: 0.45.0
33+
stackableVersion: 0.2.0
3234
servers:
3335
roleGroups:
3436
default:
@@ -55,7 +57,9 @@ kind: KafkaCluster
5557
metadata:
5658
name: simple-kafka
5759
spec:
58-
version: 3.2.0-stackable0.2.0
60+
image:
61+
productVersion: 3.3.1
62+
stackableVersion: 0.1.0
5963
zookeeperConfigMapName: simple-kafka-znode
6064
opa:
6165
configMapName: simple-opa

examples/opa/simple-kafka-cluster-opa-allow-all.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ kind: OpaCluster
2828
metadata:
2929
name: simple-opa
3030
spec:
31-
version: 0.45.0-stackable0.2.0
31+
image:
32+
productVersion: 0.45.0
33+
stackableVersion: 0.2.0
3234
servers:
3335
roleGroups:
3436
default:
@@ -55,7 +57,9 @@ kind: KafkaCluster
5557
metadata:
5658
name: simple-kafka
5759
spec:
58-
version: 3.3.1-stackable0.2.0
60+
image:
61+
productVersion: 3.3.1
62+
stackableVersion: 0.1.0
5963
zookeeperConfigMapName: simple-kafka-znode
6064
opa:
6165
configMapName: simple-opa

examples/tls/simple-kafka-cluster-tls.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ kind: KafkaCluster
6464
metadata:
6565
name: simple-kafka
6666
spec:
67-
version: 3.3.1-stackable0.2.0
67+
image:
68+
productVersion: 3.3.1
69+
stackableVersion: 0.1.0
6870
zookeeperConfigMapName: simple-kafka-znode
6971
config:
7072
tls:

0 commit comments

Comments
 (0)