From 11b7d1415199dae5e35061d54259c91c9cf8d520 Mon Sep 17 00:00:00 2001 From: Juan Ariza Toledano Date: Wed, 16 Dec 2020 13:53:03 +0100 Subject: [PATCH] [bitnami/jasperreports] New major version (#4744) --- bitnami/jasperreports/Chart.lock | 2 +- bitnami/jasperreports/Chart.yaml | 2 +- bitnami/jasperreports/README.md | 261 ++++++--- .../jasperreports/ci/values-with-ingress.yaml | 6 + bitnami/jasperreports/templates/NOTES.txt | 55 +- bitnami/jasperreports/templates/_helpers.tpl | 148 +----- .../jasperreports/templates/deployment.yaml | 114 ++-- .../templates/externaldb-secrets.yaml | 17 +- .../jasperreports/templates/extra-list.yaml | 4 + bitnami/jasperreports/templates/ingress.yaml | 71 +-- bitnami/jasperreports/templates/pvc.yaml | 23 +- bitnami/jasperreports/templates/secrets.yaml | 19 +- bitnami/jasperreports/templates/svc.yaml | 34 +- .../jasperreports/templates/tls-secrets.yaml | 44 ++ bitnami/jasperreports/values.yaml | 498 ++++++++++++------ 15 files changed, 808 insertions(+), 490 deletions(-) create mode 100644 bitnami/jasperreports/ci/values-with-ingress.yaml create mode 100644 bitnami/jasperreports/templates/extra-list.yaml create mode 100644 bitnami/jasperreports/templates/tls-secrets.yaml diff --git a/bitnami/jasperreports/Chart.lock b/bitnami/jasperreports/Chart.lock index 133b77c78b..02eb363c5d 100644 --- a/bitnami/jasperreports/Chart.lock +++ b/bitnami/jasperreports/Chart.lock @@ -6,4 +6,4 @@ dependencies: repository: https://charts.bitnami.com/bitnami version: 1.1.2 digest: sha256:1f9feee2b7e76d92206c4add08806931c512f89eccbf2ce0367ea3d1b095cdda -generated: "2020-12-11T12:20:55.814179+01:00" +generated: "2020-12-16T11:18:03.040481+01:00" diff --git a/bitnami/jasperreports/Chart.yaml b/bitnami/jasperreports/Chart.yaml index 86510021d3..cddf20bef4 100644 --- a/bitnami/jasperreports/Chart.yaml +++ b/bitnami/jasperreports/Chart.yaml @@ -30,4 +30,4 @@ name: jasperreports sources: - https://github.com/bitnami/bitnami-docker-jasperreports - http://community.jaspersoft.com/project/jasperreports-server -version: 9.1.2 +version: 10.0.0 diff --git a/bitnami/jasperreports/README.md b/bitnami/jasperreports/README.md index 5891647cd0..e3c255ce78 100644 --- a/bitnami/jasperreports/README.md +++ b/bitnami/jasperreports/README.md @@ -48,83 +48,131 @@ The command removes all the Kubernetes components associated with the chart and ## Parameters -The following table lists the configurable parameters of the JasperReports chart and their default values. +The following table lists the configurable parameters of the JasperReports chart and their default values per section/component: -| Parameter | Description | Default | -|----------------------------------|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| -| `global.imageRegistry` | Global Docker image registry | `nil` | -| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | -| `global.storageClass` | Global storage class for dynamic provisioning | `nil` | -| `image.registry` | JasperReports image registry | `docker.io` | -| `image.repository` | JasperReports Image name | `bitnami/jasperreports` | -| `image.tag` | JasperReports Image tag | `{TAG_NAME}` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | -| `nameOverride` | String to partially override jasperreports.fullname template with a string (will prepend the release name) | `nil` | -| `fullnameOverride` | String to fully override jasperreports.fullname template with a string | `nil` | -| `jasperreportsUsername` | User of the application | `user` | -| `jasperreportsPassword` | Application password | _random 10 character long alphanumeric string_ | -| `jasperreportsEmail` | User email | `user@example.com` | -| `smtpHost` | SMTP host | `nil` | -| `smtpPort` | SMTP port | `nil` | -| `smtpEmail` | SMTP email | `nil` | -| `smtpUser` | SMTP user | `nil` | -| `smtpPassword` | SMTP password | `nil` | -| `smtpProtocol` | SMTP protocol [`ssl`, `none`] | `nil` | -| `allowEmptyPassword` | Allow DB blank passwords | `yes` | -| `ingress.enabled` | Enable ingress controller resource | `false` | -| `ingress.annotations` | Ingress annotations | `[]` | -| `ingress.certManager` | Add annotations for cert-manager | `false` | -| `ingress.hosts[0].name` | Hostname to your JasperReports installation | `jasperreports.local` | -| `ingress.hosts[0].path` | Path within the url structure | `/` | -| `ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` | -| `ingress.hosts[0].tlsHosts` | Array of TLS hosts for ingress record (defaults to `ingress.hosts[0].name` if `nil`) | `nil` | -| `ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `jasperreports.local-tls-secret` | -| `ingress.secrets[0].name` | TLS Secret Name | `nil` | -| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | -| `ingress.secrets[0].key` | TLS Secret Key | `nil` | -| `service.type` | Kubernetes Service type | `LoadBalancer` | -| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | -| `service.port` | Service HTTP port | `80` | -| `service.nodePorts.http` | Kubernetes http node port | `""` | -| `service.annotations` | Service annotations | `[]` | -| `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.storageClass` | PVC Storage Class for JasperReports volume | `nil` (uses alpha storage annotation) | -| `persistence.accessMode` | PVC Access Mode for JasperReports volume | `ReadWriteOnce` | -| `persistence.size` | PVC Storage Request for JasperReports volume | `8Gi` | -| `resources` | CPU/Memory resource requests/limits | `{Memory: 512Mi, CPU: 300m}` | -| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | -| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` | -| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | -| `nodeAffinityPreset.key` | Node label key to match Ignored if `affinity` is set. | `""` | -| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` | -| `affinity` | Affinity for pod assignment | `{}` (evaluated as a template) | -| `nodeSelector` | Node labels for pod assignment | `{}` (evaluated as a template) | -| `tolerations` | Tolerations for pod assignment | `[]` (evaluated as a template) | +### Global parameters +| Parameter | Description | Default | +|-----------------------------------------|------------------------------------------------------------|---------------------------------------------------------| +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `global.storageClass` | Global storage class for dynamic provisioning | `nil` | + +### Common parameters + +| Parameter | Description | Default | +|-----------------------------------------|------------------------------------------------------------|---------------------------------------------------------| +| `nameOverride` | String to partially override common.names.fullname | `nil` | +| `fullnameOverride` | String to fully override common.names.fullname | `nil` | +| `commonLabels` | Labels to add to all deployed objects | `{}` | +| `commonAnnotations` | Annotations to add to all deployed objects | `{}` | +| `clusterDomain` | Default Kubernetes cluster domain | `cluster.local` | +| `extraDeploy` | Array of extra objects to deploy with the release | `[]` (evaluated as a template) | + +### JasperReports parameters + +| Parameter | Description | Default | +|-----------------------------------------|------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `image.registry` | JasperReports image registry | `docker.io` | +| `image.repository` | JasperReports image name | `bitnami/jasperreports` | +| `image.tag` | JasperReports image tag | `{TAG_NAME}` | +| `image.pullPolicy` | JasperReports image pull policy | `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `jasperreportsUsername` | JasperReports user | `user` | +| `jasperreportsPassword` | JasperReports password | _random 10 character long alphanumeric string_ | +| `jasperreportsEmail` | JasperReports user email | `user@example.com` | +| `smtpHost` | SMTP host | `nil` | +| `smtpPort` | SMTP port | `nil` | +| `smtpEmail` | SMTP email | `nil` | +| `smtpUser` | SMTP user | `nil` | +| `smtpPassword` | SMTP password | `nil` | +| `smtpProtocol` | SMTP protocol [`ssl`, `none`] | `nil` | +| `command` | Override default container command (useful when using custom images) | `nil` | +| `args` | Override default container args (useful when using custom images) | `nil` | +| `extraEnvVars` | Extra environment variables to be set on Jasperreports container | `{}` | +| `extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars | `nil` | +| `extraEnvVarsSecret` | Name of existing Secret containing extra env vars | `nil` | + +### Jasperreports deployment parameters + +| Parameter | Description | Default | +|-----------------------------------------|------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `containerPort` | HTTP port to expose at container level | `8080` | +| `podSecurityContext` | Jasperreports pods' Security Context | Check `values.yaml` file | +| `containerSecurityContext` | Jasperreports containers' Security Context | Check `values.yaml` file | +| `resources.limits` | The resources limits for the Jasperreports container | `{}` | +| `resources.requests` | The requested resources for the Jasperreports container | `{"memory": "512Mi", "cpu": "300m"}` | +| `leavinessProbe` | Leaviness probe configuration for Jasperreports | Check `values.yaml` file | +| `readinessProbe` | Readiness probe configuration for Jasperreports | Check `values.yaml` file | +| `customLivenessProbe` | Override default liveness probe | `nil` | +| `customReadinessProbe` | Override default readiness probe | `nil` | +| `updateStrategy` | Strategy to use to update Pods | Check `values.yaml` file | +| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | +| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` | +| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard`| `""` | +| `nodeAffinityPreset.key` | Node label key to match. Ignored if `affinity` is set. | `""` | +| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` | +| `affinity` | Affinity for pod assignment | `{}` (evaluated as a template) | +| `nodeSelector` | Node labels for pod assignment | `{}` (evaluated as a template) | +| `tolerations` | Tolerations for pod assignment | `[]` (evaluated as a template) | +| `lifecycleHooks` | LifecycleHooks to set additional configuration at startup. | `{}` (evaluated as a template) | +| `podLabels` | Extra labels for Jasperreports pods | `{}` (evaluated as a template) | +| `podAnnotations` | Annotations for Jasperreports pods | `{}` (evaluated as a template) | +| `extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for Jasperreports container(s) | `[]` | +| `extraVolumes` | Optionally specify extra list of additional volumes for Jasperreports pods | `[]` | +| `initContainers` | Add additional init containers to the Jasperreports pods | `{}` (evaluated as a template) | +| `sidecars` | Add additional sidecar containers to the Jasperreports pods | `{}` (evaluated as a template) | +| `persistence.enabled` | Enable persistence using PVC | `true` | +| `persistence.storageClass` | PVC Storage Class for Jasperreports volume | `nil` (uses alpha storage class annotation) | +| `persistence.existingClaim` | An Existing PVC name for Jasperreports volume | `nil` (uses alpha storage class annotation) | +| `persistence.accessMode` | PVC Access Mode for Jasperreports volume | `ReadWriteOnce` | +| `persistence.size` | PVC Storage Request for Jasperreports volume | `8Gi` | + +### Exposure parameters + +| Parameter | Description | Default | +|-----------------------------------------|------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `service.type` | Kubernetes Service type | `LoadBalancer` | +| `service.port` | Service HTTP port | `80` | +| `service.nodePort` | Kubernetes http node port | `""` | +| `service.loadBalancerIP` | Kubernetes LoadBalancerIP to request | `nil` | +| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | +| `service.annotations` | Annotations for Jasperreports service | `{}` (evaluated as a template) | +| `ingress.enabled` | Enable ingress controller resource | `false` | +| `ingress.certManager` | Add annotations for cert-manager | `false` | +| `ingress.hostname` | Default host for the ingress resource | `jasperreports.local` | +| `ingress.tls` | Enable TLS configuration for the hostname defined at `ingress.hostname` parameter | `false` | +| `ingress.annotations` | Ingress annotations | `{}` (evaluated as a template) | +| `ingress.extraHosts[0].name` | Additional hostnames to be covered | `nil` | +| `ingress.extraHosts[0].path` | Additional hostnames to be covered | `nil` | +| `ingress.extraTls[0].hosts[0]` | TLS configuration for additional hostnames to be covered | `nil` | +| `ingress.extraTls[0].secretName` | TLS configuration for additional hostnames to be covered | `nil` | +| `ingress.secrets[0].name` | TLS Secret Name | `nil` | +| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` | +| `ingress.secrets[0].key` | TLS Secret Key | `nil` | ### Database parameters -| Parameter | Description | Default | -|--------------------------------------------|-------------------------------------------------------|------------------------------------------------| -| `mariadb.enabled` | Whether to use the MariaDB chart | `true` | -| `mariadb.architecture` | MariaDB architecture (`standalone` or `replication`) | `standalone` | -| `mariadb.auth.rootPassword` | Password for the MariaDB `root` user | _random 10 character alphanumeric string_ | -| `mariadb.auth.database` | Database name to create | `bitnami_jasperreports` | -| `mariadb.auth.username` | Database user to create | `bn_jasperreports` | -| `mariadb.auth.password` | Password for the database | _random 10 character long alphanumeric string_ | -| `mariadb.primary.persistence.enabled` | Enable database persistence using PVC | `true` | -| `mariadb.primary.persistence.accessMode` | Database Persistent Volume Access Modes | `ReadWriteOnce` | -| `mariadb.primary.persistence.size` | Database Persistent Volume Size | `8Gi` | -| `mariadb.primary.persistence.existingClaim`| Enable persistence using an existing PVC | `nil` | -| `mariadb.primary.persistence.storageClass` | PVC Storage Class | `nil` (uses alpha storage class annotation) | -| `mariadb.primary.persistence.hostPath` | Host mount path for MariaDB volume | `nil` (will not mount to a host path) | -| `externalDatabase.user` | Existing username in the external db | `bn_jasperreports` | -| `externalDatabase.password` | Password for the above username | `nil` | -| `externalDatabase.database` | Name of the existing database | `bitnami_jasperreports` | -| `externalDatabase.host` | Host of the existing database | `nil` | -| `externalDatabase.port` | Port of the existing database | `3306` | -| `externalDatabase.existingSecret` | Name of the database existing Secret Object | `nil` | +| Parameter | Description | Default | +|--------------------------------------------|---------------------------------------------------------------------------------------|------------------------------------------------| +| `mariadb.enabled` | Whether to use the MariaDB chart | `true` | +| `mariadb.architecture` | MariaDB architecture (`standalone` or `replication`) | `standalone` | +| `mariadb.auth.rootPassword` | Password for the MariaDB `root` user | _random 10 character alphanumeric string_ | +| `mariadb.auth.database` | Database name to create | `bitnami_jasperreports` | +| `mariadb.auth.username` | Database user to create | `bn_jasperreports` | +| `mariadb.auth.password` | Password for the database | _random 10 character long alphanumeric string_ | +| `mariadb.primary.persistence.enabled` | Enable database persistence using PVC | `true` | +| `mariadb.primary.persistence.accessMode` | Database Persistent Volume Access Modes | `ReadWriteOnce` | +| `mariadb.primary.persistence.size` | Database Persistent Volume Size | `8Gi` | +| `mariadb.primary.persistence.existingClaim`| Enable persistence using an existing PVC | `nil` | +| `mariadb.primary.persistence.storageClass` | PVC Storage Class | `nil` (uses alpha storage class annotation) | +| `mariadb.primary.persistence.hostPath` | Host mount path for MariaDB volume | `nil` (will not mount to a host path) | +| `externalDatabase.user` | Existing username in the external db | `bn_jasperreports` | +| `externalDatabase.password` | Password for the above username | `nil` | +| `externalDatabase.database` | Name of the existing database | `bitnami_jasperreports` | +| `externalDatabase.host` | Host of the existing database | `nil` | +| `externalDatabase.port` | Port of the existing database | `3306` | +| `externalDatabase.existingSecret` | Name of the database existing Secret Object | `nil` | The above parameters map to the env variables defined in [bitnami/jasperreports](http://github.com/bitnami/bitnami-docker-jasperreports). For more information please refer to the [bitnami/jasperreports](http://github.com/bitnami/bitnami-docker-jasperreports) image documentation. @@ -132,7 +180,7 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm ```console $ helm install my-release \ - --set jasperreportsUsername=admin,jasperreportsPassword=password,mariadb.mariadbRootPassword=secretpassword \ + --set jasperreportsUsername=admin,jasperreportsPassword=password,mariadb.auth.rootPassword=secretpassword \ bitnami/jasperreports ``` @@ -154,12 +202,6 @@ It is strongly recommended to use immutable tags in a production environment. Th Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist. -### Setting Pod's affinity - -This chart allows you to set your custom affinity using the `affinity` parameter. Find more information about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity). - -As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `podAffinityPreset`, `podAntiAffinityPreset`, or `nodeAffinityPreset` parameters. - ## Persistence The [Bitnami JasperReports](https://github.com/bitnami/bitnami-docker-jasperreports) image stores the JasperReports data and configurations at the `/bitnami/jasperreports` path of the container. @@ -167,13 +209,72 @@ The [Bitnami JasperReports](https://github.com/bitnami/bitnami-docker-jasperrepo Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. See the [Parameters](#parameters) section to configure the PVC or to disable persistence. +### Adding extra environment variables + +In case you want to add extra environment variables (useful for advanced operations like custom init scripts), you can use the `extraEnvVars` property. + +```yaml +extraEnvVars: + - name: LOG_LEVEL + value: DEBUG +``` + +Alternatively, you can use a ConfigMap or a Secret with the environment variables. To do so, use the `extraEnvVarsCM` or the `extraEnvVarsSecret` values. + +### Sidecars and Init Containers + +If you have a need for additional containers to run within the same pod as the JasperReports app (e.g. an additional metrics or logging exporter), you can do so via the `sidecars` config parameter. Simply define your container according to the Kubernetes container spec. + +```yaml +sidecars: + - name: your-image-name + image: your-image + imagePullPolicy: Always + ports: + - name: portname + containerPort: 1234 +``` + +Similarly, you can add extra init containers using the `initContainers` parameter. + +```yaml +initContainers: + - name: your-image-name + image: your-image + imagePullPolicy: Always + ports: + - name: portname + containerPort: 1234 +``` + +### Setting Pod's affinity + +This chart allows you to set your custom affinity using the `affinity` parameter. Find more information about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity). + +As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `podAffinityPreset`, `podAntiAffinityPreset`, or `nodeAffinityPreset` parameters. + ## Troubleshooting Find more information about how to deal with common errors related to Bitnami’s Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues). ## Upgrading -## Upgrading +### To 10.0.0 + +- Chart labels were adapted to follow the [Helm charts standard labels](https://helm.sh/docs/chart_best_practices/labels/#standard-labels). +- Ingress configuration was also adapted to follow the Helm charts best practices. + +Consequences: + +- Backwards compatibility is not guaranteed. However, you can easily workaround this issue by removing JasperReports deployment before upgrading (the following example assumes that the release name is `jasperreports`): + +```console +$ export JASPER_PASSWORD=$(kubectl get secret --namespace default jasperreports -o jsonpath="{.data.jasperreports-password}" | base64 --decode) +$ export MARIADB_ROOT_PASSWORD=$(kubectl get secret --namespace default jasperreports-mariadb -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) +$ export MARIADB_PASSWORD=$(kubectl get secret --namespace default jasperreports-mariadb -o jsonpath="{.data.mariadb-password}" | base64 --decode) +$ kubectl delete deployments.apps jasperreports +$ helm upgrade jasperreports bitnami/jasperreports --set jasperreportsPassword=$JASPER_PASSWORD,mariadb.auth.rootPassword=$MARIADB_ROOT_PASSWORD,mariadb.auth.password=$MARIADB_PASSWORD +``` ### To 9.0.0 diff --git a/bitnami/jasperreports/ci/values-with-ingress.yaml b/bitnami/jasperreports/ci/values-with-ingress.yaml new file mode 100644 index 0000000000..f705732189 --- /dev/null +++ b/bitnami/jasperreports/ci/values-with-ingress.yaml @@ -0,0 +1,6 @@ +service: + type: ClusterIP +ingress: + enabled: true + tls: true + hostname: jasperreports.local diff --git a/bitnami/jasperreports/templates/NOTES.txt b/bitnami/jasperreports/templates/NOTES.txt index 710efbeac7..884fb30db7 100644 --- a/bitnami/jasperreports/templates/NOTES.txt +++ b/bitnami/jasperreports/templates/NOTES.txt @@ -1,41 +1,47 @@ -{{- if or .Values.mariadb.enabled .Values.externalDatabase.host -}} -1. Get the JasperReports URL: +** Please be patient while the chart is being deployed ** + +{{- if or .Values.mariadb.enabled .Values.externalDatabase.host -}} {{- if .Values.ingress.enabled }} - You should be able to access your new JasperReports installation through +1. Get the JasperReports URL and associate its hostname to your cluster external IP: - {{- range .Values.ingress.hosts }} - {{ if .tls }}https{{ else }}http{{ end }}://{{ .name }}/jasperserver/ - {{- end }} + export CLUSTER_IP=$(minikube ip) # On Minikube. Use: `kubectl cluster-info` on others K8s clusters + echo "JasperReports URL: http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}" + echo "$CLUSTER_IP {{ .Values.ingress.hostname }}" | sudo tee -a /etc/hosts -{{- else if contains "NodePort" .Values.service.type }} +{{- else }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "jasperreports.fullname" . }}) +1. Get the JasperReports URL: + +{{- if contains "NodePort" .Values.service.type }} + + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "common.names.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo "JasperReports URL: http://$NODE_IP:$NODE_PORT/" + echo "JasperReports URL: http://$NODE_IP:$NODE_PORT" {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "jasperreports.fullname" . }}' + Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "common.names.fullname" . }}' -{{- $port:=.Values.service.port | toString }} - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "jasperreports.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo "JasperReports URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/jasperserver/" + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "common.names.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + {{- $port:=.Values.service.port | toString }} + echo "JasperReports URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/" {{- else if contains "ClusterIP" .Values.service.type }} - echo "JasperReports URL: http://127.0.0.1:8080/jasperserver/" - kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "jasperreports.fullname" . }} 8080:{{ .Values.service.port }} + kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "common.names.fullname" . }} 8080:{{ .Values.service.port }} & + echo "JasperReports URL: http://127.0.0.1:8080/" {{- end }} +{{- end }} 2. Login with the following credentials echo Username: {{ .Values.jasperreportsUsername }} - echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "jasperreports.fullname" . }} -o jsonpath="{.data.jasperreports-password}" | base64 --decode) + echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "common.names.fullname" . }} -o jsonpath="{.data.jasperreports-password}" | base64 --decode) {{- else -}} @@ -46,16 +52,19 @@ This deployment will be incomplete until you configure JasperReports with a resolvable database host. To configure JasperReports to use and external database host: - 1. Complete your JasperReports deployment by running: helm upgrade {{ .Release.Name }} --set service.type={{ .Values.service.type }},mariadb.enabled=false,externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST bitnami/jasperreports {{- end }} -{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }} - -WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment. -+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/ - -{{- end }} +{{- include "jasperreports.checkRollingTags" . }} +{{- $passwordValidationErrors := list -}} +{{- $secretName := include "common.names.fullname" . -}} +{{- $requiredJasperReportsPassword := dict "valueKey" "jasperreportsPassword" "secret" $secretName "field" "jasperreports-password" "context" $ -}} +{{- $requiredJasperReportsPasswordError := include "common.validations.values.single.empty" $requiredJasperReportsPassword -}} +{{- $passwordValidationErrors = append $passwordValidationErrors $requiredJasperReportsPasswordError -}} +{{- $mariadbSecretName := include "jasperreports.databaseSecretName" . -}} +{{- $mariadbPasswordValidationErrors := include "common.validations.values.mariadb.passwords" (dict "secret" $mariadbSecretName "subchart" true "context" $) -}} +{{- $passwordValidationErrors = append $passwordValidationErrors $mariadbPasswordValidationErrors -}} +{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $) -}} diff --git a/bitnami/jasperreports/templates/_helpers.tpl b/bitnami/jasperreports/templates/_helpers.tpl index 0336316c52..0bd81c3268 100644 --- a/bitnami/jasperreports/templates/_helpers.tpl +++ b/bitnami/jasperreports/templates/_helpers.tpl @@ -1,33 +1,17 @@ {{/* vim: set filetype=mustache: */}} + {{/* -Expand the name of the chart. +Return the proper Jasper Reports image name */}} -{{- define "jasperreports.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- define "jasperreports.image" -}} +{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} {{- end -}} {{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +Return the proper Docker Image Registry Secret Names */}} -{{- define "jasperreports.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "jasperreports.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- define "jasperreports.imagePullSecrets" -}} +{{- include "common.images.pullSecrets" (dict "images" (list .Values.image) "global" .Values.global) -}} {{- end -}} {{/* @@ -35,104 +19,10 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "jasperreports.mariadb.fullname" -}} -{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Return the proper Jasper Reports image name -*/}} -{{- define "jasperreports.image" -}} -{{- $registryName := .Values.image.registry -}} -{{- $repositoryName := .Values.image.repository -}} -{{- $tag := .Values.image.tag | toString -}} -{{/* -Helm 2.11 supports the assignment of a value to a variable defined in a different scope, -but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. -Also, we can't use a single if because lazy evaluation is not an option -*/}} -{{- if .Values.global }} - {{- if .Values.global.imageRegistry }} - {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} - {{- else -}} - {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} - {{- end -}} +{{- if .Values.fullnameOverride -}} +{{- printf "%s-mariadb" .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- else -}} - {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} -{{- end -}} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names -*/}} -{{- define "jasperreports.imagePullSecrets" -}} -{{/* -Helm 2.11 supports the assignment of a value to a variable defined in a different scope, -but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic. -Also, we can not use a single if because lazy evaluation is not an option -*/}} -{{- if .Values.global }} -{{- if .Values.global.imagePullSecrets }} -imagePullSecrets: -{{- range .Values.global.imagePullSecrets }} - - name: {{ . }} -{{- end }} -{{- else if .Values.image.pullSecrets }} -imagePullSecrets: -{{- range .Values.image.pullSecrets }} - - name: {{ . }} -{{- end }} -{{- end -}} -{{- else if .Values.image.pullSecrets }} -imagePullSecrets: -{{- range .Values.image.pullSecrets }} - - name: {{ . }} -{{- end }} -{{- end -}} -{{- end -}} - -{{/* -Return the proper Storage Class -*/}} -{{- define "jasperreports.storageClass" -}} -{{/* -Helm 2.11 supports the assignment of a value to a variable defined in a different scope, -but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic. -*/}} -{{- if .Values.global -}} - {{- if .Values.global.storageClass -}} - {{- if (eq "-" .Values.global.storageClass) -}} - {{- printf "storageClassName: \"\"" -}} - {{- else }} - {{- printf "storageClassName: %s" .Values.global.storageClass -}} - {{- end -}} - {{- else -}} - {{- if .Values.persistence.storageClass -}} - {{- if (eq "-" .Values.persistence.storageClass) -}} - {{- printf "storageClassName: \"\"" -}} - {{- else }} - {{- printf "storageClassName: %s" .Values.persistence.storageClass -}} - {{- end -}} - {{- end -}} - {{- end -}} -{{- else -}} - {{- if .Values.persistence.storageClass -}} - {{- if (eq "-" .Values.persistence.storageClass) -}} - {{- printf "storageClassName: \"\"" -}} - {{- else }} - {{- printf "storageClassName: %s" .Values.persistence.storageClass -}} - {{- end -}} - {{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for deployment. -*/}} -{{- define "jasperreports.deployment.apiVersion" -}} -{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} -{{- print "extensions/v1beta1" -}} -{{- else -}} -{{- print "apps/v1" -}} +{{- printf "%s-mariadb" .Release.Name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- end -}} @@ -196,3 +86,21 @@ Return the MariaDB Secret Name {{- printf "%s-%s" .Release.Name "externaldb" -}} {{- end -}} {{- end -}} + +{{/* +Return the database password key +*/}} +{{- define "jasperreports.databasePasswordKey" -}} +{{- if .Values.mariadb.enabled -}} +mariadb-password +{{- else -}} +db-password +{{- end -}} +{{- end -}} + +{{/* +Check if there are rolling tags in the images +*/}} +{{- define "jasperreports.checkRollingTags" -}} +{{- include "common.warnings.rollingTag" .Values.image }} +{{- end -}} diff --git a/bitnami/jasperreports/templates/deployment.yaml b/bitnami/jasperreports/templates/deployment.yaml index dc590d1518..4dad78c88c 100644 --- a/bitnami/jasperreports/templates/deployment.yaml +++ b/bitnami/jasperreports/templates/deployment.yaml @@ -1,23 +1,28 @@ -apiVersion: {{ template "jasperreports.deployment.apiVersion" . }} +apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} kind: Deployment metadata: - name: {{ template "jasperreports.fullname" . }} - labels: - app.kubernetes.io/name: "{{ include "jasperreports.fullname" . }}" - helm.sh/chart: "{{ include "jasperreports.chart" . }}" - app.kubernetes.io/instance: {{ .Release.Name | quote }} - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + name: {{ template "common.names.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} spec: selector: - matchLabels: - app.kubernetes.io/name: "{{ include "jasperreports.fullname" . }}" - app.kubernetes.io/instance: {{ .Release.Name | quote }} + matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + strategy: {{- include "common.tplvalues.render" (dict "value" .Values.updateStrategy "context" $ ) | nindent 4 }} template: metadata: - labels: - app.kubernetes.io/name: "{{ include "jasperreports.fullname" . }}" - helm.sh/chart: "{{ include "jasperreports.chart" . }}" - app.kubernetes.io/instance: {{ .Release.Name | quote }} + labels: {{- include "common.labels.standard" . | nindent 8 }} + {{- if .Values.podLabels }} + {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} + {{- end }} + {{- if .Values.podAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} + {{- end }} spec: {{- include "jasperreports.imagePullSecrets" . | nindent 6 }} {{- if .Values.affinity }} @@ -34,10 +39,28 @@ spec: {{- if .Values.tolerations }} tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }} {{- end }} + {{- if .Values.podSecurityContext.enabled }} + securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} + {{- end }} + {{- if .Values.initContainers }} + initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} + {{- end }} containers: - - name: {{ template "jasperreports.fullname" . }} + - name: jasperreports image: {{ template "jasperreports.image" . }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }} + {{- if .Values.lifecycleHooks }} + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.containerSecurityContext.enabled }} + securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.command }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.args }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} + {{- end }} env: - name: ALLOW_EMPTY_PASSWORD value: {{ .Values.allowEmptyPassword | quote }} @@ -53,13 +76,13 @@ spec: valueFrom: secretKeyRef: name: {{ include "jasperreports.databaseSecretName" . }} - key: mariadb-password + key: {{ include "jasperreports.databasePasswordKey" . }} - name: JASPERREPORTS_USERNAME value: {{ .Values.jasperreportsUsername | quote }} - name: JASPERREPORTS_PASSWORD valueFrom: secretKeyRef: - name: {{ template "jasperreports.fullname" . }} + name: {{ template "common.names.fullname" . }} key: jasperreports-password - name: JASPERREPORTS_EMAIL value: {{ .Values.jasperreportsEmail | quote }} @@ -83,41 +106,60 @@ spec: - name: SMTP_PASSWORD valueFrom: secretKeyRef: - name: {{ template "jasperreports.fullname" . }} + name: {{ template "common.names.fullname" . }} key: smtp-password {{- end }} {{- if .Values.smtpProtocol }} - name: SMTP_PROTOCOL value: {{ .Values.smtpProtocol | quote }} {{- end }} + {{- if .Values.extraEnvVars }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} + {{- end }} + {{- if or .Values.extraEnvVarsCM .Values.extraEnvVarsSecret }} + envFrom: + {{- if .Values.extraEnvVarsCM }} + - configMapRef: + name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }} + {{- end }} + {{- if .Values.extraEnvVarsSecret }} + - secretRef: + name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} + {{- end }} + {{- end }} ports: - name: http - containerPort: 8080 - livenessProbe: - httpGet: - path: /jasperserver/login.html - port: http - initialDelaySeconds: 300 - timeoutSeconds: 5 - failureThreshold: 6 - readinessProbe: - httpGet: - path: /jasperserver/login.html - port: http - initialDelaySeconds: 30 - timeoutSeconds: 3 - periodSeconds: 5 + containerPort: {{ .Values.containerPort }} + {{- if .Values.livenessProbe.enabled }} + livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }} + {{- else if .Values.customLivenessProbe }} + livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.readinessProbe.enabled }} + readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }} + {{- else if .Values.customReadinessProbe }} + readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} + {{- end }} {{- if .Values.resources }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- end }} volumeMounts: - name: jasperreports-data mountPath: /bitnami/jasperreports + {{- if .Values.extraVolumeMounts }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.sidecars }} + {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} + {{- end }} volumes: - name: jasperreports-data - {{- if .Values.persistence.enabled }} + {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ template "jasperreports.fullname" . }} - {{- else }} + claimName: {{ template "common.names.fullname" . }} + {{- else }} emptyDir: {} + {{- end }} + {{- if .Values.extraVolumes }} + {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }} {{- end }} diff --git a/bitnami/jasperreports/templates/externaldb-secrets.yaml b/bitnami/jasperreports/templates/externaldb-secrets.yaml index 4230b004cb..2b58dba7d1 100644 --- a/bitnami/jasperreports/templates/externaldb-secrets.yaml +++ b/bitnami/jasperreports/templates/externaldb-secrets.yaml @@ -2,13 +2,16 @@ apiVersion: v1 kind: Secret metadata: - name: {{ printf "%s-%s" .Release.Name "externaldb" }} - labels: - app.kubernetes.io/name: "{{ include "jasperreports.fullname" . }}" - helm.sh/chart: "{{ include "jasperreports.chart" . }}" - app.kubernetes.io/instance: {{ .Release.Name | quote }} - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + name: {{ printf "%s-externaldb" (include "common.names.fullname" .) }} + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} type: Opaque data: - mariadb-password: {{ default "" .Values.externalDatabase.password | b64enc | quote }} + db-password: {{ .Values.externalDatabase.password | b64enc | quote }} {{- end }} diff --git a/bitnami/jasperreports/templates/extra-list.yaml b/bitnami/jasperreports/templates/extra-list.yaml new file mode 100644 index 0000000000..9ac65f9e16 --- /dev/null +++ b/bitnami/jasperreports/templates/extra-list.yaml @@ -0,0 +1,4 @@ +{{- range .Values.extraDeploy }} +--- +{{ include "common.tplvalues.render" (dict "value" . "context" $) }} +{{- end }} diff --git a/bitnami/jasperreports/templates/ingress.yaml b/bitnami/jasperreports/templates/ingress.yaml index c0776a418c..c5d3d3d916 100644 --- a/bitnami/jasperreports/templates/ingress.yaml +++ b/bitnami/jasperreports/templates/ingress.yaml @@ -1,43 +1,54 @@ {{- if .Values.ingress.enabled }} -apiVersion: extensions/v1beta1 +apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} kind: Ingress metadata: - name: {{ template "jasperreports.fullname" . }} - labels: - app.kubernetes.io/name: "{{ include "jasperreports.fullname" . }}" - helm.sh/chart: "{{ include "jasperreports.chart" . }}" - app.kubernetes.io/instance: {{ .Release.Name | quote }} - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + name: {{ template "common.names.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if or .Values.ingress.annotations .Values.commonAnnotations .Values.ingress.certManager }} annotations: {{- if .Values.ingress.certManager }} kubernetes.io/tls-acme: "true" {{- end }} - {{- range $key, $value := .Values.ingress.annotations }} - {{ $key }}: {{ $value | quote }} + {{- if .Values.ingress.annotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.ingress.annotations "context" $ ) | nindent 4 }} {{- end }} + {{- if .Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} + {{- end }} spec: rules: - {{- range .Values.ingress.hosts }} - - host: {{ .name }} - http: - paths: - - path: {{ default "/" .path }} - backend: - serviceName: {{ template "jasperreports.fullname" $ }} - servicePort: http - {{- end }} + {{- if .Values.ingress.hostname }} + - host: {{ .Values.ingress.hostname }} + http: + paths: + - path: / + backend: + serviceName: {{ include "common.names.fullname" . }} + servicePort: http + {{- end }} + {{- range .Values.ingress.extraHosts }} + - host: {{ .name }} + http: + paths: + - path: {{ default "/" .path }} + backend: + serviceName: {{ include "common.names.fullname" $ }} + servicePort: http + {{- end }} + {{- if or .Values.ingress.tls .Values.ingress.extraTls }} tls: - {{- range .Values.ingress.hosts }} - {{- if .tls }} - - hosts: - {{- if .tlsHosts }} - {{- range $host := .tlsHosts }} - - {{ $host }} - {{- end }} - {{- else }} - - {{ .name }} - {{- end }} - secretName: {{ .tlsSecret }} - {{- end }} + {{- if .Values.ingress.tls }} + - hosts: + - {{ .Values.ingress.hostname }} + secretName: {{ printf "%s-tls" .Values.ingress.hostname }} + {{- end }} + {{- if .Values.ingress.extraTls }} + {{- include "common.tplvalues.render" ( dict "value" .Values.ingress.extraTls "context" $ ) | nindent 4 }} + {{- end }} {{- end }} {{- end }} diff --git a/bitnami/jasperreports/templates/pvc.yaml b/bitnami/jasperreports/templates/pvc.yaml index 647138df24..3602432515 100644 --- a/bitnami/jasperreports/templates/pvc.yaml +++ b/bitnami/jasperreports/templates/pvc.yaml @@ -1,18 +1,23 @@ -{{- if .Values.persistence.enabled -}} +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ template "jasperreports.fullname" . }} - labels: - app.kubernetes.io/name: "{{ include "jasperreports.fullname" . }}" - helm.sh/chart: "{{ include "jasperreports.chart" . }}" - app.kubernetes.io/instance: {{ .Release.Name | quote }} - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + name: {{ include "common.names.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} spec: accessModes: - - {{ .Values.persistence.accessMode | quote }} + {{- range .Values.persistence.accessModes }} + - {{ . | quote }} + {{- end }} resources: requests: storage: {{ .Values.persistence.size | quote }} - {{ include "jasperreports.storageClass" . }} + {{- include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) | nindent 2 }} {{- end -}} diff --git a/bitnami/jasperreports/templates/secrets.yaml b/bitnami/jasperreports/templates/secrets.yaml index 330e462c06..3eacd34ec6 100644 --- a/bitnami/jasperreports/templates/secrets.yaml +++ b/bitnami/jasperreports/templates/secrets.yaml @@ -1,19 +1,22 @@ apiVersion: v1 kind: Secret metadata: - name: {{ template "jasperreports.fullname" . }} - labels: - app.kubernetes.io/name: "{{ include "jasperreports.fullname" . }}" - helm.sh/chart: "{{ include "jasperreports.chart" . }}" - app.kubernetes.io/instance: {{ .Release.Name | quote }} - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + name: {{ template "common.names.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} type: Opaque data: {{- if .Values.jasperreportsPassword }} - jasperreports-password: {{ default "" .Values.jasperreportsPassword | b64enc | quote }} + jasperreports-password: {{ .Values.jasperreportsPassword | b64enc | quote }} {{- else }} jasperreports-password: {{ randAlphaNum 10 | b64enc | quote }} {{- end }} {{- if .Values.smtpPassword }} - smtp-password: {{ default "" .Values.smtpPassword | b64enc | quote }} + smtp-password: {{ .Values.smtpPassword | b64enc | quote }} {{- end }} diff --git a/bitnami/jasperreports/templates/svc.yaml b/bitnami/jasperreports/templates/svc.yaml index f6419047aa..a5364875a4 100644 --- a/bitnami/jasperreports/templates/svc.yaml +++ b/bitnami/jasperreports/templates/svc.yaml @@ -1,20 +1,26 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "jasperreports.fullname" . }} - {{- if .Values.service.annotations }} + name: {{ template "common.names.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if or .Values.service.annotations .Values.commonAnnotations }} annotations: - {{- range $key, $value := .Values.service.annotations }} - {{ $key }}: {{ $value | quote }} + {{- if .Values.service.annotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} {{- end }} - labels: - app.kubernetes.io/name: "{{ include "jasperreports.fullname" . }}" - helm.sh/chart: "{{ include "jasperreports.chart" . }}" - app.kubernetes.io/instance: {{ .Release.Name | quote }} - app.kubernetes.io/managed-by: {{ .Release.Service | quote }} spec: type: {{ .Values.service.type }} + {{- if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{- end }} {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} {{- end }} @@ -22,9 +28,9 @@ spec: - name: http port: {{ .Values.service.port }} targetPort: http - {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}} - nodePort: {{ .Values.service.nodePorts.http }} + {{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePort)) }} + nodePort: {{ .Values.service.nodePort }} + {{- else if eq .Values.service.type "ClusterIP" }} + nodePort: null {{- end }} - selector: - app.kubernetes.io/name: {{ include "jasperreports.fullname" . }} - app.kubernetes.io/instance: {{ .Release.Name | quote }} + selector: {{ include "common.labels.matchLabels" . | nindent 4 }} diff --git a/bitnami/jasperreports/templates/tls-secrets.yaml b/bitnami/jasperreports/templates/tls-secrets.yaml new file mode 100644 index 0000000000..e340282e80 --- /dev/null +++ b/bitnami/jasperreports/templates/tls-secrets.yaml @@ -0,0 +1,44 @@ +{{- if .Values.ingress.enabled }} +{{- if .Values.ingress.secrets }} +{{- range .Values.ingress.secrets }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .name }} + namespace: {{ $.Release.Namespace }} + labels: {{- include "common.labels.standard" $ | nindent 4 }} + {{- if $.Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if $.Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +type: kubernetes.io/tls +data: + tls.crt: {{ .certificate | b64enc }} + tls.key: {{ .key | b64enc }} +--- +{{- end }} +{{- end }} +{{- if and .Values.ingress.tls (not .Values.ingress.certManager) }} +{{- $ca := genCA "jasperreports-ca" 365 }} +{{- $cert := genSignedCert .Values.ingress.hostname nil (list .Values.ingress.hostname) 365 $ca }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ printf "%s-tls" .Values.ingress.hostname }} + namespace: {{ .Release.Namespace }} + labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} + {{- end }} +type: kubernetes.io/tls +data: + tls.crt: {{ $cert.Cert | b64enc | quote }} + tls.key: {{ $cert.Key | b64enc | quote }} + ca.crt: {{ $ca.Cert | b64enc | quote }} +{{- end }} +{{- end }} diff --git a/bitnami/jasperreports/values.yaml b/bitnami/jasperreports/values.yaml index 110756e03c..4dea96a0da 100644 --- a/bitnami/jasperreports/values.yaml +++ b/bitnami/jasperreports/values.yaml @@ -23,18 +23,36 @@ image: ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## Example: + ## pullSecrets: + ## - myRegistryKeySecretName ## - # pullSecrets: - # - myRegistryKeySecretName + pullSecrets: [] -## String to partially override jasperreports.fullname template (will maintain the release name) +## String to partially override common.names.fullname template (will maintain the release name) ## # nameOverride: -## String to fully override jasperreports.fullname template +## String to fully override common.names.fullname template ## # fullnameOverride: +## Add labels to all the deployed resources +## +commonLabels: {} + +## Add annotations to all the deployed resources +## +commonAnnotations: {} + +## Kubernetes Cluster Domain +## +clusterDomain: cluster.local + +## Extra objects to deploy (value evaluated as a template) +## +extraDeploy: [] + ## User of the application ## ref: https://github.com/bitnami/bitnami-docker-jasperreports#configuration ## @@ -55,6 +73,321 @@ jasperreportsEmail: user@example.com ## ref: https://github.com/bitnami/bitnami-docker-jasperreports#environment-variables allowEmptyPassword: "yes" +## SMTP mail delivery configuration +## ref: https://github.com/bitnami/bitnami-docker-jasperreports#smtp-configuration +## +# smtpHost: +# smtpPort: +# smtpEmail: +# smtpUser: +# smtpPassword: +# smtpProtocol: + +## Command and args for running the container (set to default if not set). Use array form +## +command: [] +args: [] + +## An array to add extra env vars +## Example: +## extraEnvVars: +## - name: FOO +## value: "bar" +## +extraEnvVars: [] + +## ConfigMap with extra environment variables +## +extraEnvVarsCM: + +## Secret with extra environment variables +## +extraEnvVarsSecret: + +## Strategy to use to update Pods +## +updateStrategy: + ## StrategyType + ## Can be set to RollingUpdate or OnDelete + ## + type: RollingUpdate + +## JasperReports container ports to open +## +containerPort: 8080 + +## JasperReports pods' Security Context +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container +## +podSecurityContext: + enabled: true + fsGroup: 0 + +## JasperReports containers' SecurityContext +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod +## +containerSecurityContext: + enabled: true + runAsUser: 0 + +## JasperReports resource requests and limits +## ref: http://kubernetes.io/docs/user-guide/compute-resources/ +## +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: {} + # cpu: 200m + # memory: 256Mi + requests: + memory: 512Mi + cpu: 300m + +## JasperReports containers' liveness and readiness probes. +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes +## +livenessProbe: + enabled: true + httpGet: + path: /jasperserver/login.html + port: http + initialDelaySeconds: 300 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 6 + successThreshold: 1 +readinessProbe: + enabled: true + httpGet: + path: /jasperserver/login.html + port: http + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 6 + successThreshold: 1 + +## Custom Liveness probes for JasperReports +## +customLivenessProbe: {} + +## Custom Rediness probes JasperReports +## +customReadinessProbe: {} + +## Pod extra labels +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +## +podLabels: {} + +## Annotations for server pods. +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + +## Pod affinity preset +## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity +## Allowed values: soft, hard +## +podAffinityPreset: "" + +## Pod anti-affinity preset +## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity +## Allowed values: soft, hard +## +podAntiAffinityPreset: soft + +## Node affinity preset +## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity +## Allowed values: soft, hard +## +nodeAffinityPreset: + ## Node affinity type + ## Allowed values: soft, hard + type: "" + ## Node label key to match + ## E.g. + ## key: "kubernetes.io/e2e-az-name" + ## + key: "" + ## Node label values to match + ## E.g. + ## values: + ## - e2e-az1 + ## - e2e-az2 + ## + values: [] + +## Affinity for pod assignment. Evaluated as a template. +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set +## +affinity: {} + +## Node labels for pod assignment. Evaluated as a template. +## ref: https://kubernetes.io/docs/user-guide/node-selection/ +## +nodeSelector: {} + +## Tolerations for pod assignment. Evaluated as a template. +## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: [] + +## lifecycleHooks for JasperReports container to automate configuration before or after startup. +## +lifecycleHooks: {} + +## Extra volumes to add to the deployment +## +extraVolumes: [] + +## Extra volume mounts to add to the container +## +extraVolumeMounts: [] + +## Add init containers to the JasperReports pods. +## Example: +## initContainers: +## - name: your-image-name +## image: your-image +## imagePullPolicy: Always +## ports: +## - name: portname +## containerPort: 1234 +## +initContainers: {} + +## Add sidecars to the JasperReports pods. +## Example: +## sidecars: +## - name: your-image-name +## image: your-image +## imagePullPolicy: Always +## ports: +## - name: portname +## containerPort: 1234 +## +sidecars: {} + +## Enable persistence using Persistent Volume Claims +## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ +## +persistence: + enabled: true + ## JasperReports data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + ## Persistent Volume Access Mode + ## + accessModes: + - ReadWriteOnce + ## Persistent Volume size + ## + size: 8Gi + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + ## + existingClaim: "" + +## Kubernetes configuration +## For minikube, set this to NodePort, elsewhere use LoadBalancer +## +service: + type: LoadBalancer + ## HTTP Port + ## + port: 80 + ## Specify the nodePort value for the LoadBalancer and NodePort service types. + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport + ## + nodePort: "" + ## Use serviceLoadBalancerIP to request a specific static IP, + ## otherwise leave blank + ## + # loadBalancerIP: + ## Enable client source IP preservation + ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + ## + externalTrafficPolicy: Cluster + ## Provide any additional annotations which may be required + ## + annotations: {} + +## Ingress configuratiom +## +ingress: + ## Set to true to enable ingress record generation + ## + enabled: false + + ## Set this to true in order to add the corresponding annotations for cert-manager + ## + certManager: false + + ## When the ingress is enabled, a host pointing to this will be created + ## + hostname: jasperreports.local + + ## Ingress annotations done as key:value pairs + ## For a full list of possible ingress annotations, please see + ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md + ## + ## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set + ## + annotations: {} + + ## Enable TLS configuration for the hostname defined at ingress.hostname parameter + ## TLS certificates will be retrieved from a TLS secret with name: {{- printf "%s-tls" .Values.ingress.hostname }} + ## You can use the ingress.secrets parameter to create this TLS secret, relay on cert-manager to create it, or + ## let the chart create self-signed certificates for you + ## + tls: false + + ## The list of additional hostnames to be covered with this ingress record. + ## Most likely the hostname above will be enough, but in the event more hosts are needed, this is an array + ## Example: + ## extraHosts: + ## - name: jasperreports.local + ## path: / + ## + extraHosts: [] + + ## The tls configuration for additional hostnames to be covered with this ingress record. + ## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls + ## Example: + ## extraTls: + ## - hosts: + ## - jasperreports.local + ## secretName: jasperreports.local-tls + ## + extraTls: [] + + ## If you're providing your own certificates, please use this to add the certificates as secrets + ## key and certificate should start with -----BEGIN CERTIFICATE----- or -----BEGIN RSA PRIVATE KEY----- + ## name should line up with a secretName set further up + ## + ## If it is not set and you're using cert-manager, this is unneeded, as it will create the secret for you + ## If it is not set and you're NOT using cert-manager either, self-signed certificates will be created + ## It is also possible to create and manage the certificates outside of this helm chart + ## Please see README.md for more information + ## + ## Example + ## secrets: + ## - name: jasperreports.local-tls + ## key: "" + ## certificate: "" + ## + secrets: [] + ## ## External database configuration ## @@ -80,16 +413,6 @@ externalDatabase: database: bitnami_jasperreports -## SMTP mail delivery configuration -## ref: https://github.com/bitnami/bitnami-docker-jasperreports#smtp-configuration -## -# smtpHost: -# smtpPort: -# smtpEmail: -# smtpUser: -# smtpPassword: -# smtpProtocol: - ## ## MariaDB chart configuration ## @@ -142,150 +465,3 @@ mariadb: ## Use an existing PVC ## existingClaim: - -## Kubernetes configuration -## For minikube, set this to NodePort, elsewhere use LoadBalancer -## -service: - type: LoadBalancer - # HTTP Port - port: 80 - ## - ## nodePorts: - ## http: - ## https: - nodePorts: - http: "" - ## Enable client source IP preservation - ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip - ## - externalTrafficPolicy: Cluster - ## Service annotations done as key:value pairs - ## - annotations: - -## Enable persistence using Persistent Volume Claims -## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ -## -persistence: - enabled: true - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 8Gi - -## Configure resource requests and limits -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## -resources: - requests: - memory: 512Mi - cpu: 300m - -## Configure the ingress resource that allows you to access the -## JasperReports installation. Set up the URL -## ref: http://kubernetes.io/docs/user-guide/ingress/ -## -ingress: - ## Set to true to enable ingress record generation - enabled: false - - ## Set this to true in order to add the corresponding annotations for cert-manager - certManager: false - - ## Ingress annotations done as key:value pairs - ## For a full list of possible ingress annotations, please see - ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md - ## - ## If tls is set to true, annotation ingress.kubernetes.io/secure-backends: "true" will automatically be set - ## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set - annotations: - # kubernetes.io/ingress.class: nginx - - ## The list of hostnames to be covered with this ingress record. - ## Most likely this will be just one host, but in the event more hosts are needed, this is an array - hosts: - - name: jasperreports.local - path: / - - ## Set this to true in order to enable TLS on the ingress record - tls: false - - ## Optionally specify the TLS hosts for the ingress record - ## Useful when the Ingress controller supports www-redirection - ## If not specified, the above host name will be used - # tlsHosts: - # - www.jasperreports.local - # - jasperreports.local - - ## If TLS is set to true, you must declare what secret will store the key/certificate for TLS - tlsSecret: jasperreports.local-tls - - secrets: - ## If you're providing your own certificates, please use this to add the certificates as secrets - ## key and certificate should start with -----BEGIN CERTIFICATE----- or - ## -----BEGIN RSA PRIVATE KEY----- - ## - ## name should line up with a tlsSecret set further up - ## If you're using cert-manager, this is unneeded, as it will create the secret for you if it is not set - ## - ## It is also possible to create and manage the certificates outside of this helm chart - ## Please see README.md for more information - # - name: jasperreports.local-tls - # key: - # certificate: - -## Pod affinity preset -## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAffinityPreset: "" - -## Pod anti-affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAntiAffinityPreset: soft - -## Node affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity -## Allowed values: soft, hard -## -nodeAffinityPreset: - ## Node affinity type - ## Allowed values: soft, hard - type: "" - ## Node label key to match - ## E.g. - ## key: "kubernetes.io/e2e-az-name" - ## - key: "" - ## Node label values to match - ## E.g. - ## values: - ## - e2e-az1 - ## - e2e-az2 - ## - values: [] - -## Affinity for pod assignment -## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set -## -affinity: {} - -## Node labels for pod assignment -## Ref: https://kubernetes.io/docs/user-guide/node-selection/ -## -nodeSelector: {} - -## Tolerations for pod assignment -## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -## -tolerations: []