184 Commits

Author SHA1 Message Date
Miloš Matijašević
c2f672881e
Updating pods on configmap change (#73)
Fixes #71 

### Motivation

Pods are not restarting when config maps are changed after changing values.yaml file, so they need to be restarted manually in order to pick up new values from config map. 

### Modifications

As I mentioned `restartPodsOnConfigMapChange` flag for each component is added in values.yaml file whether to restart pods on configmap change or not, default is `false`.
In statefulset templates for each component is added part which is adding annotation that contains hash of corresponding configmap if `restartPodsOnConfigMapChange` is `true`, which will cause pods to restart if corresponding configmap has been changed (https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments).

### Verifying this change

- [ ] Make sure that the change passes the CI checks.
2021-01-07 21:28:11 -08:00
Miecio
667e634af0
Add basic PSP and RBAC for core components (#87)
Add PSP and add/modify RBAC. I'm open for all discussion.

### Motivation

On clusters which use PSP and restrictive default policy pulsar cannot be installed, because it uses root user and requires writable container root directory. Additionally default RBAC for broker are too permissive (usage of ClusterRoleBinding) in my opinion.

### Modifications

Add PSP and RBAC for bookkeeper and autorecovery to add
exception to allow startup even in secure environment
where containers cannot access RW on root by default.

Add option for limiting broker ClusterRoleBinding
to single namespace by replacing to RoleBinding

### Verifying this change

- [x] Make sure that the change passes the CI checks.
2021-01-07 21:26:44 -08:00
Jiří Pinkava
8d5339f9ff
Allow use of existing secret for pulsar manager credentials (#69)
Signed-off-by: Jiří Pinkava <jiri.pinkava@rossum.ai>

Co-authored-by: Jiri Pinkava <jiri.pinkava@rossum.ai>
pulsar-2.7.0-1
2021-01-07 21:24:52 -08:00
Peter Tinti
6fbda8052c
Allows appending dnsNames to self-signed certs (#74)
Co-authored-by: Sijie Guo <sijie@apache.org>

Fixes inability to validate self-signed certs from external clients

### Motivation

Currently self-signed certificates can only be used inside of the same cluster as they are labeled with internal dns names without the possibility of appending additional values. Some use-cases require the connection of external clients. This PR aims to allow users add additional dnsNames (IP or domain) to the self-signed certificates.

### Modifications

* Adds the ability to add `dnsNames` to self-signed certificates to any component like so:

```yaml
tls:
  enabled: true
  proxy:
    enabled: true
    dnsNames:
      - test.example.com

```

### Verifying this change

- [x] Make sure that the change passes the CI checks.
2020-12-12 16:34:35 +08:00
lipenghui
f6705f0aec
Bump Pulsar 2.7.0 (#88)
Co-authored-by: Sijie Guo <sijie@apache.org>
pulsar-2.7.0
2020-12-03 20:14:05 -08:00
Jean Helou
6c9856a1af
Use .Release.Namespace by default to handle namespaces (#80)
It remains possible to override the current release namespace by setting
the `namespace` value though this may lead to having the helm metadata
and the pulsar components in different namespaces

Fixes #66

### Motivation

Trying to deploy the chart in a namespace using the usual helm pattern fails for example
```
kubectl create ns pulsartest
helm upgrade --install pulsar -n pulsartest apache/pulsar
Error: namespaces "pulsar" not found
```
fixing that while keeping the helm metadata and the deployed objects in the same namespace requires declaring the namespace twice 
```
kubectl create ns pulsartest
helm upgrade --install pulsar -n pulsartest apache/pulsar --set namespace=pulsartest
Error: namespaces "pulsar" not found
```
This is needlessly confusing for newcomers who follow the helm documentation and is contrary to helm best practices.

### Modifications

I changed the chart to use the context namespace `.Release.Namespace` by default while preserving the ability to override that by explicitly providing a namespace on the commande line, with the this modification both  examples behave as expected
 
### Verifying this change

- [x] Make sure that the change passes the CI checks.
pulsar-2.6.2-2
2020-12-03 19:32:05 -08:00
Jiří Pinkava
eb63a19964
Local mode for kubernetes object generators (#75)
This allows operation in environemnts where direct installation of objects into
kubernetes cluster is not desired or possible. For example when using sealedsecrets
or SOPS, where the secrets are firs encrypted and then commited into repository
and deployed latter by some other deployment system.

Co-authored-by: Jiří Pinkava <jiri.pinkava@rossum.ai>
2020-11-12 20:32:40 -07:00
xiaolong ran
ebc40c3382
Bump the image version to 2.6.2 (#81)
Signed-off-by: xiaolong.ran <rxl@apache.org>

### Motivation

Bump the image version to 2.6.2

### Verifying this change

- [x] Make sure that the change passes the CI checks.
pulsar-2.6.2-1
2020-11-12 20:31:41 -07:00
xiaolong ran
36e13e1078
Upgrade chart-testing-action to 2.0.0 (#83)
Signed-off-by: xiaolong.ran <rxl@apache.org>

### Motivation

The lint ci error as follows:

```
Linting chart 'pulsar => (version: "2.6.2-1", path: "charts/pulsar")'
Checking chart 'pulsar => (version: "2.6.2-1", path: "charts/pulsar")' for a version bump...
Old chart version: 2.6.1-2
New chart version: 2.6.2-1
Chart version ok.
Validating /workdir/charts/pulsar/Chart.yaml...
Validation success! 👍
Validating maintainers...
Error: Error linting charts: Error processing charts
------------------------------------------------------------------------------------------------------------------------
 ✖︎ pulsar => (version: "2.6.2-1", path: "charts/pulsar") > Error validating maintainer 'The Apache Pulsar Team': 404 Not Found
------------------------------------------------------------------------------------------------------------------------
Error linting charts: Error processing charts
```

### Modifications

Upgrade `chart-testing-action` to 2.0.0

### Verifying this change

- [x] Make sure that the change passes the CI checks.
2020-11-13 10:51:44 +08:00
Sijie Guo
669af788ff
Fix "unknown apiVersion: kind.sigs.k8s.io/v1alpha3" (#76)
* Fix "unknown apiVersion: kind.sigs.k8s.io/v1alpha3"

*Motivation*

The api version `kind.sigs.k8s.io/v1alpha3` is not available anymore for kind clusters.
So all the CI actions are broken now. This PR fix the issue.

Additionally it adds a helm chart lint job to lint the chart changes.

* Trigger CI when kind cluster build script is changed
2020-11-11 11:48:42 -07:00
Naveen Ramanathan
fb4c44f449
changed publishNotReadyAddresses to (#64)
### Motivation

* ```publishNotReadyAddresses``` is a service spec and not a service annotation. This is mentioned in the K8s API docs at https://v1-17.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.15/#servicespec-v1-core

### Modifications

* Modified ```publishNotReadyAddresses``` from annotation to service spec

### Verifying this change

- [x] Make sure that the change passes the CI checks.
2020-10-15 18:42:13 +08:00
Naveen Ramanathan
bf5db574d1
Make forceSync by default as "yes" (#63)
### Motivation

* It's not recommended to run a production zookkeeper cluster with forceSync as "no".  This is also mentioned in the forceSync section in https://pulsar.apache.org/docs/en/next/reference-configuration/#zookeeper

### Modifications

* Removed ```-Dzookeeper.forceSync=no``` from ```values.yaml``` as default ```forceSync``` is ```yes```.
2020-09-22 09:47:41 -05:00
Thomas O'Neill
bf349a8c05
Ingress optional hostname (#54)
Fixes #50 

### Motivation
The host option is not required to setup an ingress, so I made it an optional value
### Modifications

*Describe the modifications you've done.*
Made setting the host optional.
2020-09-21 13:16:20 -05:00
Elad Dolev
5049d3564a
add support for multiple clusters (#60)
Co-authored-by: Elad Dolev <elad@firebolt.io>

### Motivation

Give the ability to deploy multi-cluster instance on K8s clusters with non-default `clusterDomain`, and connect to external configuration-store

### Modifications

- give the ability to change cluster's name
- give the ability to change `clusterDomain`
- fix external configuration store functionality
- use broker ports variables
- use label templates, and add `component` label in several places

### Verifying this change

- [x] Make sure that the change passes the CI checks.
pulsar-2.6.1-2
2020-09-08 10:06:30 +08:00
Lari Hotari
6c2edba8b1
Get OS signals passed to container process by using shell built-in "exec" (#59)
### Changes 

- using "exec" to run a command replaces the shell process with the executed process
- this is required so that the process running in the container is able to receive OS signals
  - explained in https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
    and https://docs.docker.com/engine/reference/builder/#entrypoint
- receiving SIGTERM signal is required for graceful shutdown. This is explained in https://pracucci.com/graceful-shutdown-of-kubernetes-pods.html 

This change might fix issues such as https://github.com/apache/pulsar/issues/6603 . One expectation of this fix is that graceful shutdown would allow Pulsar components such as a bookies to deregistered from Zookeeper properly before shutdown. 

### Motivation

Dockerfile best practices mention that "exec" should be used so that the process running in a container can receive OS signals. This is explained in https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
    and https://docs.docker.com/engine/reference/builder/#entrypoint .  Kubernetes documention explains pod termination in https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination : "Typically, the container runtime sends a TERM signal to the main process in each container. Once the grace period has expired, the KILL signal is sent to any remaining processes, and the Pod is then deleted from the API Server ."
Currently some issues while running Pulsar are caused by the lack of graceful shutdown. Graceful shutdown isn't happening at all since the Pulsar processes never receive the TERM signal that would allow graceful shutdown. This PR fixes that.

This PR was inspired by https://github.com/kafkaesque-io/pulsar-helm-chart/pull/31
2020-08-30 23:05:49 -06:00
冉小龙
4178c70d90
Bump the image version to 2.6.1 (#57)
Signed-off-by: xiaolong.ran rxl@apache.org

Motivation
Follow release process and bump the image version to 2.6.1
pulsar-2.6.1-1
2020-08-21 22:50:27 +08:00
Thomas O'Neill
b44b523c8a
Allow initialization to be set (#53)
Fixes #47 

### Motivation
Only create the initialize job on install. 

### Modifications

- Added an initialize value that can be set to true on install, matching the documentation in the README.md
2020-08-13 10:20:01 -07:00
Thomas O'Neill
207d697bed
Fix zookeeper antiaffinity (#52)
Fixes #39 

### Motivation

The match expression for the "app" label was incorrect breaking the antiaffinity since they would never match. Fixing this makes the podAntiAffinity work, but now requires at least N nodes to be in the cluster where N = largest replica set with affinity. Added the option to set the affinity type to preferredDuringSchedulingIgnoredDuringExecution where it will try to follow the affinity, but will still deploy a pod if it needs to break it. 

### Modifications

- Fixed app matchExpression 
- Added option to set the affinity type 
- bumped chart version

### Verifying this change

- [X] Make sure that the change passes the CI checks.
pulsar-2.6.0-3
2020-08-13 10:19:01 -07:00
Thomas O'Neill
8426c8de9c
Fix deprecated values (#49)
Fixes #46

### Motivation

There were some templates that relied on extra values that are deprecated. 

### Modifications

Modified the checks to check for non deprecated values or deprecated values. 

### Verifying this change

- [X] Make sure that the change passes the CI checks.
pulsar-2.6.0-2
2020-08-12 20:37:22 -07:00
Thomas O'Neill
a41b6c5063
Allow Grafana to work with a reverse proxy (#48)
### Motivation

Allow Grafana to be served from a sub path.  

### Modifications

- Added a config map to add extra environment variables to the grafana deployment. As the grafana image adds new features that require environment variables, this can be used to set them.
- Bumped the grafana image to allow a reverse proxy
- removed ingress annotations as they are specific to nginx, and to match all the other ingresses
- bumped the chart version as per the README 


Example values:
```
grafana:
  configData:
    GRAFANA_ROOT_URL: /pulsar/grafana
    GRAFANA_SERVE_FROM_SUB_PATH: "true"
  ingress:
      enabled: true
      port: 3000
      path: "/pulsar/grafana/?(.*)"
      annotations:
        nginx.ingress.kubernetes.io/rewrite-target: /$1
```
pulsar-2.6.0-1
2020-08-12 00:31:23 -07:00
John Harris
6b92881149
Add zookeeper metrics port and PodMonitors (#44)
* Add 'http' port specification to zookeeper statefulset

This makes the zookeeper spec inline with the other statefulset specs
in this chart and it provides a port target for custom podMonitors

* Added PodMonitors for bookie, broker, proxy, and zookeeper

New PodMonitors are needed for prometheus-operator to pickup scrape
targets.
Defaults to disabled so users need to opt in to deploy

* Added Apache license info to podmonitor yamls
2020-07-23 10:34:43 +08:00
冉小龙
682dfcee69
Update grafana dashboard images version to 0.0.9 (#45)
Signed-off-by: xiaolong.ran <rxl@apache.org>

### Modifications

- Update grafana dashboard images version to 0.0.9
- Add `.gitignore` file
2020-07-23 10:34:12 +08:00
BaochunLiuBJ
5995172c35
changes for aws (#43) 2020-07-22 09:00:04 -07:00
Niklas Wagner
2fbec08b02
Add Ingress to Pulsar Proxy and Pulsar Manager (#42) 2020-07-19 23:04:32 -07:00
Niklas Wagner
3cb674dfea
Fix wrong variable reference in Grafana & Pulsar Manager port (#41)
### Motivation

PR #37 updated the location of the ports in the default values yaml. This causes a null pointer exception when rendering this helm chart.

### Modifications

Fix variable reference
2020-07-18 10:41:40 +08:00
wuYin
135868c66c
Add optional user provided zookeeper as metadata store for other components (#38)
## Motivation
### Case
I have a physical zk cluster and want configure bookkeeper & broker & proxy to use it.
So I set components.zookeeper as false, and only found pulsar.zookeeper.connect to set my physical zk address.
But deploy stage was stucked in bookkeeper wait-zookeeper-ready container.

### Issue
The wait-zookeeper-ready initContainer in bookkeeper-cluster-initialize Job used spliced zk Service hosts to detect zk ready or not, other component init Job initContainer do the same thing. Actually, zk service are unreachable because I disabled zk component.

## Modifications
- Add optional pulsar_metadata.userProvidedZookeepers config for this case, and make component's init Job use user zk to detect liveness, instead of spliced Service hosts.

- Delete redundant image reference in bookkeeper init Job.
2020-07-15 13:19:06 +08:00
Rahul Vashishth
714ff4131e
add targetport for grafana nad manager service (#37)
Co-authored-by: rahul.name <rahul@mail.com>
2020-07-14 22:14:11 -07:00
Sijie Guo
8f9c1d126e
Update appVersion to 2.6.0 (#36)
*Motivation*

based on [helm documentation](https://helm.sh/docs/topics/charts/),
the `appVersion` is the version of the app that this contains. Since the repo
is using 2.6.0 image, update `appVersion` to 2.6.0
2020-07-03 10:04:24 +08:00
Sijie Guo
e6a2766e78
Update Pulsar Helm Chart README (#35) 2020-07-02 01:38:03 -07:00
Sijie Guo
0b719122b7
Add the release process (#34) 2020-07-02 00:11:02 -07:00
Sijie Guo
cfabdc9332
Release workflow should fetch all tags (#33)
*Motivation*

The helm chart release workflow should fetch all tags.
pulsar-2.6.0
2020-07-01 23:19:32 -07:00
Prashanth Tirupachur Vasanthakrishnan
bf152134b2
Issue-29: Bump missed out pulsar-image tags to 2.6.0 (#30)
Fixes #29 

### Motivation

Bumped missed out pulsar-image tags to 2.6.0

### Modifications

Modified the following files:
1. .ci/clusters/values-pulsar-image.yaml
2. charts/pulsar/values.yaml
3. examples/values-one-node.yaml
4. examples/values-pulsar.yaml
2020-07-01 23:01:39 -07:00
Sijie Guo
93d8fd1981
Release Helm Chart 2.6.0 (#21)
* Release Helm Chart 2.6.0
2020-06-29 18:16:16 -07:00
Sijie Guo
1c8a434ef6
Don't substitute environment variables (#28)
*Motivation*

environment variables are already taken by bash scripts. We don't need to substitute them.
2020-06-25 20:24:03 -07:00
tabalt
248f11c932
Fixed apache/pulsar-helm-chart#25 (#27) 2020-06-25 18:33:54 -07:00
Sijie Guo
9778ce2fe1
Remove double quotes from the environment variables (#24)
*Motivation*

Some of the environment variables still use double quotes. They result in the following

```bash
Could not find or load main class "
```
2020-06-23 10:14:23 -07:00
Julien Berard
6cddb81da1
Allow to change broker service account annotations (#22)
### Motivation

We need to be able to change annotation to inject AWS IAM role (EKS based deployment).
https://docs.aws.amazon.com/eks/latest/userguide/specify-service-account-role.html

With 2.6.0 and this annotation change we were able to use Tiered Storage with S3 and EKS/IAM(OIDC).

e.g : 
```
  annotations:
    eks.amazonaws.com/role-arn: arn:aws:iam::66666:role/my-iam-role-with-s3-access
```
values.yaml
```
broker:
  service_account:
    annotations:
      eks.amazonaws.com/role-arn: arn:aws:iam::66666:role/my-iam-role-with-s3-access
```
### Modifications

Added a value to allow to change annotations fro broker service account.
I've tried following style from other part of the code.

### Verifying this change

- [ ] Make sure that the change passes the CI checks.
2020-06-22 18:11:28 -07:00
Sijie Guo
d5a788e617
Update pulsar image to 2.6.0 (#20)
* Update pulsar image to 2.6.0

* Update the image to the official release image
2020-06-19 23:17:41 -07:00
Oscar Espitia
552e86c663
Remove newline from secret tokens generation (#18)
### Motivation

The secret resources generation was appending a newline at the end of the JWT token strings (```\n```). From my understanding, this is not an issue inside Pulsar likely because it trims the contents of the JWT programmatically. However, when setting pulsar as a sink destination for [Vector](https://vector.dev/) (vector produces messages into Pulsar), I noticed the token was always invalid due to this extra newline.

### Modifications

Remove newline from secret tokens generation by using the utility command tr. Granted, this is not the nicest way to go about it but given that the contents are JWT strings, it appears to do the job just fine while keeping everything else working (e.g.: producing/consuming as well as other components like Prometheus). Please advise if you have any concerns or suggestions.
2020-06-09 22:40:27 -07:00
Luke Stephenson
5914996e89
Removing reference to bastion pod (#14)
Has otherwise been cleaned up in f64c396906e9f99999ec14bd3ac7336e6609a86a
2020-05-29 17:33:54 -07:00
Matteo Merli
6e9ad25ba3
Use regular 2-2-2 BK client settings by default (#13)
Using write=3 and ack=2 leads to unbound memory usage in BK client when one bookie is slow or failing, so we should avoid it by default.
2020-05-21 21:52:53 -07:00
Luke Stephenson
96dbab924f
Support load balance source ip range (#12)
Grafana and pulsar manager now support restricting
the available IPs that can be used.
2020-05-18 01:24:58 -07:00
Luke Stephenson
45fd2c6878
symmetric / create_namespace flags were only working if last argument (#11)
Move defaults outside the while loop so they are not constantly reset

Fixes #10
2020-05-14 00:35:48 -07:00
Oscar Espitia
06652d7e8b
Decouple credentials from key secrets generation (#7)
Fixes #6 

### Motivation

As suggested here: https://pulsar.apache.org/docs/en/helm-deploy/#prepare-the-helm-release. The ```prepare_helm_release.sh``` script provided with this Helm chart can create a secret credentials resource and
> The username and password are used for logging into Grafana dashboard and Pulsar Manager.

However, I haven't been able to make use of such a feature for a number of reasons:

1. This secret doesn't seem to affect the ```pulsar-manager-deployment.yaml``` definition. Instead, the ```./templates/pulsar-manager-admin-secret.yaml``` seems to be the one providing the credentials for the pulsar manager (UI) (with the added possibility to overwrite via values.yaml at ```pulsar_manager.admin.user/password```).

2. Using the Pulsar chart as a dependency for an umbrella chart (this is currently my use case), will bring extra hassle that will make it very hard to have all resources follow the same naming structure, thus causing some resources to never be deployed successfully e.g.: ```./templates/grafana-deployment.yaml``` will complain that it couldn't find the secret created by the bash script. Attempting to fix this issue via the ```-k``` flag passed to the script will cause the JWT secret tokens to have a name that's unexpected by the broker, etc.

### Modifications

Decouple grafana credentials from pulsar manager via a new secret resource named ```./charts/pulsar/templates/grafana-admin-secret.yaml```.

Add credentials overriding via values.yaml in the same way as pulsar_manager (grafana.admin.user/password) & delete secret resource manipulation from bash scripts (cleaup_helm_release.sh & prepare_helm_release.sh)

### Verifying this change

- [x] Make sure that the change passes the CI checks.
2020-04-29 01:27:16 -07:00
Oscar Espitia
4009c04811
Update grafana & prometheus docker images (#8)
### Motivation

As seen below, there is a fix for one of the Grafana dashboards that are currently broken in this project (available since version 0.0.5):
- [The Pulsar-topics metrics can't load in Grafana](https://github.com/streamnative/charts/issues/49)

Additionally, upgrading Prometheus to the latest version improves performance as seen here: https://prometheus.io/blog/2017/11/08/announcing-prometheus-2-0

### Modifications

Bring Docker images to their most up-to-date version (streamnative/apache-pulsar-grafana-dashboard-k8s:0.0.6, prom/prometheus:v2.17.2) to fix the following issues:
- https://github.com/streamnative/charts/issues/49 <- fixes Pulsar-topics metrics failure to load
- https://github.com/prometheus/prometheus/pull/2859 <- prevent escalation vulnerabilities by defaulting to the ```nobody``` user

**Note**: upgrading to the latest version of Prometheus (currently v2.17.2) caused the pod to fail with the following error: ```open /prometheus/queries.active: permission denied```. In order to fix this issue I followed the instructions from these 2 comments:

- [Permission denied UID/GID solution](https://github.com/prometheus/prometheus/issues/5976#issuecomment-532942295)
- [Unable to create mmap-ed active query log securityContext fix](https://github.com/aws/eks-charts/issues/21#issuecomment-607031756)

### Verifying this change

- [x] Make sure that the change passes the CI checks.
2020-04-29 01:25:32 -07:00
Oscar Espitia
3e451fecb3
Fix namespace delete command in cleanup-helm-release.sh script (#5)
### Motivation

While making use of the scripts provided in this repo to prepare helm releases, I noticed that providing the ```-d``` flag (delete namespace) for the ```./scripts/pulsar/cleanup_helm_release.sh``` would always fail claiming that the **namespace already exists**. Upon closer examination, I noticed that the kubectl command to delete the provided namespace is actually attempting to create it instead.

### Modifications

I've gone ahead and made the corresponding modification on the script to delete the namespace (went from ```kubectl create namespace ${namespace}``` to ```kubectl delete namespace ${namespace}```).

### Verifying this change

I'm not sure what possible verifications I can provide for this PR. Please advise.
2020-04-27 00:11:45 -07:00
Sijie Guo
0338d17b89
Publish chart index to gh-pages branch (#3)
*Motivation*

Release helm chart when new tags are created
2020-04-21 02:44:58 -07:00
Sijie Guo
47f05b7650
Add github action to check license header (#2) v2.5.0 2020-04-21 00:23:01 -07:00
Sijie Guo
7dcf1c7aca
Enable CI for pulsar chart (#1) 2020-04-21 14:14:14 +08:00
Sijie Guo
f38711d581
Merge branch 'master' of https://github.com/apache/pulsar 2020-04-20 22:55:34 -07:00