Skip to content

Commit

Permalink
feat: support TLS authentication and customized volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjo committed Jan 24, 2024
1 parent 24d1187 commit 6e37f6e
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 5 deletions.
4 changes: 2 additions & 2 deletions charts/pulsar-resources-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: v0.4.6
version: v0.5.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v0.4.6"
appVersion: "v0.5.0"

# This is a semver range of compatible Kubernetes versions. Helm will validate the version
# constraints when installing the chart and fail if the cluster runs an unsupported Kubernetes version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ spec:
- issuerEndpoint
- key
type: object
tls:
description: PulsarAuthenticationTLS indicates the parameters
which are need by pulsar TLS Authentication
properties:
clientCertificateKeyPath:
type: string
clientCertificatePath:
type: string
required:
- clientCertificateKeyPath
- clientCertificatePath
type: object
token:
description: ValueOrSecretRef is a string or a secret reference
of the authentication
Expand Down Expand Up @@ -166,6 +178,16 @@ spec:
description: ClusterName indicates the local cluster name of the pulsar
cluster. It should set when enabling the Geo Replication
type: string
tlsEnableHostnameVerification:
description: TLSEnableHostnameVerification indicates whether to verify the hostname of the broker.
Only used when using secure urls.
type: boolean
tlsAllowInsecureConnection:
description: TLSAllowInsecureConnection indicates whether to allow insecure connection to the broker.
type: boolean
tlsTrustCertsFilePath:
description: TLSTrustCertsFilePath Path for the TLS certificate used to validate the broker endpoint when using TLS.
type: string
type: object
status:
description: PulsarConnectionStatus defines the observed state of PulsarConnection
Expand Down
8 changes: 8 additions & 0 deletions charts/pulsar-resources-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,18 @@ spec:
periodSeconds: 20
resources:
{{- toYaml .Values.resources | nindent 10 }}
{{- if .Values.extraVolumeMounts }}
volumeMounts:
{{- toYaml .Values.extraVolumeMounts | nindent 10 }}
{{- end }}
nodeSelector:
{{- toYaml .Values.nodeSelector | nindent 8 }}
affinity:
{{- toYaml .Values.affinity | nindent 8 }}
tolerations:
{{- toYaml .Values.tolerations | nindent 8 }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- if .Values.extraVolumes }}
volumes:
{{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }}
10 changes: 7 additions & 3 deletions charts/pulsar-resources-operator/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tests:
value: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.4
- equal:
path: spec.template.spec.containers[1].image
value: docker.streamnative.io/streamnative/operators/pulsar-resources-operator:v0.4.6
value: docker.streamnative.io/streamnative/operators/pulsar-resources-operator:v0.5.0
- equal:
path: spec.template.spec.containers[1].imagePullPolicy
value: IfNotPresent
Expand All @@ -54,14 +54,18 @@ tests:
path: spec.template.spec.containers[1].resources.requests
- isNull:
path: spec.template.spec.containers[1].resources.limits
- isNull:
path: spec.template.spec.containers[1].volumeMounts
- isNull:
path: spec.template.spec.volumes

- it: should update the image version successfully
set:
image.manager.tag: v0.4.6
image.manager.tag: v0.5.0
asserts:
- equal:
path: spec.template.spec.containers[1].image
value: docker.streamnative.io/streamnative/operators/pulsar-resources-operator:v0.4.6
value: docker.streamnative.io/streamnative/operators/pulsar-resources-operator:v0.5.0

- it: should update the replicas successfully
set:
Expand Down
3 changes: 3 additions & 0 deletions charts/pulsar-resources-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@ affinity: {}

# -- The period seconds that pod will be termiated gracefully
terminationGracePeriodSeconds: 10

extraVolumeMounts: []
extraVolumes: []
22 changes: 22 additions & 0 deletions config/crd/bases/resource.streamnative.io_pulsarconnections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ spec:
- issuerEndpoint
- key
type: object
tls:
description: PulsarAuthenticationTLS indicates the parameters
which are need by pulsar TLS Authentication
properties:
clientCertificateKeyPath:
type: string
clientCertificatePath:
type: string
required:
- clientCertificateKeyPath
- clientCertificatePath
type: object
token:
description: ValueOrSecretRef is a string or a secret reference
of the authentication
Expand Down Expand Up @@ -166,6 +178,16 @@ spec:
description: ClusterName indicates the local cluster name of the pulsar
cluster. It should set when enabling the Geo Replication
type: string
tlsEnableHostnameVerification:
description: TLSEnableHostnameVerification indicates whether to verify the hostname of the broker.
Only used when using secure urls.
type: boolean
tlsAllowInsecureConnection:
description: TLSAllowInsecureConnection indicates whether to allow insecure connection to the broker.
type: boolean
tlsTrustCertsFilePath:
description: TLSTrustCertsFilePath Path for the TLS certificate used to validate the broker endpoint when using TLS.
type: string
type: object
status:
description: PulsarConnectionStatus defines the observed state of PulsarConnection
Expand Down

0 comments on commit 6e37f6e

Please sign in to comment.