Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion incubator/mysql/mixin.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mysql",
"version": "0.0.1",
"description": "MySQL is one of the most popular database servers in the world. Notable users include Wikipedia, Facebook and Google.",
"description": "This mySQL mixin library contains Ksonnet proottypes of preconfigured components to help you easily deploy a mySQL database to your Kubernetes cluster.",
"author": "ksonnet team <ksonnet-help@heptio.com>",
"contributors": [
{
Expand Down
21 changes: 12 additions & 9 deletions incubator/mysql/mysql.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ local k = import 'ksonnet.beta.2/k.libsonnet';
},
// I chose this route to avoid passing both storageClass and storageClassName
// it does feel a bit hacky and I'm willing to change it
[if storageClassName != null then "storageClass"]:
storageClassName,
storageClass: storageClassName,
},
},

Expand Down Expand Up @@ -108,15 +107,19 @@ local k = import 'ksonnet.beta.2/k.libsonnet';
cpu: "100m",
},
},
config: {
user: "",
db: ""
},
},

persistent(namespace, name, secretKeyName, claimName, mysqlUser="", mysqlDatabase="", mysqlAllowEmptyPassword=false, subPath=null, persistenceEnabled=true)::
base(namespace, name, secretKeyName, claimName, mysqlUser, mysqlDatabase, mysqlAllowEmptyPassword, subPath, persistenceEnabled),
persistent(namespace, name, secretKeyName, claimName, mysqlConfig=defaults.config, mysqlAllowEmptyPassword=false, subPath=null, persistenceEnabled=true)::
base(namespace, name, secretKeyName, claimName, mysqlConfig, mysqlAllowEmptyPassword, subPath, persistenceEnabled),

nonpersistent(namespace, name, secretKeyName, claimName, mysqlUser, mysqlDatabase, mysqlAllowEmptyPassword=false, subPath=null, persistenceEnabled=false)::
base(namespace, name, secretKeyName, claimName, mysqlUser, mysqlDatabase, mysqlAllowEmptyPassword, subPath, persistenceEnabled),
nonpersistent(namespace, name, secretKeyName, claimName, mysqlConfig=defaults.config, mysqlAllowEmptyPassword=false, subPath=null, persistenceEnabled=false)::
base(namespace, name, secretKeyName, claimName, mysqlConfig, mysqlAllowEmptyPassword, subPath, persistenceEnabled),

local base(namespace, name, secretKeyName, claimName, mysqlUser, mysqlDatabase, mysqlAllowEmptyPassword, subPath, persistenceEnabled)= {
local base(namespace, name, secretKeyName, claimName, mysqlConfig, mysqlAllowEmptyPassword, subPath, persistenceEnabled)= {
apiVersion: "extensions/v1beta1",
kind: "Deployment",
metadata: {
Expand Down Expand Up @@ -184,11 +187,11 @@ local k = import 'ksonnet.beta.2/k.libsonnet';
] + [
{
name: "MYSQL_USER",
value: if mysqlUser != null then mysqlUser else "",
value: mysqlConfig.user,
},
{
name: "MYSQL_DATABASE",
value: if mysqlDatabase != null then mysqlDatabase else "",
value: mysqlConfig.db,
},
],
ports: [
Expand Down