README.md in metatron-0.1.9 vs README.md in metatron-0.2.0
- old
+ new
@@ -201,11 +201,11 @@
# We might eventually want a mechanism to build status based on the world:
# status = compare_children(request_body["children"], desired_children)
status = {}
- { status:, children: desired_children.map(&:render) }
+ { status:, children: desired_children }
end
def construct_app_resources(parent, db_secret)
resources = []
app_db_secret = construct_app_secret(parent["metadata"], db_secret)
@@ -233,21 +233,26 @@
resources
end
def construct_db_stateful_set(secret)
stateful_set = Metatron::Templates::StatefulSet.new("db")
- stateful_set.image = "mysql:8.0"
+ container = Metatron::Templates::Container.new("db")
+ container.image = "mysql:8.0"
+ container.envfrom << secret.name
+ stateful_set.containers << container
stateful_set.additional_pod_labels = { "app.kubernetes.io/component": "db" }
- stateful_set.envfrom << secret.name
stateful_set
end
def construct_app_deployment(meta, spec, auth_secret)
deployment = Metatron::Templates::Deployment.new(meta["name"], replicas: spec["replicas"])
- deployment.image = spec["image"]
+ container = Metatron::Templates::Container.new("app")
+ container.image = spec["image"]
+ container.envfrom << auth_secret.name
+ container.ports << { name: "web", containerPort: 3000 }
+
+ deployment.containers << container
deployment.additional_pod_labels = { "app.kubernetes.io/component": "app" }
- deployment.envfrom << auth_secret.name
- deployment.ports << { name: "web", containerPort: 3000 }
deployment
end
def construct_ingress(meta, service)
ingress = Metatron::Templates::Ingress.new(meta["name"])