Skip to content

Instantly share code, notes, and snippets.

@cdelashmutt-pivotal
Last active June 7, 2023 20:40
Show Gist options
  • Save cdelashmutt-pivotal/d6c34c2f6fa559c3bbd47fbafa33da54 to your computer and use it in GitHub Desktop.
Save cdelashmutt-pivotal/d6c34c2f6fa559c3bbd47fbafa33da54 to your computer and use it in GitHub Desktop.
Overlay for cloning Bitnami MySQL Service for cloning
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")
#@ def kind_and_name(kind, name):
#@ return overlay.subset({"kind": kind, "metadata": {"name": name}})
#@ end
#@overlay/match by=overlay.all, expects=3
---
#@overlay/match-child-defaults missing_ok=True
metadata:
#@overlay/remove
annotations:
#@overlay/remove
creationTimestamp:
#@overlay/remove
finalizers:
#@overlay/remove
generation:
labels:
#@overlay/remove
kapp.k14s.io/app:
#@overlay/remove
kapp.k14s.io/association:
#@overlay/remove
resourceVersion:
#@overlay/remove
uid:
#@overlay/match missing_ok=True
#@overlay/remove
status:
#@overlay/match by=kind_and_name("ClusterInstanceClass", "mysql-unmanaged"), expects=1
---
metadata:
name: #@ data.values.clusterinstanceclass.name
spec:
description:
short: #@ "{} placeholder description".format(data.values.clusterinstanceclass.name)
provisioner:
crossplane:
compositeResourceDefinition: #@ "xmysqlinstances.{}".format(data.values.xrd.group)
compositionSelector:
matchLabels:
provider: #@ data.values.xrd.group
type: #@ data.values.clusterinstanceclass.name
#@overlay/match by=kind_and_name("CompositeResourceDefinition", "xmysqlinstances.bitnami.database.tanzu.vmware.com"), expects=1
---
metadata:
name: #@ "{}s.{}".format(data.values.xrd.kind.lower(), data.values.xrd.group)
spec:
group: #@ data.values.xrd.group
names:
kind: #@ data.values.xrd.kind
plural: #@ "{}s".format(data.values.xrd.kind.lower())
#@overlay/match by=kind_and_name("Composition", "xmysqlinstances.bitnami.database.tanzu.vmware.com"), expects=1
---
metadata:
labels:
provider: #@ data.values.xrd.group
name: #@ "{}s.{}".format(data.values.xrd.kind.lower(), data.values.xrd.group)
spec:
compositeTypeRef:
apiVersion: #@ "{}/v1alpha1".format(data.values.xrd.group)
kind: #@ data.values.xrd.kind
#@data/values-schema
---
clusterinstanceclass:
#@schema/title "ClusterInstanceClass Name"
#@schema/desc "This name should be short name you want to show up the `tanzu service class list` command for your developers to choose from."
#@schema/examples ("Example for ClusterInstanceClass name", "mysql-high-max-connections"), ("", "mysql-with-encryption")
name: ""
xrd:
#@schema/title "CompositeResourceDefinition Kind"
#@schema/desc "The 'kind' name to use for the Crossplane XRD that backs the ClusterInstanceClass you are creating. Conventionally, a string starting with a capital 'X' and then a Pascal case-d string to name the XRD."
#@schema/examples ("Examples for XRD kind", "XMySQLMaxConnections"), ("", "XMySQLEncrypted")
kind: ""
#@schema/title "CompositeResourceDefinition Group"
#@schema/desc "The 'group' name to use for the Crossplane XRD that backs the ClusterInstanceClass you are creating. Conventionally, a string with components separated by period characters that looks similar to a domain name."
#@schema/examples ("Examples for XRD Group", "my.example.org"), ("","cool.tech.io")
group: ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment