diff --git a/kube/kube.libsonnet b/kube/kube.libsonnet index fc21962b..929c6f21 100644 --- a/kube/kube.libsonnet +++ b/kube/kube.libsonnet @@ -12,6 +12,20 @@ kube { Certificate(name): kube._Object("certmanager.k8s.io/v1alpha1", "Certificate", name) { spec: error "spec must be defined", }, + # For use in PodSpec.volumes_ + CertificateVolume(certificate): { + secret: { secretName: certificate.spec.secretName }, + }, + + # Add .Contain method to Namespaces, allowing for easy marking of particular + # kube objects as contained in that namespace. + Namespace(name): kube.Namespace(name) { + Contain(o):: o { + metadata+: { + namespace: name, + }, + }, + }, CephObjectStoreUser(name): kube._Object("ceph.rook.io/v1", "CephObjectStoreUser", name) { local user = self, @@ -31,6 +45,10 @@ kube { openAPIV3Schema: obj.render, }, + Required(inner):: inner { + required:: true, + }, + Dict:: { local dict = self, required:: false,