sql-operator

command module
v1.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

README

SqlOperator

Operate sql databases, users and grants.

This is a WIP project and should not at all be used in production at this time. Feel free to validate in CI pipelines.

Engines

Currenty, only MySQL is supported.

Example

---
# Register a host - Not created by the operator
apiVersion: stenic.io/v1alpha1
kind: SqlHost
metadata:
  name: sqlhost-sample
spec:
  engine: Mysql
  endpoint:
    host: 192.168.1.123
    port: 3306
  credentials:
    username: sqloperator
    password: xxxxxxxxxxx

---
# Create a database on the host
apiVersion: stenic.io/v1alpha1
kind: SqlDatabase
metadata:
  name: sqldatabase-sample
spec:
  databaseName: test123
  hostRef:
    name: sqlhost-sample
  cleanupPolicy: Delete

---
# Create a user on the host
apiVersion: stenic.io/v1alpha1
kind: SqlUser
metadata:
  name: sqluser-sample
spec:
  credentials:
    username: sqloperator_tst
    password: sqloperator_tst
  hostRef:
    name: sqlhost-sample
  cleanupPolicy: Delete

---
# Add some grant to the user
apiVersion: stenic.io/v1alpha1
kind: SqlGrant
metadata:
  name: sqlgrants-sample
spec:
  hostRef:
    name: sqlhost-sample
  userRef:
    name: sqluser-sample
  databaseRef:
    name: sqldatabase-sample
  grants:
    - INSERT
    - SELECT
    - UPDATE
    - DELETE
  cleanupPolicy: Delete

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=stenic.io
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group +kubebuilder:object:generate=true +groupName=stenic.io

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL