controller

package
v0.0.0-...-733dcc4 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PodInfoInstanceReconciler

type PodInfoInstanceReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

PodInfoInstanceReconciler reconciles a PodInfoInstance object

func (*PodInfoInstanceReconciler) CheckAndUpdateExistingDeploymentAsNeeded

func (r *PodInfoInstanceReconciler) CheckAndUpdateExistingDeploymentAsNeeded(ctx context.Context, pii *podinfoappv1.PodInfoInstance) error

CheckAndUpdateExistingDeploymentAsNeeded checks the existing Deployment for the given PodInfoInstance and updates it as needed This function involves a few steps: 1. Check if the main App Deployment needs to be updated and update it as needed 2. If there's an existing Redis Deployment and Redis is still enabled, check if it needs to be updated and update it as needed 3. If there's an existing Redis Deployment but Redis has been disabled, delete the Redis Deployment and Service and remove the Redis Host and Port from the main app's environment variables 4. If Redis is enabled but there's no existing Redis Deployment, create one (Deployment and Service) and add the Redis Host and Port to the main app's environment variables

func (*PodInfoInstanceReconciler) CreateDeploymentForPodInfoInstance

func (r *PodInfoInstanceReconciler) CreateDeploymentForPodInfoInstance(ctx context.Context, pii *podinfoappv1.PodInfoInstance) error

CreateDeploymentForPodInfoInstance creates a new Deployment for the given PodInfoInstance

func (*PodInfoInstanceReconciler) CreateRedisDeploymentAndService

func (r *PodInfoInstanceReconciler) CreateRedisDeploymentAndService(ctx context.Context, pts *corev1.PodTemplateSpec, pii *podinfoappv1.PodInfoInstance) error

CreateRedisDeploymentAndService creates a new Redis Deployment and adds the Service's Host and Port to the PodInfoInstance's Deployment's Pod's environment variables

func (*PodInfoInstanceReconciler) Reconcile

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/reconcile

func (*PodInfoInstanceReconciler) SetupWithManager

func (r *PodInfoInstanceReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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