-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commits adds the possibility to back Tiller (or the future Tiller-less Helm CLI) with any SQL database (only postgres has been tested so far) to store release information. The main motivation for this commit was to use a storage backend that would allow releases larger that 1MB in size (ConfigMap or Secret drivers don't, because of limits on value size in the underlying etcd key-value store). Signed-off-by: Étienne Lafarge <etienne.lafarge@gmail.com> Co-authored-by: Elliot Maincourt <e.maincourt@gmail.com> (@emaincourt) Co-authored-by: Paul Borensztein <hi@0x01.fr> (@commit-master)
- Loading branch information
Showing
8 changed files
with
911 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Store release information in an SQL database | ||
|
||
You may be willing to store release information in an SQL database - in | ||
particular, if your releases weigh more than 1MB and therefore [can't be stored in ConfigMaps or Secrets](https://github.com/helm/helm/issues/1413). | ||
|
||
We recommend using [PostgreSQL](https://www.postgresql.org/). | ||
|
||
This document describes how to deploy `postgres` atop Kubernetes. This being | ||
said, using an out-of-cluster (managed or not) PostreSQL instance is totally | ||
possible as well. | ||
|
||
Here's a Kubernetes manifest you can apply to get a minimal PostreSQL pod | ||
running on your Kubernetes cluster. **Don't forget to change the credentials | ||
and, optionally, enable TLS in production deployments**. | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: tiller-postgres | ||
spec: | ||
ports: | ||
- port: 5432 | ||
selector: | ||
app: tiller-postgres | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: tiller-postgres | ||
spec: | ||
serviceName: tiller-postgres | ||
selector: | ||
matchLabels: | ||
app: tiller-postgres | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: tiller-postgres | ||
spec: | ||
containers: | ||
- name: postgres | ||
image: postgres:11-alpine | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 5432 | ||
env: | ||
- name: POSTGRES_DB | ||
value: helm | ||
- name: POSTGRES_USER | ||
value: helm | ||
- name: POSTGRES_PASSWORD | ||
value: changemeforgodssake | ||
resources: | ||
limits: | ||
memory: 128Mi | ||
requests: | ||
cpu: 50m | ||
memory: 128Mi | ||
volumeMounts: | ||
- mountPath: /var/lib/postgresql/data | ||
name: tiller-postgres-data | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: tiller-postgres-data | ||
spec: | ||
accessModes: ["ReadWriteOnce"] | ||
storageClassName: default | ||
resources: | ||
requests: | ||
storage: 5Gi | ||
``` | ||
Once postgres is deployed, you'll need to install Tiller using `helm init`, with | ||
a few custom CLI flags: | ||
|
||
```shell | ||
helm init \ | ||
--override \ | ||
'spec.template.spec.containers[0].args'='{--storage=sql,--sql-dialect=postgres,--sql-connection-string=postgresql://tiller-postgres:5432/helm?user=helm&password=changemeforgodssake&sslmode=disable}' | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,71 @@ | ||
package: k8s.io/helm | ||
import: | ||
- package: golang.org/x/net | ||
subpackages: | ||
- context | ||
- package: golang.org/x/sync | ||
subpackages: | ||
- semaphore | ||
# This is temporary and can probably be removed the next time gRPC is updated | ||
- package: golang.org/x/sys | ||
version: b90733256f2e882e81d52f9126de08df5615afd9 | ||
subpackages: | ||
- unix | ||
- windows | ||
- package: github.com/spf13/cobra | ||
version: fe5e611709b0c57fa4a89136deaa8e1d4004d053 | ||
- package: github.com/spf13/pflag | ||
version: ~1.0.1 | ||
- package: github.com/Masterminds/vcs | ||
# Pin version of mergo that is compatible with both sprig and Kubernetes | ||
- package: github.com/imdario/mergo | ||
version: v0.3.5 | ||
- package: github.com/Masterminds/sprig | ||
version: ^2.18.0 | ||
- package: github.com/ghodss/yaml | ||
- package: github.com/Masterminds/semver | ||
version: ~1.3.1 | ||
- package: github.com/technosophos/moniker | ||
version: ~0.2 | ||
- package: github.com/golang/protobuf | ||
version: 1.2.0 | ||
subpackages: | ||
- proto | ||
- ptypes/any | ||
- ptypes/timestamp | ||
- package: google.golang.org/grpc | ||
version: 1.18.0 | ||
- package: github.com/gosuri/uitable | ||
- package: github.com/asaskevich/govalidator | ||
version: ^4.0.0 | ||
- package: golang.org/x/crypto | ||
subpackages: | ||
- openpgp | ||
- ssh/terminal | ||
- package: github.com/gobwas/glob | ||
version: ^0.2.1 | ||
- package: github.com/evanphx/json-patch | ||
- package: github.com/BurntSushi/toml | ||
version: ~0.3.0 | ||
- package: github.com/prometheus/client_golang | ||
version: 0.8.0 | ||
- package: github.com/grpc-ecosystem/go-grpc-prometheus | ||
- package: k8s.io/kubernetes | ||
version: release-1.13 | ||
- package: k8s.io/client-go | ||
version: kubernetes-1.13.1 | ||
- package: k8s.io/api | ||
version: kubernetes-1.13.1 | ||
- package: k8s.io/apimachinery | ||
version: kubernetes-1.13.1 | ||
- package: k8s.io/apiserver | ||
version: kubernetes-1.13.1 | ||
- package: k8s.io/cli-runtime | ||
version: kubernetes-1.13.1 | ||
- package: k8s.io/apiextensions-apiserver | ||
version: kubernetes-1.13.1 | ||
- package: github.com/cyphar/filepath-securejoin | ||
version: ^0.2.1 | ||
|
||
testImports: | ||
- package: github.com/stretchr/testify | ||
version: ^1.1.4 | ||
subpackages: | ||
- assert | ||
- package: golang.org/x/net | ||
subpackages: | ||
- context | ||
- package: golang.org/x/sync | ||
subpackages: | ||
- semaphore | ||
- package: golang.org/x/sys | ||
version: b90733256f2e882e81d52f9126de08df5615afd9 | ||
subpackages: | ||
- unix | ||
- windows | ||
- package: github.com/spf13/cobra | ||
version: fe5e611709b0c57fa4a89136deaa8e1d4004d053 | ||
- package: github.com/spf13/pflag | ||
version: ~1.0.1 | ||
- package: github.com/Masterminds/vcs | ||
- package: github.com/imdario/mergo | ||
version: v0.3.5 | ||
- package: github.com/Masterminds/sprig | ||
version: ^2.18.0 | ||
- package: github.com/ghodss/yaml | ||
- package: github.com/Masterminds/semver | ||
version: ~1.3.1 | ||
- package: github.com/technosophos/moniker | ||
version: ~0.2 | ||
- package: github.com/golang/protobuf | ||
version: 1.2.0 | ||
subpackages: | ||
- proto | ||
- ptypes/any | ||
- ptypes/timestamp | ||
- package: google.golang.org/grpc | ||
version: 1.18.0 | ||
- package: github.com/gosuri/uitable | ||
- package: github.com/asaskevich/govalidator | ||
version: ^4.0.0 | ||
- package: golang.org/x/crypto | ||
subpackages: | ||
- openpgp | ||
- ssh/terminal | ||
- package: github.com/gobwas/glob | ||
version: ^0.2.1 | ||
- package: github.com/evanphx/json-patch | ||
- package: github.com/BurntSushi/toml | ||
version: ~0.3.0 | ||
- package: github.com/prometheus/client_golang | ||
version: 0.8.0 | ||
- package: github.com/grpc-ecosystem/go-grpc-prometheus | ||
- package: k8s.io/kubernetes | ||
version: release-1.13 | ||
- package: k8s.io/client-go | ||
version: kubernetes-1.13.1 | ||
- package: k8s.io/api | ||
version: kubernetes-1.13.1 | ||
- package: k8s.io/apimachinery | ||
version: kubernetes-1.13.1 | ||
- package: k8s.io/apiserver | ||
version: kubernetes-1.13.1 | ||
- package: k8s.io/cli-runtime | ||
version: kubernetes-1.13.1 | ||
- package: k8s.io/apiextensions-apiserver | ||
version: kubernetes-1.13.1 | ||
- package: github.com/cyphar/filepath-securejoin | ||
version: ^0.2.1 | ||
- package: github.com/jmoiron/sqlx | ||
version: ^1.2.0 | ||
- package: github.com/rubenv/sql-migrate | ||
- package: github.com/DATA-DOG/go-sqlmock | ||
version: ^1.3.2 |
Oops, something went wrong.