k8s-rds: github.com/sorenmat/k8s-rds/crd Index | Files

package crd

import "github.com/sorenmat/k8s-rds/crd"

Index

Package Files

crd.go

Constants

const (
    CRDPlural          string = "databases"
    CRDGroup           string = "k8s.io"
    CRDVersion         string = "v1"
    FullCRDName        string = "databases." + CRDGroup
    StorageTypePattern string = `gp2|io1`
    DBNamePattern      string = "^[A-Za-z]\\w+$"
    DBUsernamePattern  string = "^[A-Za-z]\\w+$"
)

Variables

var SchemeGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion}

func CreateCRD Uses

func CreateCRD(clientset apiextcs.Interface) error

CreateCRD creates the CRD resource, ignore error if it already exists

func NewClient Uses

func NewClient(cfg *rest.Config) (*rest.RESTClient, *runtime.Scheme, error)

Create a Rest client with the new CRD Schema

func NewDatabaseCRD Uses

func NewDatabaseCRD() *apiextv1beta1.CustomResourceDefinition

type Database Uses

type Database struct {
    meta_v1.TypeMeta   `json:",inline"`
    meta_v1.ObjectMeta `json:"metadata"`
    Spec               DatabaseSpec   `json:"spec"`
    Status             DatabaseStatus `json:"status,omitempty"`
}

Database is the definition of our CRD Database

func (*Database) DeepCopyObject Uses

func (d *Database) DeepCopyObject() runtime.Object

type DatabaseList Uses

type DatabaseList struct {
    meta_v1.TypeMeta `json:",inline"`
    meta_v1.ListMeta `json:"metadata"`
    Items            []Database `json:"items"`
}

func (*DatabaseList) DeepCopyObject Uses

func (d *DatabaseList) DeepCopyObject() runtime.Object

type DatabaseSpec Uses

type DatabaseSpec struct {
    Username              string               `json:"username"`
    Password              v1.SecretKeySelector `json:"password"`
    DBName                string               `json:"dbname"`
    Engine                string               `json:"engine"` // "postgres"
    Class                 string               `json:"class"`  // like "db.t2.micro"
    Size                  int64                `json:"size"`   // size in gb
    MultiAZ               bool                 `json:"multiaz,omitempty"`
    PubliclyAccessible    bool                 `json:"publicaccess,omitempty"`
    StorageEncrypted      bool                 `json:"encrypted,omitempty"`
    StorageType           string               `json:"storagetype,omitempty"`
    Iops                  int64                `json:"iops,omitempty"`
    BackupRetentionPeriod int64                `json:"backupretentionperiod,omitempty"` // between 0 and 35, zero means disable
    DeleteProtection      bool                 `json:"deleteprotection,omitempty"`
}

DatabaseSpec main structure describing the database instance

type DatabaseStatus Uses

type DatabaseStatus struct {
    State   string `json:"state,omitempty" description:"State of the deploy"`
    Message string `json:"message,omitempty" description:"Detailed message around the state"`
}

Package crd imports 9 packages (graph) and is imported by 5 packages. Updated 2020-01-10. Refresh now. Tools for package owners.