resources

package
v0.4.1-0...-f9b3edd Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright 2021 kubernetes-app Solutions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 kubernetes-app Solutions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 kubernetes-app Solutions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 kubernetes-app Solutions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 kubernetes-app Solutions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOwnerRefToObject

func AddOwnerRefToObject(obj metav1.Object, ownerRef metav1.OwnerReference)

AddOwnerRefToObject adds the owner references to object

func FinalContainerDef

func FinalContainerDef(cr *redisv1alpha1.Redis, role string) []corev1.Container

FinalContainerDef will generate the final statefulset definition

func GenerateContainerDef

func GenerateContainerDef(cr *redisv1alpha1.Redis, role string) corev1.Container

GenerateContainerDef generates container definition

func GenerateMetaInformation

func GenerateMetaInformation(resourceKind string, apiVersion string) metav1.TypeMeta

GenerateMetaInformation generates the meta information

func GenerateObjectMetaInformation

func GenerateObjectMetaInformation(name string, namespace string, labels map[string]string, annotations map[string]string) metav1.ObjectMeta

GenerateObjectMetaInformation generates the object meta information

func GeneratePVCTemplate

func GeneratePVCTemplate(cr *redisv1alpha1.Redis, role string) corev1.PersistentVolumeClaim

GeneratePVCTemplate will create the persistent volume claim template

func GenerateSecretAnots

func GenerateSecretAnots() map[string]string

GenerateSecretAnots generates and returns secrets annotations

func GenerateSecretDef

func GenerateSecretDef(cr *redisv1alpha1.Redis, secret *corev1.Secret, scheme *runtime.Scheme) error

GenerateSecretDef is a method that will generate a secret interface

func GenerateServiceAnots

func GenerateServiceAnots() map[string]string

GenerateServiceAnots generates and returns service annotations

func GenerateServiceDef

func GenerateServiceDef(cr *redisv1alpha1.Redis, svc *corev1.Service, serviceMode ServiceMode, labels map[string]string, role string, scheme *runtime.Scheme) error

GenerateServiceDef generate service definition

func GenerateStateFulSetsDef

func GenerateStateFulSetsDef(cr *redisv1alpha1.Redis, sts *appsv1.StatefulSet, labels map[string]string, role string, scheme *runtime.Scheme) error

GenerateStateFulSetsDef generates the statefulsets definition

func GenerateStatefulSetsAnots

func GenerateStatefulSetsAnots() map[string]string

GenerateStatefulSetsAnots generates and returns statefulsets annotations

func LabelSelectors

func LabelSelectors(labels map[string]string) *metav1.LabelSelector

LabelSelectors generates object for label selection

Types

type K8sClient

type K8sClient struct {
	client.Client
}

K8sClient is the struct for ODLM controllers

func NewK8sClient

func NewK8sClient(mgr manager.Manager) *K8sClient

NewK8sClient is the method to initialize an Operator struct

func (*K8sClient) CreateOrUpdateMasterHeadlessService

func (rc *K8sClient) CreateOrUpdateMasterHeadlessService(cr *redisv1alpha1.Redis) error

CreateOrUpdateMasterHeadlessService creates master headless service

func (*K8sClient) CreateOrUpdateMasterService

func (rc *K8sClient) CreateOrUpdateMasterService(cr *redisv1alpha1.Redis) error

CreateOrUpdateMasterService creates different services for master

func (*K8sClient) CreateOrUpdateRedisSecret

func (rc *K8sClient) CreateOrUpdateRedisSecret(cr *redisv1alpha1.Redis) error

func (*K8sClient) CreateOrUpdateRedisServer

func (rc *K8sClient) CreateOrUpdateRedisServer(cr *redisv1alpha1.Redis, role string) error

func (*K8sClient) CreateOrUpdateSlaveHeadlessService

func (rc *K8sClient) CreateOrUpdateSlaveHeadlessService(cr *redisv1alpha1.Redis) error

CreateOrUpdateSlaveHeadlessService creates slave headless service

func (*K8sClient) CreateOrUpdateSlaveService

func (rc *K8sClient) CreateOrUpdateSlaveService(cr *redisv1alpha1.Redis) error

CreateOrUpdateSlaveService creates different services for slave

func (*K8sClient) CreateOrUpdateStandaloneHeadlessService

func (rc *K8sClient) CreateOrUpdateStandaloneHeadlessService(cr *redisv1alpha1.Redis) error

CreateOrUpdateStandaloneHeadlessService creates redis standalone service

func (*K8sClient) CreateOrUpdateStandaloneService

func (rc *K8sClient) CreateOrUpdateStandaloneService(cr *redisv1alpha1.Redis) error

CreateOrUpdateStandaloneService creates redis standalone service

func (*K8sClient) CreateRedisService

func (rc *K8sClient) CreateRedisService(cr *redisv1alpha1.Redis, serviceMode ServiceMode, role string) error

func (*K8sClient) FetchStatefulSet

func (rc *K8sClient) FetchStatefulSet(cr *redisv1alpha1.Redis, role string) (*appsv1.StatefulSet, error)

func (*K8sClient) FetchStatefulSetPodsByLabels

func (rc *K8sClient) FetchStatefulSetPodsByLabels(namespace string, labels map[string]string) (*corev1.PodList, error)

FetchStatefulSetPodsByLabels implement the IStatefulSetControl.Interface.

func (*K8sClient) GetRedisClusterNodes

func (rc *K8sClient) GetRedisClusterNodes(cr *redisv1alpha1.Redis) (*redisv1alpha1.Nodes, error)

type ServiceMode

type ServiceMode string
const (
	HeadService     ServiceMode = "head"
	HeadlessService ServiceMode = "headless"
)

Jump to

Keyboard shortcuts

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