94 lines
3.0 KiB
YAML
94 lines
3.0 KiB
YAML
apiVersion: apiextensions.k8s.io/v1
|
|
kind: CustomResourceDefinition
|
|
metadata:
|
|
name: mysqldatabases.platform.example.com
|
|
spec:
|
|
group: platform.example.com
|
|
scope: Namespaced
|
|
names:
|
|
plural: mysqldatabases
|
|
singular: mysqldatabase
|
|
kind: MySQLDatabase
|
|
shortNames: [mysqldb]
|
|
versions:
|
|
- name: v1alpha1
|
|
served: true
|
|
storage: true
|
|
subresources:
|
|
status: {}
|
|
additionalPrinterColumns:
|
|
- name: Database
|
|
type: string
|
|
jsonPath: .status.databaseName
|
|
- name: User
|
|
type: string
|
|
jsonPath: .status.userName
|
|
- name: Phase
|
|
type: string
|
|
jsonPath: .status.phase
|
|
schema:
|
|
openAPIV3Schema:
|
|
type: object
|
|
required: [spec]
|
|
properties:
|
|
spec:
|
|
type: object
|
|
required: [clusterRef,databaseName,adminSecretRef]
|
|
properties:
|
|
clusterRef:
|
|
type: object
|
|
required: [name]
|
|
properties: {name: {type: string}}
|
|
databaseName:
|
|
type: string
|
|
minLength: 1
|
|
maxLength: 64
|
|
pattern: '^[A-Za-z0-9_$-]+$'
|
|
adminSecretRef:
|
|
type: object
|
|
required: [name]
|
|
properties: {name: {type: string}}
|
|
connection:
|
|
type: object
|
|
properties:
|
|
host: {type: string}
|
|
port: {type: integer, minimum: 1, maximum: 65535}
|
|
user:
|
|
type: object
|
|
properties:
|
|
name: {type: string, maxLength: 32}
|
|
create: {type: boolean}
|
|
credentials:
|
|
type: object
|
|
properties:
|
|
secretName: {type: string}
|
|
privileges:
|
|
type: array
|
|
items: {type: string}
|
|
charset: {type: string}
|
|
collation: {type: string}
|
|
deletionPolicy:
|
|
type: string
|
|
enum: [Retain, Delete]
|
|
default: Retain
|
|
status:
|
|
type: object
|
|
properties:
|
|
phase: {type: string}
|
|
message: {type: string}
|
|
databaseName: {type: string}
|
|
userName: {type: string}
|
|
secretName: {type: string}
|
|
observedGeneration: {type: integer, format: int64}
|
|
conditions:
|
|
type: array
|
|
items:
|
|
type: object
|
|
required: [type,status,reason,message,lastTransitionTime]
|
|
properties:
|
|
type: {type: string}
|
|
status: {type: string}
|
|
reason: {type: string}
|
|
message: {type: string}
|
|
lastTransitionTime: {type: string, format: date-time}
|