sparse-intern-71089
03/08/2019, 8:32 PMimportant-leather-28796
03/08/2019, 8:32 PMimportant-leather-28796
03/08/2019, 8:33 PMimportant-leather-28796
03/08/2019, 8:34 PMimportant-leather-28796
03/08/2019, 8:35 PMimportant-leather-28796
03/08/2019, 8:37 PMimportant-leather-28796
03/08/2019, 8:37 PMimportant-leather-28796
03/08/2019, 8:38 PMimportant-leather-28796
03/08/2019, 8:39 PMimportant-leather-28796
03/08/2019, 8:41 PMimportant-leather-28796
03/08/2019, 8:42 PMimportant-leather-28796
03/08/2019, 8:42 PMimportant-leather-28796
03/08/2019, 8:45 PMimportant-leather-28796
03/08/2019, 8:46 PMgentle-diamond-70147
03/08/2019, 8:52 PMgentle-diamond-70147
03/08/2019, 8:54 PMcreamy-potato-29402
03/08/2019, 8:54 PMimportant-leather-28796
03/08/2019, 8:55 PMcreamy-potato-29402
03/08/2019, 8:58 PMcreamy-potato-29402
03/08/2019, 8:58 PMgentle-diamond-70147
03/08/2019, 8:59 PMdependsOn
question?creamy-potato-29402
03/08/2019, 8:59 PMcreamy-potato-29402
03/08/2019, 9:00 PM.metadata.namespace
to be yourNamespace.metadata.apply(m => m.name)
the dependency should be recorded automatically.creamy-potato-29402
03/08/2019, 9:00 PMcreamy-potato-29402
03/08/2019, 9:02 PMcreamy-potato-29402
03/08/2019, 9:02 PMimportant-leather-28796
03/08/2019, 9:02 PMcreamy-potato-29402
03/08/2019, 9:04 PMconst ns = k8s.core.v1.Namespace("my-ns", {...});
const app = k8s.apps.v1.Deployment("my-app", {
metadata: { namespace: ns.metadata.apply(m => m.name) },
[...]
})
creamy-potato-29402
03/08/2019, 9:04 PMns.metadata.apply
will automatically record the dependency relationship on ns
creamy-potato-29402
03/08/2019, 9:04 PMgorgeous-egg-16927
03/08/2019, 9:05 PMconst ns = k8s.core.v1.Namespace("my-ns", {...});
const app = k8s.apps.v1.Deployment("my-app", {
metadata: { namespace: ns.metadata.name },
[...]
})
important-leather-28796
03/08/2019, 9:06 PMimport {ns}
in a bunch of files though and add this code to all components e.g. 8 files.creamy-potato-29402
03/08/2019, 9:06 PMcreamy-potato-29402
03/08/2019, 9:06 PMimportant-leather-28796
03/08/2019, 9:07 PMcreamy-potato-29402
03/08/2019, 9:07 PMconst ns = k8s.core.v1.Namespace("my-ns", {...});
ns.addResource(new k8s.apps.v1.Deployment("my-app", { ...})
creamy-potato-29402
03/08/2019, 9:08 PMcreamy-potato-29402
03/08/2019, 9:08 PMcreamy-potato-29402
03/08/2019, 9:08 PMimportant-leather-28796
03/08/2019, 9:09 PMcreamy-potato-29402
03/08/2019, 9:09 PMcreamy-potato-29402
03/08/2019, 9:09 PM