/kube-dc:create-databasefrom kube-dc
Creates managed databases (PostgreSQL, MySQL, MariaDB, ClickHouse) or Valkey caches in Kube-DC projects with ServiceBinding credential delivery and backup/restore setup.
Ships in kube-dc. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
{organization}-{project}.check-quota skill.Tenants cannot read the cluster-scoped ManagedServicePlan objects. Where the
provider has enabled offerings, each plan the Project may use has a read-only
ServiceOffering copy (short name so) in the backing namespace. Check
whether the API is served, then list:
kubectl api-resources --api-group=services.kube-dc.com | grep -i serviceofferings
kubectl get serviceofferings -n {backing-namespace}
The offering name is the plan name (spec.planRef.name); everything is in
status. Use an offering only when it is usable:
status.projectionFormat is 1 (the only format this skill knows);Ready condition is True;class.family and
class.name to select the engine, defaults and constraints for sizing,
placementModes, connectivityClasses and deletionPolicies for those
choices, createExample for a manifest.An offering without status, with another format, without Ready=True, or
missing a required field is not usable: skip it and treat what it says as
unknown.
kubectl get serviceofferings -n {backing-namespace} -o custom-columns='PLAN:.metadata.name,FORMAT:.status.projectionFormat,READY:.status.conditions[?(@.type=="Ready")].status,FAMILY:.status.class.family,CLASS:.status.class.name,PLACEMENT:.status.placementModes,CONNECTIVITY:.status.connectivityClasses,HA:.status.capabilities.ha,PER_PROJECT:.status.limits.servicesPerProject'
kubectl get serviceoffering {plan} -n {backing-namespace} -o jsonpath='{.status.defaults}{"\n"}{.status.constraints}{"\n"}'
kubectl get serviceoffering {plan} -n {backing-namespace} -o jsonpath='{.status.createExample}' > service.yaml
test -s service.yaml || echo "createExample missing: do not use this offering"
Match the user's engine against class.family (for example postgresql),
then use that offering's class.name in spec.classRef.name; the two can
differ. Pick a usable offering whose placementModes and
connectivityClasses include what the user needs. Default to
ProviderShared and tenant-native when the offering lists them; otherwise
use only values the offering lists.
Read a usable offering by its contract:
defaults and constraints give per-instance CPU, memory and storage and
the topology range (instances, or shards + replicasPerShard, or
dataReplicas). Equal min and max mean fixed. Only the per-instance
CPU, memory and storage ranges may omit min or max; an absent end there
means the plan sets no bound at that end (storage often has only max).
Topology ranges and backup.retentionDays always carry both min and
max when present; if one is missing, do not use the offering for that
step. An absent default storage means the plan has no persistent storage.
Stay inside the bounds that are present; the service validator still checks
at creation.placementModes, connectivityClasses and deletionPolicies are the only
values the plan accepts. Ask the user what deleting the service later
should do with its data and use their answer as deletionPolicy (one of
deletionPolicies): Delete frees the data and its capacity at once,
SnapshotAndDelete keeps a final backup first, Retain keeps the data,
still charged, until an operator removes it. Do not pick one for them; the
hosted MCP tool create_managed_service asks the same question.operations[].requiresApproval previews which operations a new service
on this plan may request and which wait for the provider; backup gives the
retention range and schedule (absent means the plan takes no backups).limits.servicesPerProject caps services on this plan per Project. Absent
limits means no per-Project limit beyond quota. Quota is a separate check
(check-quota).createExample uses the defaults, the first placement mode and the first
connectivity class. Rename metadata.name from example and add the
family's parameters. If it says TenantCluster, either name the cluster
in placement.clusterRef or, when placementModes also lists
ProviderShared, switch to that for an in-Project service.plan.lastProjectedRevision). A service that names the plan resolves it
again when it is accepted, so the accepted revision can be newer. The
offering is not a reservation and says nothing about existing services.A plan missing from the usable offerings means discovery cannot confirm it is
available; it does not prove the plan is denied (projection can lag). Do not
guess another name. Confirm with the user or provider, or let the server dry
run and the service's Accepted condition decide.
If the resource is not served, the read fails or is Forbidden, or no
offering is usable for the request, fall back: get the plan name and its
supported placement and connectivity from the console (its "or get the YAML
for GitOps" link shows the exact values), the installation's documentation or
the provider, or ask the user. Standard installations publish
{family}-development and {family}-production with ProviderShared and
tenant-native; use those only when the installation confirms them. Do not
guess names, placement, connectivity, sizes, HA or backup retention. Never
export offerings into Git; GitOps manages the ManagedService.
These examples cover selected catalog families. Other integrations can use the same managed service model. Usable offerings describe the plans and settings last projected for the Project; the table shows the standard names and their usual shape only.
| Need | Class | Standard plans | Notes |
|---|---|---|---|
| General SQL, PITR, replicas, pooler | postgresql | postgresql-development, postgresql-production | Production: 3 members, automatic failover |
| MySQL 8.4 | mysql | mysql-development, mysql-production | Sized once at creation; Production is Group Replication (every table needs a primary key) |
| MariaDB 11.8 | mariadb | mariadb-development, mariadb-production | Production is a Galera cluster; Resize and ExpandStorage available |
| Analytics SQL | clickhouse | clickhouse-development, clickhouse-production | Sized by shards × replicas, fixed at creation |
| Cache, sessions, queues | valkey (one node), valkey-ha (Sentinel) | valkey-development, valkey-production | Data you can rebuild |
Use the plan names the usable offerings list. Without offerings, use the
installation's confirmed names, placement and connectivity. Choose any
confirmed plan that satisfies the requested capabilities, sizing, engine
version, placement and connectivity. Use {family}-development (one
instance) unless the user asks for production or high availability; then use
{family}-production (three instances, which triples the quota draw). Tell
the user which plan you chose. Confirm HA (capabilities.ha), retention
(backup.retentionDays), sizing and engine version from the offering or from
the provider; do not assume them from the plan name.
Start from the edited createExample when step 1 produced one; otherwise use
the template for the engine: postgresql-template.yaml,
mysql-mariadb-template.yaml,
clickhouse-template.yaml or
valkey-template.yaml. The PostgreSQL shape:
apiVersion: services.kube-dc.com/v1alpha1
kind: ManagedService
metadata:
name: "{service-name}"
namespace: "{backing-namespace}"
spec:
classRef:
name: postgresql
planRef:
name: postgresql-development
placement:
mode: ProviderShared # set explicitly; a value the offering or the provider confirms
connectivity:
classRef:
name: tenant-native # a value the offering or the provider confirms
topology:
instances: 1 # within the plan's bounds
compute:
cpu: 500m
memory: 1Gi
storage:
size: 10Gi
parameters:
database: "{application-database}"
owner: app
readonlyRole: true
backup:
enabled: true
deletionPolicy: Retain # the user's choice, one of the offering's deletionPolicies
deletionProtection: true
Rules the API enforces:
cpu, memory, instances, storage or
version under spec.parameters; admission refuses them and names the
typed field to use.classRef, planRef, placement, connectivity and storage.class are
immutable. Sizing changes go through ServiceOperation objects (Scale,
Resize, ExpandStorage) where the family allows them; MySQL and ClickHouse
are sized once.topology.shards and topology.replicasPerShard, never
instances.Apply with a server-side dry run first, then wait for readiness and record the UID. Operations require it. Pin it in bindings and policies so that they cannot attach to a replacement service with the same name:
kubectl apply --dry-run=server -f service.yaml
kubectl apply -f service.yaml
kubectl get managedservice {service-name} -n {backing-namespace} -w
kubectl get managedservice {service-name} -n {backing-namespace} -o jsonpath='{.metadata.uid}{"\n"}'
PHASE: Ready with READY: True is the readiness signal. A refusal shows as
Accepted=False with a reason (PlanNotEntitled, ParameterSchemaRejected,
PlanQuotaExceeded); fix the manifest rather than retrying.
Create a ServiceBinding from binding-template.yaml
with the service UID. The platform delivers a Secret; nothing is copied into
manifests.
apiVersion: services.kube-dc.com/v1alpha1
kind: ServiceBinding
metadata:
name: "{service-name}-owner"
namespace: "{backing-namespace}"
spec:
serviceRef:
name: "{service-name}"
serviceUID: "{service-uid}"
role: owner # readonly | default (Valkey) | client, admin (Kafka)
consumer:
kind: ServiceAccount
name: "{workload-service-account}"
namespace: "{backing-namespace}"
delivery:
secretName: "{service-name}-owner"
Secret keys by family:
| Family | Keys |
|---|---|
| PostgreSQL | host, port, dbname, username, password, sslmode (verify-full), ca.crt, uri |
| MySQL, MariaDB | host, port, database, username, password, tls (verify-full), ca.crt, uri, jdbcUrl |
| ClickHouse | host, port (9440), httpsPort (8443), database, username, password, tls, ca.crt, uri, httpsUrl, jdbcUrl |
| Valkey | host, port (6379), username, password, uri, ca.crt |
Every endpoint is TLS-only with the platform's own CA: mount ca.crt and
verify the server (PostgreSQL PGSSLROOTCERT + sslmode=verify-full, MySQL
--ssl-ca --ssl-verify-server-cert, Valkey --tls --cacert). See
db-connection-patterns.md.
Some Helm charts expect a different password key. Prefer a chart setting such
as existingSecretPasswordKey; otherwise create a small bridge Secret from
the binding Secret and recreate it after every rotation unless automation
keeps it synchronized. Creating Secrets needs the Project admin role; the
developer role cannot.
Services are reachable inside the Project through tenant-native. PostgreSQL
can be exposed through the direct-TLS Gateway (parameters.expose.type: gateway, plan entitlement, PostgreSQL 17+ clients) or a public LoadBalancer
(loadbalancer, plan entitlement plus IPv4 quota). The other families have no
external exposure. Do not build host names; use the binding Secret's host.
Scheduled backups run when the plan enables them (daily on the standard
plans). An on-demand backup is a ServiceOperation of type Backup; history
is the read-only ServiceBackup list. Where the family and plan support
recovery, submit a RestoreToNew operation with a typed spec.restore block.
Do not create ManagedService.spec.restoreFrom yourself. PostgreSQL also
supports in-place restore and point-in-time recovery when the plan permits
them. Kafka backs up metadata only. See
backup-restore-patterns.md.
kubectl get managedservice,servicebinding -n {backing-namespace}
kubectl get managedservice {service-name} -n {backing-namespace} \
-o jsonpath='{range .status.conditions[*]}{.type}={.status} {.reason}{"\n"}{end}'
kubectl describe secret {service-name}-owner -n {backing-namespace} # keys only, never values
Report the service name, plan, phase, the binding Secret name and its keys.
Never print password or uri.
For an operator-qualified PostgreSQL public LoadBalancer or managed Gateway
plan, spec.parameters.expose.allowedCIDRs is an optional JSON/YAML array of
at most 32 IPv4 CIDRs. Use /32 for one client and account for client NAT.
Omission on a new endpoint means unrestricted. On an existing signed
restriction, omission preserves the list, including exposure switches;
allowedCIDRs: [] explicitly requests open access. Keep the rest of the
ManagedService parameters intact.
Do not invent plan flags or apply this policy to another database family. Managed Gateway requires the provider's qualified managed-route plan and core route ownership/admission/source-preservation contracts. Wait for the current signed revision and binding, then use its CA, TLS server name and selected external address for a real authenticated SQL query from allowed and denied clients. Internal engine health is not independent public-reachability proof.
agents/openai.yaml (opens in a new tab)backup-restore-patterns.md (opens in a new tab)binding-template.yaml (opens in a new tab)clickhouse-template.yaml (opens in a new tab)db-connection-patterns.md (opens in a new tab)mysql-mariadb-template.yaml (opens in a new tab)postgresql-template.yaml (opens in a new tab)valkey-template.yaml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub kube-dc/kube-dc-public --plugin kube-dc18 skills in this plugin
/check-quotaCheck Kube-DC Organization and Project quota before creating workloads, VMs, databases, Managed Clusters, public IPs, or storage./create-projectCreate a Kube-DC Project inside an existing Organization. Covers network selection, quota preflight, the Project manifest, and readiness verification./create-vmCreate a KubeVirt virtual machine in a Kube-DC Project using the live OS catalog, Project networking, supported storage, and the generated SSH keypair./deploy-appDeploy a containerized application to a Kube-DC Project as an Application (apps.kube-dc.com) or a plain workload, with optional persistent storage, a managed database, external exposure, or gated Shared GPU acceleration; set up keyless deploys, builds on push and pull request previews from a GitHub repository, with a managed container registry or the user's own; roll back, pause and inspect builds./deploy-web-stackDeploy a complete web application in a Kube-DC Project — a managed database (PostgreSQL, MySQL or MariaDB) with delivered credentials, an optional persistent volume, and an HTTPS hostname with a platform certificate through the shared Gateway, without a public IP. Use for WordPress, CMSs, APIs and any app that needs a database and a URL./expose-serviceExpose a Service from a Kube-DC Project with a hostname-based HTTP/HTTPS/TLS Gateway route or a dedicated EIP-backed LoadBalancer for selected TCP/UDP ports.Other plugins' skills for the same job