Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: startup.example/v1
kind: Database
metadata:
name: checkout-db
namespace: default
spec:
plan: starter
storageGB: 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: core.kbind.io/v1alpha1
kind: Connection
metadata:
name: database-provider
spec:
kubeconfigSecretRef:
namespace: kbind
name: database-provider-kubeconfig
key: kubeconfig
schema:
source: CRD
---
apiVersion: core.kbind.io/v1alpha1
kind: ClusterBinding
metadata:
name: startup-databases
spec:
connectionRef:
name: database-provider
apis:
- name: databases.startup.example
relatedResources:
- group: ""
resource: secrets
direction: FromProvider
selector:
labelSelector:
matchLabels:
databases.startup.example/related: checkout-db
- group: ""
resource: configmaps
direction: FromProvider
selector:
labelSelector:
matchLabels:
databases.startup.example/related: checkout-db
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: databases.startup.example
labels:
core.kbind.io/exported: "true"
spec:
group: startup.example
names:
plural: databases
singular: database
kind: Database
listKind: DatabaseList
scope: Namespaced
versions:
- name: v1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
required: [plan, storageGB]
properties:
plan:
type: string
enum: [starter, growth]
storageGB:
type: integer
minimum: 1
status:
type: object
properties:
phase:
type: string
additionalPrinterColumns:
- name: Plan
type: string
jsonPath: .spec.plan
- name: StorageGB
type: integer
jsonPath: .spec.storageGB
- name: Phase
type: string
jsonPath: .status.phase
---
# Static demo values. No database server is provisioned by this example.
apiVersion: v1
kind: Secret
metadata:
name: checkout-db-credentials
namespace: default
labels:
databases.startup.example/related: checkout-db
type: Opaque
stringData:
host: checkout-db.internal.example
username: checkout
password: local-demo-only
---
apiVersion: v1
kind: ConfigMap
metadata:
name: checkout-db-settings
namespace: default
labels:
databases.startup.example/related: checkout-db
data:
max_connections: "20"
Loading