Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Create Kubernetes Cluster
uses: helm/kind-action@v1
- name: Install CRDs
run: kubectl create -f https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.47.0/strimzi-crds-0.47.0.yaml
run: kubectl create -f https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.48.0/strimzi-crds-0.48.0.yaml
# Test the project
- name: Test the project
run: make test
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The following table shows the supported Strimzi versions
| `0.2.x` | 0.45.0 |
| `0.3.x` | 0.46.0 |
| `0.4.x` | 0.47.x |
| `0.5.x` | 0.48.x |

## Examples

Expand All @@ -25,6 +26,7 @@ If you are using the Strimzi Go API, feel free to open a PR and add your project

* [Keksposé](https://github.com/scholzj/kekspose): Expose your Strimzi-based Apache Kafka cluster outside your Minikube, Kind, or Docker Desktop clusters
* [Strimzi Shutdown](https://github.com/scholzj/strimzi-shutdown): Simple utility to temporarily stop or restart your Strimzi-based Apache Kafka cluster
* [Strimzi Backup](https://github.com/scholzj/strimzi-backup): Backup or restore Strimzi-managed Apache Kafka clusters

## Updating the APIs

Expand Down
7 changes: 4 additions & 3 deletions examples/create-kafka/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package main
import (
"context"
"flag"
"log"
"path/filepath"
"time"

kafkav1beta2 "github.com/scholzj/strimzi-go/pkg/apis/kafka.strimzi.io/v1beta2"
strimziclient "github.com/scholzj/strimzi-go/pkg/client/clientset/versioned"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
"log"
"path/filepath"
"time"
)

func main() {
Expand Down
5 changes: 3 additions & 2 deletions examples/delete-kafka/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package main
import (
"context"
"flag"
"log"
"path/filepath"

strimziclient "github.com/scholzj/strimzi-go/pkg/client/clientset/versioned"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
"log"
"path/filepath"
)

func main() {
Expand Down
9 changes: 5 additions & 4 deletions examples/update-kafka/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package main
import (
"context"
"flag"
"log"
"path/filepath"
"time"

kafkav1beta2 "github.com/scholzj/strimzi-go/pkg/apis/kafka.strimzi.io/v1beta2"
strimziclient "github.com/scholzj/strimzi-go/pkg/client/clientset/versioned"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
"log"
"path/filepath"
"time"
)

func main() {
Expand Down Expand Up @@ -112,7 +113,7 @@ func isReady(event watch.Event) bool {
for _, condition := range k.Status.Conditions {
if condition.Type == "Ready" && condition.Status == "True" {
if k.Status.ObservedGeneration == k.ObjectMeta.Generation {
//log.Print("The Kafka cluster is ready and up-to-date")
//log.Print("The Kafka cluster is ready and up to date")
return true
}
}
Expand Down
78 changes: 43 additions & 35 deletions pkg/apis/kafka.strimzi.io/v1beta2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ type KafkaBridgeSpec struct {
ClientRackInitImage string `json:"clientRackInitImage,omitempty"`
Rack *Rack `json:"rack,omitempty"`
EnableMetrics bool `json:"enableMetrics,omitempty"`
MetricsConfig *MetricsConfig `json:"metricsConfig,omitempty"`
LivenessProbe *Probe `json:"livenessProbe,omitempty"`
ReadinessProbe *Probe `json:"readinessProbe,omitempty"`
Template *KafkaBridgeTemplate `json:"template,omitempty"`
Expand Down Expand Up @@ -598,6 +599,27 @@ type Probe struct {
FailureThreshold *int32 `json:"failureThreshold,omitempty"`
}

type MetricsConfigType string

const (
JMXPROMETHEUSEXPORTER_METRICSCONFIGTYPE MetricsConfigType = "jmxPrometheusExporter"
STRIMZIMETRICSREPORTER_METRICSCONFIGTYPE MetricsConfigType = "strimziMetricsReporter"
)

type MetricsConfig struct {
Type MetricsConfigType `json:"type,omitempty"`
ValueFrom *ExternalConfigurationReference `json:"valueFrom,omitempty"`
Values *StrimziMetricsReporterValues `json:"values,omitempty"`
}

type StrimziMetricsReporterValues struct {
AllowList []string `json:"allowList,omitempty"`
}

type ExternalConfigurationReference struct {
ConfigMapKeyRef *corev1.ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
}

type Rack struct {
TopologyKey string `json:"topologyKey,omitempty"`
}
Expand All @@ -615,10 +637,6 @@ type Logging struct {
ValueFrom *ExternalConfigurationReference `json:"valueFrom,omitempty"`
}

type ExternalConfigurationReference struct {
ConfigMapKeyRef *corev1.ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
}

type JvmOptions struct {
XX map[string]string `json:"-XX,omitempty"`
Xmx string `json:"-Xmx,omitempty"`
Expand Down Expand Up @@ -665,13 +683,15 @@ const (
SCRAM_SHA_512_KAFKACLIENTAUTHENTICATIONTYPE KafkaClientAuthenticationType = "scram-sha-512"
PLAIN_KAFKACLIENTAUTHENTICATIONTYPE KafkaClientAuthenticationType = "plain"
OAUTH_KAFKACLIENTAUTHENTICATIONTYPE KafkaClientAuthenticationType = "oauth"
CUSTOM_KAFKACLIENTAUTHENTICATIONTYPE KafkaClientAuthenticationType = "custom"
)

type KafkaClientAuthentication struct {
ClientAssertionLocation string `json:"clientAssertionLocation,omitempty"`
Type KafkaClientAuthenticationType `json:"type,omitempty"`
AccessTokenIsJwt bool `json:"accessTokenIsJwt,omitempty"`
TlsTrustedCertificates []CertSecretSource `json:"tlsTrustedCertificates,omitempty"`
Sasl bool `json:"sasl,omitempty"`
SaslExtensions map[string]string `json:"saslExtensions,omitempty"`
DisableTlsHostnameVerification bool `json:"disableTlsHostnameVerification,omitempty"`
Scope string `json:"scope,omitempty"`
Expand All @@ -692,6 +712,8 @@ type KafkaClientAuthentication struct {
PasswordSecret *PasswordSecretSource `json:"passwordSecret,omitempty"`
IncludeAcceptHeader bool `json:"includeAcceptHeader,omitempty"`
HttpRetries *int32 `json:"httpRetries,omitempty"`
GrantType string `json:"grantType,omitempty"`
Config MapStringObject `json:"config,omitempty"`
Username string `json:"username,omitempty"`
RefreshToken *GenericSecretSource `json:"refreshToken,omitempty"`
}
Expand Down Expand Up @@ -808,23 +830,6 @@ type BuildConfigTemplate struct {
PullSecret string `json:"pullSecret,omitempty"`
}

type MetricsConfigType string

const (
JMXPROMETHEUSEXPORTER_METRICSCONFIGTYPE MetricsConfigType = "jmxPrometheusExporter"
STRIMZIMETRICSREPORTER_METRICSCONFIGTYPE MetricsConfigType = "strimziMetricsReporter"
)

type MetricsConfig struct {
Type MetricsConfigType `json:"type,omitempty"`
ValueFrom *ExternalConfigurationReference `json:"valueFrom,omitempty"`
Values *StrimziMetricsReporterValues `json:"values,omitempty"`
}

type StrimziMetricsReporterValues struct {
AllowList []string `json:"allowList,omitempty"`
}

type KafkaJmxOptions struct {
Authentication *KafkaJmxAuthentication `json:"authentication,omitempty"`
}
Expand Down Expand Up @@ -1152,11 +1157,12 @@ type KafkaExporterSpec struct {
}

type KafkaExporterTemplate struct {
Deployment *DeploymentTemplate `json:"deployment,omitempty"`
Pod *PodTemplate `json:"pod,omitempty"`
Service *ResourceTemplate `json:"service,omitempty"`
Container *ContainerTemplate `json:"container,omitempty"`
ServiceAccount *ResourceTemplate `json:"serviceAccount,omitempty"`
Deployment *DeploymentTemplate `json:"deployment,omitempty"`
Pod *PodTemplate `json:"pod,omitempty"`
Service *ResourceTemplate `json:"service,omitempty"`
Container *ContainerTemplate `json:"container,omitempty"`
ServiceAccount *ResourceTemplate `json:"serviceAccount,omitempty"`
PodDisruptionBudget *PodDisruptionBudgetTemplate `json:"podDisruptionBudget,omitempty"`
}

type JmxTransSpec struct {
Expand Down Expand Up @@ -1292,15 +1298,16 @@ type EntityOperatorSpec struct {
}

type EntityOperatorTemplate struct {
Deployment *DeploymentTemplate `json:"deployment,omitempty"`
Pod *PodTemplate `json:"pod,omitempty"`
TopicOperatorContainer *ContainerTemplate `json:"topicOperatorContainer,omitempty"`
UserOperatorContainer *ContainerTemplate `json:"userOperatorContainer,omitempty"`
TlsSidecarContainer *ContainerTemplate `json:"tlsSidecarContainer,omitempty"`
ServiceAccount *ResourceTemplate `json:"serviceAccount,omitempty"`
EntityOperatorRole *ResourceTemplate `json:"entityOperatorRole,omitempty"`
TopicOperatorRoleBinding *ResourceTemplate `json:"topicOperatorRoleBinding,omitempty"`
UserOperatorRoleBinding *ResourceTemplate `json:"userOperatorRoleBinding,omitempty"`
Deployment *DeploymentTemplate `json:"deployment,omitempty"`
Pod *PodTemplate `json:"pod,omitempty"`
TopicOperatorContainer *ContainerTemplate `json:"topicOperatorContainer,omitempty"`
UserOperatorContainer *ContainerTemplate `json:"userOperatorContainer,omitempty"`
TlsSidecarContainer *ContainerTemplate `json:"tlsSidecarContainer,omitempty"`
ServiceAccount *ResourceTemplate `json:"serviceAccount,omitempty"`
PodDisruptionBudget *PodDisruptionBudgetTemplate `json:"podDisruptionBudget,omitempty"`
EntityOperatorRole *ResourceTemplate `json:"entityOperatorRole,omitempty"`
TopicOperatorRoleBinding *ResourceTemplate `json:"topicOperatorRoleBinding,omitempty"`
UserOperatorRoleBinding *ResourceTemplate `json:"userOperatorRoleBinding,omitempty"`
}

type EntityUserOperatorSpec struct {
Expand Down Expand Up @@ -1593,6 +1600,7 @@ type KafkaListenerAuthentication struct {
JwksRefreshSeconds *int32 `json:"jwksRefreshSeconds,omitempty"`
EnableOauthBearer bool `json:"enableOauthBearer,omitempty"`
ClientId string `json:"clientId,omitempty"`
ClientGrantType string `json:"clientGrantType,omitempty"`
GroupsClaimDelimiter string `json:"groupsClaimDelimiter,omitempty"`
ConnectTimeoutSeconds *int32 `json:"connectTimeoutSeconds,omitempty"`
UserNameClaim string `json:"userNameClaim,omitempty"`
Expand Down
16 changes: 16 additions & 0 deletions pkg/apis/kafka.strimzi.io/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion strimzi-go-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<maven.compiler.plugin.version>3.10.1</maven.compiler.plugin.version>

<strimzi-api.version>0.47.0</strimzi-api.version>
<strimzi-api.version>0.48.0</strimzi-api.version>
<log4j2.version>2.20.0</log4j2.version>
</properties>

Expand Down