Skip to content

Commit

Permalink
helm: Chart 2.0-ish
Browse files Browse the repository at this point in the history
This is an overhaul and update of the original Helm chart. The changes
herein steer it towards best practices and bring the Consul dependencies
up to date (1.15.1 as of this commit (chart version 1.1.1)).

We have a good start to start building on much needed changes like
adding support for expanding PVCs, providing ways to expose the
ReadySet HTTP endpoints for monitoring, and general user experience
improvements like a useful NOTES.txt for when the chart install
completes.

- Rename template files according to <function>-<resource>.yaml as this
  is close to the noted best practice
- Update annotations on AWS LB Controller for readyset-adapter to work
  with the updated version of the AWS LB Controller users will install.
- Remove scripts/ directory
- Add a definition for "readyset.name"
- Remove references to .global.*
- Simplified names of resources and references to them preventing
  issues like repeated chart names
- Set some low, but reasonable defaults for EKS and GKE autopilot
- Remove env vars set to the already default value
- Remove duplicative command definitions for server and adapter

Change-Id: I5d406586ad808dd06f021b4b6c9aed8135ed678c
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/4816
Tested-by: Buildkite CI
Reviewed-by: Griffin Smith <griffin@readyset.io>
Reviewed-by: Jason Camp <jason@readyset.io>
  • Loading branch information
imeyer committed May 5, 2023
1 parent 7d36208 commit b739acb
Show file tree
Hide file tree
Showing 32 changed files with 514 additions and 1,662 deletions.
6 changes: 3 additions & 3 deletions helm/readyset/Chart.lock
@@ -1,6 +1,6 @@
dependencies:
- name: consul
repository: https://helm.releases.hashicorp.com/
version: 0.41.0
digest: sha256:2c4c998ef5ad938d2d56c50a9149972affad2f2785d9a8b67de40715d14b1d04
generated: "2022-08-25T09:57:48.642396-04:00"
version: 1.1.1
digest: sha256:32768c929b03390dd8f603836e16c5a322a877b78d95572226c6ae27fc5e4a7a
generated: "2023-04-26T08:31:45.348045-07:00"
22 changes: 11 additions & 11 deletions helm/readyset/Chart.yaml
@@ -1,19 +1,19 @@
apiVersion: v2
appVersion: "0.0.1"

name: readyset
description: Official ReadySet Chart
annotations:
category: Infrastructure
type: application

# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.0

# appVersion is not expected to follow Semantic Versioning (https://semver.org)
appVersion: "latest"

dependencies:
- condition: consul.enabled
name: consul
repository: https://helm.releases.hashicorp.com/
version: 0.41.0
description: Official ReadySet Server Chart
home: https://readyset.io/
icon: https://readyset.io/favicon.png
maintainers:
- email: support@readyset.io
name: ReadySet.io
kubeVersion: '>=1.18.0-0'
type: "application"
version: 0.1.0
version: 1.1.1
101 changes: 0 additions & 101 deletions helm/readyset/README.install.md

This file was deleted.

51 changes: 1 addition & 50 deletions helm/readyset/README.md
@@ -1,52 +1,3 @@
# ReadySet Helm Chart

## Disclaimer

This helm chart is provided for development purposes and is not intended to be
used in production workflows.

The current chart assumes it will be run on EKS or at least that the gp2
storage class is available.

## Scripts

1. Install a mysql helm chart with an example testing database. This is an alternative to setting up RDS
```
./scripts/setup_mysql.sh
```

2. Create a kubernetes secret with the test database env variables
```
./scripts/create_secret.sh
```

4. Install the readyset helm chart from the current directory
```
helm install rs .
```

5. Wait for pods to come up
```
kubectl get pods -w
```

6. Port forward the adapter
```
./scripts/port_forward_adapter.sh
```

7. Follow adapter logs (assumes a single adapter pod)
```
./scripts/adapter_logs.sh
```

8. Follow server logs
```
kubectl logs rs-readyset-server-0 -c readyset-server -f
```

9. Spawn windows with server/adapter logs (requires an active tmux session)
```
./scripts/k8logs.sh
```

Coming soon
Binary file removed helm/readyset/charts/consul-0.41.0.tgz
Binary file not shown.
Binary file added helm/readyset/charts/consul-1.1.1.tgz
Binary file not shown.
5 changes: 0 additions & 5 deletions helm/readyset/scripts/adapter_logs.sh

This file was deleted.

34 changes: 0 additions & 34 deletions helm/readyset/scripts/create_secret.sh

This file was deleted.

13 changes: 0 additions & 13 deletions helm/readyset/scripts/k8logs.sh

This file was deleted.

9 changes: 0 additions & 9 deletions helm/readyset/scripts/port_forward_adapter.sh

This file was deleted.

4 changes: 0 additions & 4 deletions helm/readyset/scripts/setup_mysql.sh

This file was deleted.

23 changes: 0 additions & 23 deletions helm/readyset/templates/00-validation-checks.yml

This file was deleted.

7 changes: 0 additions & 7 deletions helm/readyset/templates/01-consul-agent-configmap.yml

This file was deleted.

1 change: 0 additions & 1 deletion helm/readyset/templates/02-readyset-server-rbac.yml

This file was deleted.

3 changes: 0 additions & 3 deletions helm/readyset/templates/03-readyset-server-sts.yml

This file was deleted.

1 change: 0 additions & 1 deletion helm/readyset/templates/04-readyset-adapter-rbac.yml

This file was deleted.

3 changes: 0 additions & 3 deletions helm/readyset/templates/05-readyset-adapter-deployment.yml

This file was deleted.

1 change: 0 additions & 1 deletion helm/readyset/templates/06-readyset-adapter-service.yml

This file was deleted.

47 changes: 3 additions & 44 deletions helm/readyset/templates/NOTES.txt
@@ -1,44 +1,3 @@

Thank you for installing {{ .Chart.Name }}! Your release is named {{ .Release.Name }}.

To learn more about the release, try:

helm status {{ .Release.Name }}
helm get all {{ .Release.Name }}

Disclaimer: This helm chart is intended for development purposes. It is not
recommended for use in production traffic.

{{ if contains "LoadBalancer" .Values.readyset.adapter.service.type -}}

******************************************************************
*** PLEASE BE PATIENT: Service LoadBalancer Provisioning ********
******************************************************************

It may take a few minutes for the LoadBalancer IP to be available and for the
services to become healthy and ready for traffic.

This is the load balancer that clients and applications run queries against.

You can view the latest status of the service using:

kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "readyset.adapter.service.name" (dict "root" . "service" .Values.readyset.adapter.service) }}

To connect to ReadySet using mysql/psql:

{{ $dbSecretName := .Values.readyset.common.secrets.replicationUrl.secretName }}
{{- $ns := .Release.Namespace -}}
export READYSET_USERNAME=$(kubectl get secret {{ .Values.readyset.common.secrets.replicationUrl.secretName }} -o=jsonpath='{.data.username}' --namespace {{ .Release.Namespace }} | base64 -d)
export READYSET_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "readyset.adapter.service.name" (dict "root" . "service" .Values.readyset.adapter.service) }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
export READYSET_DB_NAME=$(kubectl get secret {{ .Values.readyset.common.secrets.replicationUrl.secretName }} -o=jsonpath='{.data.database}' --namespace {{ .Release.Namespace }} | base64 -d)
{{- if eq "mysql" .Values.readyset.common.config.engine }}
{{ $port := 3306 }}
export READYSET_ENDPOINT=${READYSET_HOST}:{{ $port }}
mysql --host=${READYSET_HOST} --port={{ $port }} --user=${READYSET_USERNAME} -p
{{ else }}
{{- $port := 5432 }}
export READYSET_ENDPOINT=${READYSET_HOST}:{{ $port }}
export READYSET_PWD=$(kubectl get secret {{ $dbSecretName }} -o=jsonpath='{.data.password}' --namespace {{ $ns }} | base64 -d)
PGPASSWORD="${READYSET_PWD}" psql --host="${READYSET_HOST}" --port={{ $port }} --user="${READYSET_USERNAME}" $READYSET_DB_NAME -c "show proxied queries;"
{{- end -}}
{{- end -}}
1. Get the application URL by running these commands:
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "readyset.fullname" . }}-adapter --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.readyset.adapter.httpPort }}/metrics

0 comments on commit b739acb

Please sign in to comment.