-
Notifications
You must be signed in to change notification settings - Fork 2
mysql implementation with helm3 #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| values.yaml | ||
| .helm | ||
| .charts |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # MySQL Hub component | ||
|
|
||
| PostgreSQL Hub Component, installs a [t3n-helm-charts/mysql](https://artifacthub.io/packages/helm/t3n/mysql) helm chart | ||
|
|
||
| ## TODO | ||
|
|
||
| - [ ] Add GUI component | ||
| - [ ] Backup functionality |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| --- | ||
| version: 1 | ||
| kind: component | ||
| meta: | ||
| name: mysql | ||
| title: MySQL | ||
| brief: Relational Database | ||
| description: > | ||
| MySQL is a popular, well known open source relational database | ||
| category: Storage | ||
| version: '5.7.30' | ||
| maturity: alpha | ||
| license: GNU | ||
| source: | ||
| dir: ../../components/mysql | ||
|
|
||
| requires: | ||
| - kubernetes | ||
| - helm | ||
| # - tiller | ||
|
|
||
| provides: | ||
| - mysql | ||
| - database | ||
| - sql | ||
|
|
||
| parameters: | ||
| - name: hub.componentName | ||
| - name: dns.domain | ||
| env: DOMAIN_NAME | ||
| - name: component.mysql | ||
| empty: allow | ||
| parameters: | ||
| - name: name | ||
| value: mysql | ||
| env: COMPONENT_NAME | ||
| # - name: host | ||
| - name: namespace | ||
| value: mysql | ||
| env: NAMESPACE | ||
| - name: port | ||
| value: 3306 | ||
| - name: user | ||
| env: DB_USER | ||
| - name: password | ||
| env: DB_PASSWORD | ||
| - name: database | ||
| env: DB_NAME | ||
| - name: rootPassword | ||
| env: ROOT_PASSWORD | ||
| - name: image.name | ||
| value: mysql | ||
| - name: image.tag | ||
| value: 5.7.30 | ||
| - name: chart.version | ||
| value: 1.6.6 | ||
| env: CHART_VERSION | ||
| - name: volumeSize | ||
| value: 8Gi | ||
| - name: storageClass | ||
| value: default | ||
| - name: helm | ||
| parameters: | ||
| - name: repo | ||
| value: https://storage.googleapis.com/t3n-helm-charts | ||
| env: HELM_REPO | ||
| - name: chart | ||
| value: mysql | ||
| env: HELM_CHART | ||
| - name: version | ||
| value: 0.1.0 | ||
| env: HELM_CHART_VERSION | ||
|
|
||
| outputs: | ||
| - name: component.mysql.host | ||
| value: ${component.mysql.name}.${component.mysql.namespace}.svc.cluster.local | ||
| - name: component.mysql.port | ||
| - name: component.mysql.database | ||
| - name: component.mysql.user | ||
| - name: component.mysql.password | ||
| kind: secret | ||
| - name: component.mysql.rootPassword | ||
| kind: secret | ||
|
|
||
| templates: | ||
| files: | ||
| - "*.template" | ||
|
|
||
| lifecycle: | ||
| verbs: | ||
| - deploy | ||
| - undeploy | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #!/bin/sh -xe | ||
|
|
||
| HELM_OPTS="" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does HELM_OPTS used here? |
||
|
|
||
| if test -n "$DB_NAME" | ||
| then | ||
| HELM_OPTS="$HELM_OPTS --set mysqlDatabase=$DB_NAME" | ||
| fi | ||
|
|
||
| if test -n "$DB_USER" | ||
| then | ||
| HELM_OPTS="$HELM_OPTS --set mysqlUser=$DB_USER" | ||
| fi | ||
|
|
||
| if test -n "$DB_PASSWORD" | ||
| then | ||
| HELM_OPTS="$HELM_OPTS --set mysqlPassword=$DB_PASSWORD" | ||
| else | ||
| HELM_OPTS="$HELM_OPTS --set mysqlAllowEmptyPassword=true" | ||
| fi | ||
|
|
||
|
|
||
| if test -n "$ROOT_PASSWORD" | ||
| then | ||
| HELM_OPTS="$HELM_OPTS --set mysqlRootPassword=$ROOT_PASSWORD" | ||
| else | ||
| HELM_OPTS="$HELM_OPTS --set allowEmptyRootPassword=true" | ||
| fi | ||
|
|
||
| if $kubectl get pvc "$COMPONENT_NAME" >/dev/null 2>&1 | ||
| then | ||
| HELM_OPTS="$HELM_OPTS --set persistence.existingClaim=$COMPONENT_NAME" | ||
| fi | ||
|
|
||
|
|
||
| if [ -n "$HELM_OPTS" ] | ||
| then | ||
| echo export HELM_OPTS=\"$HELM_OPTS\" | ||
| fi | ||
|
|
||
| # TODO: how should we quote values | ||
| # quoting helm flags as | ||
| # "$HELM_OPTS --set 'mysqlPassword=$DB_PASSWORD'" | ||
| # leads to escaped quotes in the result command e.g | ||
| # | ||
| # + helm --kube-context=busy-odilee-553.bubble.superhub.io --namespace=kubeflow-data upgrade mysql .charts/mysql --install --create-namespace --debug --wait --version 0.1.0 --values values.yaml \ | ||
| # --set ''\''mysqlUser=mysql''\'' --set ''\''mysqlPassword=somepass'\''' --set ''\''mysqlRootPassword=somepass''\'' --set ''\''persistence.existingClaim=mysql''\'' | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had an alternative way for exposing the exact values over |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| image: "${component.mysql.image.name}" | ||
| imageTag: "${component.mysql.image.tag}" | ||
|
|
||
| persistence: | ||
| enabled: true | ||
| size: ${component.mysql.volumeSize} | ||
| storageClass: "${component.mysql.storageClass}" | ||
|
|
||
| serviceAccount: | ||
| create: true | ||
| name: ${hub.componentName} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not to use: https://github.com/helm/charts/tree/master/stable/mysql ?