crd

package
v0.0.0-...-2ccca0a Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRDKind     string = "Database"
	CRDPlural   string = "databases"
	CRDGroup    string = "aws.pmacik.dev"
	CRDVersion  string = "v1alpha1"
	FullCRDName string = "databases." + CRDGroup
)

Variables

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

Functions

func CreateCRD

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

func NewRESTClient

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

Create a Rest client with the new CRD Schema

Types

type Database

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

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

type DatabaseList

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

func (*DatabaseList) DeepCopyObject

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

type DatabaseSpec

type DatabaseSpec struct {
	Username              string         `json:"username"`
	Password              PasswordSecret `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:"publiclyAccessible,omitempty"`
	StorageEncrypted      bool           `json:"storageEncrypted,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

type DatabaseStatus struct {
	State              string `json:"state,omitempty" description:"State of the deploy"`
	Message            string `json:"message,omitempty" description:"Detailed message around the state"`
	DBConnectionConfig string `json:"dbConnectionConfig" description:"Name of a Config Map with DB Connection Configuration"`
	DBCredentials      string `json:"dbCredentials" description:"Name of the secret to hold DB Credentials"`
}

type PasswordSecret

type PasswordSecret struct {
	Name string `json:"name"`
	Key  string `json:"key"`
}

Jump to

Keyboard shortcuts

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