v110

package
v0.0.0-...-9ed255f Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppStateUnknown AppState = "unknown"
	AppStateInit             = "initializing"
	AppStateReady            = "ready"
	AppStateError            = "error"
)
View Source
const (
	PlatformUndef      Platform = ""
	PlatformKubernetes          = "kubernetes"
	PlatformOpenshift           = "openshift"
)
View Source
const AffinityTopologyKeyOff = "none"

Variables

View Source
var AffinityValidTopologyKeys = map[string]struct{}{
	AffinityTopologyKeyOff:                     {},
	"kubernetes.io/hostname":                   {},
	"failure-domain.beta.kubernetes.io/zone":   {},
	"failure-domain.beta.kubernetes.io/region": {},
}
View Source
var Bundle = []k8s.BundleObject{
	{
		Kind: "CustomResourceDefinition",
		Name: "perconaxtradbclusters.pxc.percona.com",
		Data: `
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: perconaxtradbclusters.pxc.percona.com
spec:
  group: pxc.percona.com
  names:
    kind: PerconaXtraDBCluster
    listKind: PerconaXtraDBClusterList
    plural: perconaxtradbclusters
    singular: perconaxtradbcluster
    shortNames:
    - pxc
    - pxcs
  scope: Namespaced
  versions:
    - name: v1
      storage: true
      served: true
    - name: v1alpha1
      storage: false
      served: true
  additionalPrinterColumns:
    - name: Endpoint
      type: string
      JSONPath: .status.host
    - name: Status
      type: string
      JSONPath: .status.state
    - name: PXC
      type: string
      description: Ready pxc nodes
      JSONPath: .status.pxc.ready
    - name: proxysql
      type: string
      description: Ready pxc nodes
      JSONPath: .status.proxysql.ready
    - name: Age
      type: date
      JSONPath: .metadata.creationTimestamp
  subresources:
    status: {}
`,
	},
	{
		Kind: "CustomResourceDefinition",
		Name: "perconaxtradbclusterbackups.pxc.percona.com",
		Data: `
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: perconaxtradbclusterbackups.pxc.percona.com
spec:
  group: pxc.percona.com
  names:
    kind: PerconaXtraDBClusterBackup
    listKind: PerconaXtraDBClusterBackupList
    plural: perconaxtradbclusterbackups
    singular: perconaxtradbclusterbackup
    shortNames:
    - pxc-backup
    - pxc-backups
  scope: Namespaced
  versions:
    - name: v1
      storage: true
      served: true
  additionalPrinterColumns:
    - name: Cluster
      type: string
      description: Cluster name
      JSONPath: .spec.pxcCluster
    - name: Storage
      type: string
      description: Storage name from pxc spec
      JSONPath: .status.storageName
    - name: Destination
      type: string
      description: Backup destination
      JSONPath: .status.destination
    - name: Status
      type: string
      description: Job status
      JSONPath: .status.state
    - name: Completed
      description: Completed time
      type: date
      JSONPath: .status.completed
    - name: Age
      type: date
      JSONPath: .metadata.creationTimestamp
  subresources:
    status: {}
`,
	},
	{
		Kind: "CustomResourceDefinition",
		Name: "perconaxtradbclusterrestores.pxc.percona.com",
		Data: `
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: perconaxtradbclusterrestores.pxc.percona.com
spec:
  group: pxc.percona.com
  names:
    kind: PerconaXtraDBClusterRestore
    listKind: PerconaXtraDBClusterRestoreList
    plural: perconaxtradbclusterrestores
    singular: perconaxtradbclusterrestore
    shortNames:
    - pxc-restore
    - pxc-restores
  scope: Namespaced
  versions:
    - name: v1
      storage: true
      served: true
  additionalPrinterColumns:
    - name: Cluster
      type: string
      description: Cluster name
      JSONPath: .spec.pxcCluster
    - name: Status
      type: string
      description: Job status
      JSONPath: .status.state
    - name: Completed
      description: Completed time
      type: date
      JSONPath: .status.completed
    - name: Age
      type: date
      JSONPath: .metadata.creationTimestamp
  subresources:
    status: {}
`,
	},
	{
		Kind: "CustomResourceDefinition",
		Name: "perconaxtradbbackups.pxc.percona.com",
		Data: `
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: perconaxtradbbackups.pxc.percona.com
spec:
  group: pxc.percona.com
  names:
    kind: PerconaXtraDBBackup
    listKind: PerconaXtraDBBackupList
    plural: perconaxtradbbackups
    singular: perconaxtradbbackup
    shortNames: []
  scope: Namespaced
  versions:
    - name: v1alpha1
      storage: true
      served: true
  additionalPrinterColumns:
    - name: Cluster
      type: string
      description: Cluster name
      JSONPath: .spec.pxcCluster
    - name: Storage
      type: string
      description: Storage name from pxc spec
      JSONPath: .status.storageName
    - name: Destination
      type: string
      description: Backup destination
      JSONPath: .status.destination
    - name: Status
      type: string
      description: Job status
      JSONPath: .status.state
    - name: Completed
      description: Completed time
      type: date
      JSONPath: .status.completed
    - name: Age
      type: date
      JSONPath: .metadata.creationTimestamp
`,
	},
	{
		Kind: "Role",
		Name: "percona-xtradb-cluster-operator",
		Data: `
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: percona-xtradb-cluster-operator
rules:
- apiGroups:
  - pxc.percona.com
  resources:
  - perconaxtradbclusters
  - perconaxtradbclusters/status
  - perconaxtradbclusterbackups
  - perconaxtradbclusterbackups/status
  - perconaxtradbclusterrestores
  - perconaxtradbclusterrestores/status
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - ""
  resources:
  - pods
  - pods/exec
  - configmaps
  - services
  - persistentvolumeclaims
  - secrets
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - apps
  resources:
  - deployments
  - replicasets
  - statefulsets
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - batch
  resources:
  - jobs
  - cronjobs
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - policy
  resources:
  - poddisruptionbudgets
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - certmanager.k8s.io
  resources:
  - issuers
  - certificates
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
  - deletecollection
`,
	},
	{
		Kind: "RoleBinding",
		Name: "default-account-percona-xtradb-cluster-operator",
		Data: `
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: default-account-percona-xtradb-cluster-operator
subjects:
- kind: ServiceAccount
  name: default
roleRef:
  kind: Role
  name: percona-xtradb-cluster-operator
  apiGroup: rbac.authorization.k8s.io
`,
	},
	{
		Kind: "Deployment",
		Name: "percona-xtradb-cluster-operator",
		Data: `
apiVersion: apps/v1
kind: Deployment
metadata:
  name: percona-xtradb-cluster-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: percona-xtradb-cluster-operator
  template:
    metadata:
      labels:
        name: percona-xtradb-cluster-operator
    spec:
      containers:
        - name: percona-xtradb-cluster-operator
          image: {{image}}
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - percona-xtradb-cluster-operator
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPERATOR_NAME
              value: "percona-xtradb-cluster-operator"
`,
	},
}

Bundle is bundle object for version 1.0.0

Functions

This section is empty.

Types

type AppState

type AppState string

type AppStatus

type AppStatus struct {
	Size    int32    `json:"size,omitempty"`
	Ready   int32    `json:"ready,omitempty"`
	Status  AppState `json:"status,omitempty"`
	Message string   `json:"message,omitempty"`
}

type BackupStorageS3Spec

type BackupStorageS3Spec struct {
	Bucket            string `json:"bucket"`
	CredentialsSecret string `json:"credentialsSecret"`
	Region            string `json:"region,omitempty"`
	EndpointURL       string `json:"endpointUrl,omitempty"`
}

type BackupStorageSpec

type BackupStorageSpec struct {
	Type   BackupStorageType   `json:"type"`
	S3     BackupStorageS3Spec `json:"s3,omitempty"`
	Volume *VolumeSpec         `json:"volume,omitempty"`
}

type BackupStorageType

type BackupStorageType string
const (
	BackupStorageFilesystem BackupStorageType = "filesystem"
	BackupStorageS3         BackupStorageType = "s3"
)

type PMMSpec

type PMMSpec struct {
	Enabled    bool   `json:"enabled,omitempty"`
	ServerHost string `json:"serverHost,omitempty"`
	Image      string `json:"image,omitempty"`
	ServerUser string `json:"serverUser,omitempty"`
	ServerPass string `json:"serverPass,omitempty"`
}

type PXCScheduledBackup

type PXCScheduledBackup struct {
	Image            string                            `json:"image,omitempty"`
	ImagePullSecrets []corev1.LocalObjectReference     `json:"imagePullSecrets,omitempty"`
	Schedule         []PXCScheduledBackupSchedule      `json:"schedule,omitempty"`
	Storages         map[string]*k8s.BackupStorageSpec `json:"storages,omitempty"`
}

type PXCScheduledBackupSchedule

type PXCScheduledBackupSchedule struct {
	Name        string `json:"name,omitempty"`
	Schedule    string `json:"schedule,omitempty"`
	Keep        int    `json:"keep,omitempty"`
	StorageName string `json:"storageName,omitempty"`
}

type PerconaXtraDBCluster

type PerconaXtraDBCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PerconaXtraDBClusterSpec   `json:"spec,omitempty"`
	Status PerconaXtraDBClusterStatus `json:"status,omitempty"`

	StorageClassesAllocated PerconaXtraDBClusterStorageClasses
	StorageSizeAllocated    PerconaXtraDBStorageSizes
}

PerconaXtraDBCluster is the Schema for the perconaxtradbclusters API

func (*PerconaXtraDBCluster) GetCR

func (cr *PerconaXtraDBCluster) GetCR() (string, error)

func (*PerconaXtraDBCluster) GetName

func (cr *PerconaXtraDBCluster) GetName() string

func (*PerconaXtraDBCluster) MarshalRequests

func (cr *PerconaXtraDBCluster) MarshalRequests() error

func (*PerconaXtraDBCluster) SetLabels

func (cr *PerconaXtraDBCluster) SetLabels(labels map[string]string)

func (*PerconaXtraDBCluster) SetNew

SetNew setting up cr using ClusterConfig

func (*PerconaXtraDBCluster) UpdateWith

func (cr *PerconaXtraDBCluster) UpdateWith(c config.ClusterConfig, s3 *k8s.BackupStorageSpec) (err error)

func (*PerconaXtraDBCluster) Upgrade

func (cr *PerconaXtraDBCluster) Upgrade(imgs map[string]string)

Upgrade upgrades culster with given images

type PerconaXtraDBClusterList

type PerconaXtraDBClusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PerconaXtraDBCluster `json:"items"`
}

PerconaXtraDBClusterList contains a list of PerconaXtraDBCluster

type PerconaXtraDBClusterSpec

type PerconaXtraDBClusterSpec struct {
	Platform    *Platform           `json:"platform,omitempty"`
	SecretsName string              `json:"secretsName,omitempty"`
	PXC         *PodSpec            `json:"pxc,omitempty"`
	ProxySQL    *PodSpec            `json:"proxysql,omitempty"`
	PMM         *PMMSpec            `json:"pmm,omitempty"`
	Backup      *PXCScheduledBackup `json:"backup,omitempty"`
}

PerconaXtraDBClusterSpec defines the desired state of PerconaXtraDBCluster

type PerconaXtraDBClusterStatus

type PerconaXtraDBClusterStatus struct {
	PXC      AppStatus `json:"pxc,omitempty"`
	ProxySQL AppStatus `json:"proxysql,omitempty"`
	Host     string    `json:"host,omitempty"`
	Messages []string  `json:"message,omitempty"`
	Status   AppState  `json:"state,omitempty"`
}

PerconaXtraDBClusterStatus defines the observed state of PerconaXtraDBCluster

type PerconaXtraDBClusterStorageClasses

type PerconaXtraDBClusterStorageClasses struct {
	PXC      string
	ProxySQL string
	Backup   string
}

type PerconaXtraDBStorageSizes

type PerconaXtraDBStorageSizes struct {
	PXC      string
	ProxySQL string
	Backup   string
}

type Platform

type Platform string

type PodAffinity

type PodAffinity struct {
	TopologyKey *string          `json:"antiAffinityTopologyKey,omitempty"`
	Advanced    *corev1.Affinity `json:"advanced,omitempty"`
}

type PodDisruptionBudgetSpec

type PodDisruptionBudgetSpec struct {
	MinAvailable   *intstr.IntOrString `json:"minAvailable,omitempty"`
	MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
}

type PodResources

type PodResources struct {
	Requests *ResourcesList `json:"requests,omitempty"`
	Limits   *ResourcesList `json:"limits,omitempty"`
}

type PodSpec

type PodSpec struct {
	Enabled             bool                          `json:"enabled,omitempty"`
	Size                int32                         `json:"size,omitempty"`
	Image               string                        `json:"image,omitempty"`
	Resources           *PodResources                 `json:"resources,omitempty"`
	VolumeSpec          *VolumeSpec                   `json:"volumeSpec,omitempty"`
	Affinity            *PodAffinity                  `json:"affinity,omitempty"`
	NodeSelector        map[string]string             `json:"nodeSelector,omitempty"`
	Tolerations         []corev1.Toleration           `json:"tolerations,omitempty"`
	PriorityClassName   string                        `json:"priorityClassName,omitempty"`
	Annotations         map[string]string             `json:"annotations,omitempty"`
	Labels              map[string]string             `json:"labels,omitempty"`
	ImagePullSecrets    []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
	AllowUnsafeConfig   bool                          `json:"allowUnsafeConfigurations,omitempty"`
	Configuration       string                        `json:"configuration,omitempty"`
	PodDisruptionBudget *PodDisruptionBudgetSpec      `json:"podDisruptionBudget,omitempty"`
}

type ResourcesList

type ResourcesList struct {
	Memory string `json:"memory,omitempty"`
	CPU    string `json:"cpu,omitempty"`
}

type ServerVersion

type ServerVersion struct {
	Platform Platform
	Info     k8sversion.Info
}

ServerVersion represents info about k8s / openshift server version

type Volume

type Volume struct {
	PVCs    []corev1.PersistentVolumeClaim
	Volumes []corev1.Volume
}

type VolumeSpec

type VolumeSpec struct {
	// EmptyDir to use as data volume for mysql. EmptyDir represents a temporary
	// directory that shares a pod's lifetime.
	// +optional
	EmptyDir *corev1.EmptyDirVolumeSource `json:"emptyDir,omitempty"`

	// HostPath to use as data volume for mysql. HostPath represents a
	// pre-existing file or directory on the host machine that is directly
	// exposed to the container.
	// +optional
	HostPath *corev1.HostPathVolumeSource `json:"hostPath,omitempty"`

	// PersistentVolumeClaim to specify PVC spec for the volume for mysql data.
	// It has the highest level of precedence, followed by HostPath and
	// EmptyDir. And represents the PVC specification.
	// +optional
	PersistentVolumeClaim *corev1.PersistentVolumeClaimSpec `json:"persistentVolumeClaim,omitempty"`
}

Jump to

Keyboard shortcuts

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