Skip to content

Commit

Permalink
feat: migrate autoscaling api version to v2 (#105)
Browse files Browse the repository at this point in the history
* #104 migrate autoscaling api version from deprecated

* make autoscaling api version configurable
bump chart version
breaking change for older versions of kubernetes

* update readme with new autoscaling.apiVersion value
  • Loading branch information
razorman8669 authored Jul 27, 2023
1 parent c5827ec commit b7beaf9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/chatwoot/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sources:
- http://www.chatwoot.com

# This is the chart version.
version: 1.0.21
version: 1.1.0

# This is the application version.
appVersion: "v2.18.0"
13 changes: 7 additions & 6 deletions charts/chatwoot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The command removes all the Kubernetes components associated with the chart and
| `image.tag` | Chatwoot image tag (immutable tags are recommended) | `v2.18.0` |
| `image.pullPolicy` | Chatwoot image pull policy | `IfNotPresent` |


### Chatwoot Environment Variables

| Name | Type | Default Value |
Expand All @@ -79,7 +79,7 @@ The command removes all the Kubernetes components associated with the chart and
| `env.SMTP_PORT` | SMTP port | `"587"` |
| `env.SMTP_USERNAME` | SMTP username | `""` |
| `env.USE_INBOX_AVATAR_FOR_BOT` | Bot customizations | `"true"` |

### Email setup for conversation continuity (Incoming emails)

| Name | Type | Default Value |
Expand Down Expand Up @@ -123,7 +123,7 @@ The command removes all the Kubernetes components associated with the chart and
| `env.LOG_LEVEL` | string | `"info"` |
| `env.LOG_SIZE` | string | `"500"` |

### Third party credentials
### Third party credentials

| Name | Type | Default Value |
| ----------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------- |
Expand Down Expand Up @@ -155,6 +155,7 @@ The command removes all the Kubernetes components associated with the chart and
| `worker.hpa.minpods` | Minimum number of pods for Chatwoot worker | `2` |
| `worker.hpa.maxpods` | Maximum number of pods for Chatwoot worker | `10` |
| `worker.replicaCount` | No of worker pods if hpa is not enabled | `1` |
| `autoscaling.apiVersion` | Autoscaling API version | `autoscaling/v2` |

### Other Parameters

Expand Down Expand Up @@ -301,7 +302,7 @@ helm upgrade chatwoot chatwoot/chatwoot --version="0.9.0" --namespace ug3 -f val
5. Update and install new version of charts.
```
helm repo update
#reset web.replicaCount and worker.replicaCount to your previous values
#reset web.replicaCount and worker.replicaCount to your previous values
helm install chatwoot chatwoot/chatwoot -f <your-values.yaml> #-n chatwoot
```

Expand Down Expand Up @@ -334,7 +335,7 @@ RAILS_ENV=production bundle exec rails c
::Redis::Alfred.delete(::Redis::Alfred::CHATWOOT_INSTALLATION_ONBOARDING)
```

10. Load the Chatwoot web url, log in using the old credentials and verify the contents. Voila! Thats it!!
10. Load the Chatwoot web url, log in using the old credentials and verify the contents. Voila! Thats it!!

### To 0.9.x

Expand All @@ -351,7 +352,7 @@ Move from Kubernetes ConfigMap to Kubernetes Secrets for environment variables.

### To 0.6.x

Existing labels were causing issues with `helm upgrade`. `0.6.x` introduces breaking changes related to selector
Existing labels were causing issues with `helm upgrade`. `0.6.x` introduces breaking changes related to selector
labels used for deployments. Please delete your helm release and recreate it. Deleting your helm release will
not delete your persistent volumes used for Redis, and Postgres and as such your data should be safe.

Expand Down
3 changes: 2 additions & 1 deletion charts/chatwoot/templates/web-hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- if .Values.web.hpa.enabled -}}
apiVersion: autoscaling/v2beta2
apiVersion: {{ .Values.autoscaling.apiVersion }}

kind: HorizontalPodAutoscaler
metadata:
name: {{ template "chatwoot.fullname" . }}-web
Expand Down
2 changes: 1 addition & 1 deletion charts/chatwoot/templates/worker-hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.worker.hpa.enabled -}}
apiVersion: autoscaling/v2beta2
apiVersion: {{ .Values.autoscaling.apiVersion }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "chatwoot.fullname" . }}-worker
Expand Down
5 changes: 5 additions & 0 deletions charts/chatwoot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ image:
tag: v2.18.0
pullPolicy: IfNotPresent

# Set to autoscaling/v2beta2 for older versions of kubernetes that do not have autoscaling/v2 API (pre v1.26)
# See https://kubernetes.io/docs/reference/using-api/deprecation-guide/#horizontalpodautoscaler-v126
autoscaling:
apiVersion: autoscaling/v2

web:
hpa:
# set this to true to enable horizontal pod autoscaling
Expand Down

0 comments on commit b7beaf9

Please sign in to comment.