processes

package
v0.0.0-...-b80888c Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

This repo is dedicated to post processes that run after the our k8s vpa makes it's recommendation.

To add a post process function, make a go package in a new directory inside the processes directory. In order to be added the post processor list, the given function must be structured as follows:

import (
	v1 "github.com/ezoic/wphosting-vpa-autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1"
	"github.com/ezoic/wphosting-vpa-autoscaler/vertical-pod-autoscaler/pkg/recommender/model"
)

func DoSomeProcess(vpa *model.Vpa, recommendation *v1.RecommendedPodResources, policy *v1.PodResourcePolicy) *v1.RecommendedPodResources {
	// some code that does stuff
	return newRecommendation // or just return the given one if you just wanna log some stuff
}

After making you're new package with your new process function, go ahead and slap that in the processes.go file as part of the PostProcessList array:

var PostProcessList = postProcessList{
	email.Process,
	log.Process,
	your.ProcessFunction,
}

Now run a go mod tidy and you should be all set.

This repo is used in our wphosting-vpa-autoscaler repo which is a fork of the kubernetes vpa. Here we can make customizations to the vpa recommender and add post processors.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PostProcessList = postProcessList{
	email.Process,
	log.Process,
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
processes
log

Jump to

Keyboard shortcuts

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