Documentation
¶
Index ¶
- type PodInfoInstanceReconciler
- func (r *PodInfoInstanceReconciler) CheckAndUpdateExistingDeploymentAsNeeded(ctx context.Context, pii *podinfoappv1.PodInfoInstance) error
- func (r *PodInfoInstanceReconciler) CreateDeploymentForPodInfoInstance(ctx context.Context, pii *podinfoappv1.PodInfoInstance) error
- func (r *PodInfoInstanceReconciler) CreateRedisDeploymentAndService(ctx context.Context, pts *corev1.PodTemplateSpec, ...) error
- func (r *PodInfoInstanceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *PodInfoInstanceReconciler) SetupWithManager(mgr ctrl.Manager) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PodInfoInstanceReconciler ¶
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 ¶
func (r *PodInfoInstanceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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.