Skip to content

Commit

Permalink
Merge branch 'master' into yong/imporve-backup-to-support-reconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
zymap authored Mar 7, 2024
2 parents 81cd1d1 + 04b7ad5 commit 6516900
Show file tree
Hide file tree
Showing 170 changed files with 97 additions and 17,898 deletions.
90 changes: 0 additions & 90 deletions .github/workflows/pulsar.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/pulsar_upgrade.yml

This file was deleted.

2 changes: 1 addition & 1 deletion charts/pulsar-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
apiVersion: v1
version: 0.17.9
appVersion: "0.17.10"
kubeVersion: ">= 1.16.0-0 < 1.29.0-0"
kubeVersion: ">= 1.16.0-0"
description: Apache Pulsar Operators Helm chart for Kubernetes
name: pulsar-operator
home: https://streamnative.io
Expand Down
142 changes: 10 additions & 132 deletions charts/pulsar-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,139 +1,17 @@
# StreamNative Pulsar Operators

StreamNative Pulsar Operators bring the specific controllers for Kubernetes by providing specific Custom Resource Definition (CRD) which is developed and maintained by StreamNative Inc.
Installing the StreamNative Pulsar Operators means you agree to and are in compliance with the [StreamNative Community License](https://streamnative.io/community-licence).
> **Note**
> StreamNative now offers a unified approach to managing Pulsar clusters on Kubernetes systems, transitioning from two distinct versions of operators—Pulsar Operators (Basic ? Version) and StreamNative Operator (Advanced Version)—to a single, consolidated operator, StreamNative Operator, effective from the start of 2024. As part of this change, we will cease the release of new versions of Pulsar Operators, with future updates and enhancements being exclusively available through the StreamNative Operator, accessible only via StreamNative's paid services.
## Requirements
## StreamNative Private Cloud

To use the `pulsar-operator` chart to deploy BookKeeper Controller, ZooKeeper Controller, and Pulsar Controller, the followings are required.
StreamNative Private Cloud is an enterprise product which brings specific controllers for Kubernetes by providing specific Custom Resource Definitions (CRDs) that extend the basic Kubernetes orchestration capabilities to support the setup and management of StreamNative components.

- Install [`kubectl`](https://kubernetes.io/docs/tasks/tools/#kubectl) 1.16 or higher, compatible with your cluster (+/- 1 minor release from your cluster).
- Install [`helm`](https://helm.sh/docs/intro/install/) v3 (3.0.2 or higher).
- Prepare a Kubernetes cluster, version 1.16 to 1.25.
## Apply for trial
Before installing StreamNative Operator, you need to import a valid license. You can contact StreamNative to apply for a free trial https://streamnative.io/deployment/start-free-trial.

## Install `pulsar-operator` chart
## Quick Start
Follow our Quick Start guide https://docs.streamnative.io/private/private-cloud-quickstart to quickly provision and manage Pulsar clusters with the StreamNative Private Cloud.

1. Create a Kubernetes namespace.

```
kubectl create namespace pulsar
```
2. Add the `streamnative` repo.
```
helm repo add streamnative https://charts.streamnative.io
helm repo update
```
3. Install the `pulsar-operator` chart.
```
helm install pulsar-operators streamnative/pulsar-operator --namespace pulsar
```
4. Verify that the `pulsar-operator` chart is installed successfully.
```
kubectl get po -n pulsar
```
Expected outputs:
```
NAME READY STATUS RESTARTS AGE
pulsar-operator-bookkeeper-controller-manager-7488dd7c7f-bs5jn 1/1 Running 0 15h
pulsar-operator-pulsar-controller-manager-6f7fcd7799-9tkxt 1/1 Running 0 15h
pulsar-operator-zookeeper-controller-manager-56db9d5649-76dqm 1/1 Running 0 15h
```
5. Provision a Pulsar cluster.
```
kubectl apply -f https://raw.githubusercontent.com/streamnative/charts/master/examples/pulsar-operators/quick-start.yaml
```
Expected outputs:
```
NAME READY STATUS RESTARTS AGE
pulsar-operator-bookkeeper-controller-manager-7488dd7c7f-bs5jn 1/1 Running 0 15h
pulsar-operator-pulsar-controller-manager-6f7fcd7799-9tkxt 1/1 Running 0 15h
pulsar-operator-zookeeper-controller-manager-56db9d5649-76dqm 1/1 Running 0 15h
```
6. Verify that the Pulsar cluster Pods are running.
```
kubectl get po -n pulsar
```
Expected outputs:
```
NAME READY STATUS RESTARTS AGE
bookies-bk-0 1/1 Running 0 2m3s
bookies-bk-1 1/1 Running 0 2m3s
bookies-bk-2 1/1 Running 0 2m3s
bookies-bk-auto-recovery-0 1/1 Running 0 62s
brokers-broker-0 1/1 Running 0 2m4s
brokers-broker-1 1/1 Running 0 2m4s
pulsar-operator-bookkeeper-controller-manager-7488dd7c7f-bs5jn 1/1 Running 0 15h
pulsar-operator-pulsar-controller-manager-6f7fcd7799-9tkxt 1/1 Running 0 15h
pulsar-operator-zookeeper-controller-manager-56db9d5649-76dqm 1/1 Running 0 15h
zookeepers-zk-0 1/1 Running 0 3m17s
zookeepers-zk-1 1/1 Running 0 3m17s
zookeepers-zk-2 1/1 Running 0 3m17s
```
7. Clean up the environment.
```
kubectl delete -f https://raw.githubusercontent.com/streamnative/charts/master/examples/pulsar-operators/quick-start.yaml
helm uninstall pulsar-operators -n pulsar
kubectl delete ns pulsar
```
## More Resources
### StreamNative Pulsar Operators examples
* [Install Pulsar Operator with OLM](https://raw.githubusercontent.com/streamnative/charts/master/examples/pulsar-operators/olm-subscription.yaml)
* [Set a pre-defined Kubernetes Storage Class](https://raw.githubusercontent.com/streamnative/charts/master/examples/pulsar-operators/storage.yaml)
* [Provision Pulsar Proxy](https://raw.githubusercontent.com/streamnative/charts/master/examples/pulsar-operators/proxy.yaml)
* [Enable the KoP](https://raw.githubusercontent.com/streamnative/charts/master/examples/pulsar-operators/kop.yaml)
### StreamNative Pulsar Operator Tutorial
* [StreamNative Pulsar Operator Tutorial Part 1](https://yuweisung.medium.com/streamnative-pulsar-operator-tutorial-part-1-7fbbbb07397e)
* [StreamNative Pulsar Operator Tutorial Part 2](https://yuweisung.medium.com/streamnative-pulsar-operator-tutorial-part-2-8dd030ac1b7c)
* [StreamNative Pulsar Operator Tutorial Part 3](https://yuweisung.medium.com/streamnative-pulsar-operator-tutorial-part-3-2bb2cf67d0a0)
## Note
1. As Helm won't upgrade CRD when doing `helm upgrade`, please manually apply the pulsar-operator [CRDs](https://github.com/streamnative/charts/tree/master/charts/pulsar-operator/crds) before upgrading pulsar-operator chart version.
2. When upgrading the CRD from `apiextensions.k8s.io/v1beta1` to `apiextensions.k8s.io/v1` we might get exceptions like:
```
The CustomResourceDefinition "pulsarbrokers.pulsar.streamnative.io" is invalid: spec.preserveUnknownFields: Invalid value: true: must be false in order to use defaults in the schema
```
This is caused by a [controller-gen bug](https://github.com/kubernetes-sigs/controller-tools/issues/476), which makes `preserveUnknownFields: false` missing from the generated CRD even if adding `preserveUnknownFields=false` option. So we can manually patch the CRD wheing getting such exception like below and reapply again:
```
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.0
creationTimestamp: null
name: pulsarbrokers.pulsar.streamnative.io
spec:
group: pulsar.streamnative.io
preserveUnknownFields: false
```
## Versioning Convention
`version`: The version of the chart. It will be changed only when there are some changes to the chart or the `appVersion` bumps a new version.
`appVersion`: The version of the application image that the chart contains. It will be changed only when the operator image bumps a new version.
`kubeVersion`: The range of compatible Kubernetes versions.
## Upgrade to StreamNative Operator
Follow the Upgrade guide https://docs.streamnative.io/private/upgrade-from-pulsar-operators to upgrade to the StreamNative Operator easily.
12 changes: 10 additions & 2 deletions charts/pulsar-operator/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
StreamNative Operators for Apache Pulsar

The StreamNative Pulsar Operators bring the specific controllers for Kubernetes by providing specific Custom Resource Definition (CRD) which is developed and maintained by StreamNative Inc.
Installing the StreamNative Pulsar Operators means you agreed to and are in compliance with https://streamnative.io/community-licence.
StreamNative now offers a unified approach to managing Pulsar clusters on Kubernetes systems, transitioning from two distinct versions of operators—Pulsar Operators (Basic Version) and StreamNative Operator (Advanced Version)—to a single, consolidated operator, StreamNative Operator, effective from the start of 2024. As part of this change, we will cease the release of new versions of Pulsar Operators, with future updates and enhancements being exclusively available through the StreamNative Operator, accessible only via StreamNative's paid services.

Apply for trial:
Before installing StreamNative Private Cloud, you need to import a valid license. You can contact StreamNative to apply for a free trial https://streamnative.io/deployment/start-free-trial.

Quick Start:
Follow our Quick Start guide https://docs.streamnative.io/private/private-cloud-quickstart to quickly provision and manage Pulsar clusters with the StreamNative Private Cloud.

Upgrade to StreamNative Operator:
Follow the Upgrade guide https://docs.streamnative.io/private/upgrade-from-pulsar-operators to upgrade to the StreamNative Operator easily.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ kind: {{ template "pulsar.bookkeeperRoleBindingKind" . }}
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: '{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.rbac.name }}-operator'
{{- if not .Values.bookkeeper.serviceAccount.cluserRole }}
{{- if not .Values.bookkeeper.serviceAccount.clusterRole }}
namespace: {{ template "pulsar.namespace" . }}
{{- end }}
subjects:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ kind: {{ template "pulsar.operatorRoleBindingKind" . }}
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: '{{ template "pulsar.fullname" . }}-{{ .Values.pulsar.rbac.name }}-operator'
{{- if not .Values.pulsar.serviceAccount.cluserRole }}
{{- if not .Values.pulsar.serviceAccount.clusterRole }}
namespace: {{ template "pulsar.namespace" . }}
{{- end }}
subjects:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ kind: {{ template "pulsar.zookeeperRoleBindingKind" . }}
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: '{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.rbac.name }}-operator'
{{- if not .Values.zookeeper.serviceAccount.cluserRole }}
{{- if not .Values.zookeeper.serviceAccount.clusterRole }}
namespace: {{ template "pulsar.namespace" . }}
{{- end }}
subjects:
Expand Down
22 changes: 0 additions & 22 deletions charts/pulsar/.helmignore

This file was deleted.

Loading

0 comments on commit 6516900

Please sign in to comment.