Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add content to site #69

Draft
wants to merge 10 commits into
base: feat/add-docusaurus
Choose a base branch
from
4 changes: 2 additions & 2 deletions .github/workflows/pre_commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
SKIP: "no-commit-to-branch" # if not skipped, will always fail on main
- name: Push changes
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
if git diff-index --quiet HEAD; then
echo "No changes were made"
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ repos:
rev: v3.0.1
hooks:
- id: prettier
files: \.md$
files: \.(md|mdx)$
- repo: local
hooks:
- id: prevent-todo-comments
name: prevent todo comments
entry: '\/\/ *(TODO|FIXME)\b' # matches a golang comment beginning with "TODO" or "FIXME"
entry: '[ ^](//|#|<!--|/\*)\s*(TODO|FIXME)\b' # matches a comment beginning with "TODO" or "FIXME"
language: pygrep
files: \.go$
files: \.(go|md|mdx)$
- id: prevent-too-small-headings
name: prevent too small headings
entry: "^#{5,} " # matches a h5 or smaller markdown heading
Expand Down
20 changes: 12 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,31 @@ Commits:

Try to stick to golang best practices and standards:

<!-- keep this list updated everytime someone opens a pr with best practice issues -->
<!-- keep this list updated every time someone opens a pr with best practice issues -->

- Package structure standards: https://github.com/golang-standards/project-layout
- [Package structure standards](https://github.com/golang-standards/project-layout)
- Use guard clauses if applicable
- Try to avoid using else. Most of the time these can be replaced by just placing the else block content directly after the if or by refactoring the if block to be an additional function.
- Comments on funcs/types (esp. public ones)
- Only make functions public if necessary

## Issues

If applicable use the issue template. This ensures a consistent structure which makes it easier to find important details.
Issues which aren't ready for processing, can be marked as a draft by writing "Draft: " infront of the issue name.
If applicable use the issue template.
This ensures a consistent structure which makes it easier to find important details.
Issues which aren't ready for processing, can be marked as a draft by writing "Draft: " in front of the issue name.

## Pull Requests

Use the Pull Request Template. This ensures a consistent structure which makes it easier to find important details.
Use the Pull Request Template.
This ensures a consistent structure which makes it easier to find important details.
Set yourself and any other collaborators as assignee.

## Pre Commit

It is recommended to install pre-commit. This insures that formatting is consistent, you don't commit to protected branches and you don't accidentally commit broken code or new functionality without changing the tests. The installation process is in the [README](README.md#setting-up-pre-commit)
It is recommended to install pre-commit.
This ensures that formatting is consistent, you don't commit to protected branches and you don't accidentally commit broken code or new functionality without changing the tests.
The installation process is on [our website](https://caas-team.github.io/GoKubeDownscaler/guides/developing#setting-up-pre-commit).

## Versioning

Expand All @@ -67,7 +71,7 @@ Releases are following the semver versioning standard:
Layout: `<Major>.<Minor>.<Patch>` (example: 1.1.0)

- MAJOR: increment on breaking changes
- MINOR: increment on new funcitonality/features
- MINOR: increment on new functionality/features
- PATCH: increment on small bug fixes

You can find more infomration on semantic versioning here [here](https://semver.org/)
You can find more information on semantic versioning [on the official website](https://semver.org/).
557 changes: 32 additions & 525 deletions README.md

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions deployments/chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,26 @@ Here is a brief overview of all the values contained in this chart:

<!-- It's recommended to disable word wrap to view/edit this table -->

| **Key** | **Description** |
| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="replicaCount">replicaCount</a> | Adjusts the number of replicas that the go-kube-downscaler deployment will have. |
| <a id="image">image</a> | Contains the repository URL and the image tag for the image you want to use. |
| <a id="arguments">arguments</a> | Defines command line arguments for the container. |
| <a id="includedResources">includedResources</a> | Defines all the resources that the go-kube-downscaler is supposed to be able to handle. |
| <a id="fullnameOverride">fullnameOverride</a> | Overrides the full names of the created Kubernetes resources with the provided name if set. |
| <a id="nameOverride">nameOverride</a> | Overrides the chart name for the created Kubernetes resources. |
| <a id="constrainedDownscaler">constrainedDownscaler</a> | Sets the go-kube-downscaler to a constrained state if true, meaning that it does not run clusterwide but restricted to a list of namespaces. These namespaces are listed in [constrainedNamespaces](#constrainedNamespaces). |
| <a id="constrainedNamespaces">constrainedNamespaces</a> | A list of namespaces the go-kube-downscaler is going to operate on when constrained. |
| <a id="serviceAccount">serviceAccount</a> | Specifies whether a new ServiceAccount is supposed to be created and if not, what the name of the ServiceAccount to use is. |
| <a id="podSecurityContext">podSecurityContext</a> | Defines the SecurityContext on pod level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) |
| <a id="securityContext">securityContext</a> | Defines the SecurityContext on container level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) |
| <a id="resources">resources</a> | Defines the CPU and memory limits and requests. |
| <a id="nodeSelector">nodeSelector</a> | Defines labels of nodes that you want the deployment to schedule them on. |
| <a id="tolerations">tolerations</a> | Adds tolerations to the pods of the deployment to be able to be scheduled on nodes with matching taints. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) |
| <a id="affinity">affinity</a> | Defines rules for node affinity and pod affinity/anti-affinity. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) |
| <a id="configMapName">configMapName</a> | The name of the configmap for the go-kube-downscaler. |
| <a id="excludedNamespaces">excludedNamespaces</a> | A list of namespaces that are supposed to be excluded from the downscaling process of the go-kube-downscaler. |
| <a id="extraConfig">extraConfig</a> | Adds additional specified environment variables to the ConfigMap. |
| **Key** | **Description** |
| ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a target="_blank" id="replicaCount">replicaCount</a> | Adjusts the number of replicas that the go-kube-downscaler deployment will have. |
| <a target="_blank" id="image">image</a> | Contains the repository URL and the image tag for the image you want to use. |
| <a target="_blank" id="arguments">arguments</a> | Defines command line arguments for the container. |
| <a target="_blank" id="includedResources">includedResources</a> | Defines all the resources that the go-kube-downscaler is supposed to be able to handle. |
| <a target="_blank" id="fullnameOverride">fullnameOverride</a> | Overrides the full names of the created Kubernetes resources with the provided name if set. |
| <a target="_blank" id="nameOverride">nameOverride</a> | Overrides the chart name for the created Kubernetes resources. |
| <a target="_blank" id="constrainedDownscaler">constrainedDownscaler</a> | Sets the go-kube-downscaler to a constrained state if true, meaning that it does not run clusterwide but restricted to a list of namespaces. These namespaces are listed in [constrainedNamespaces](#constrainedNamespaces). |
| <a target="_blank" id="constrainedNamespaces">constrainedNamespaces</a> | A list of namespaces the go-kube-downscaler is going to operate on when constrained. |
| <a target="_blank" id="serviceAccount">serviceAccount</a> | Specifies whether a new ServiceAccount is supposed to be created and if not, what the name of the ServiceAccount to use is. |
| <a target="_blank" id="podSecurityContext">podSecurityContext</a> | Defines the SecurityContext on pod level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) |
| <a target="_blank" id="securityContext">securityContext</a> | Defines the SecurityContext on container level. (More info [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)) |
| <a target="_blank" id="resources">resources</a> | Defines the CPU and memory limits and requests. |
| <a target="_blank" id="nodeSelector">nodeSelector</a> | Defines labels of nodes that you want the deployment to schedule them on. |
| <a target="_blank" id="tolerations">tolerations</a> | Adds tolerations to the pods of the deployment to be able to be scheduled on nodes with matching taints. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) |
| <a target="_blank" id="affinity">affinity</a> | Defines rules for node affinity and pod affinity/anti-affinity. (More info [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) |
| <a target="_blank" id="configMapName">configMapName</a> | The name of the configmap for the go-kube-downscaler. |
| <a target="_blank" id="excludedNamespaces">excludedNamespaces</a> | A list of namespaces that are supposed to be excluded from the downscaling process of the go-kube-downscaler. |
| <a target="_blank" id="extraConfig">extraConfig</a> | Adds additional specified environment variables to the ConfigMap. |

The default values can be found [here](./values.yaml).

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/scalable/cronjobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func getCronJobs(namespace string, clientsets *Clientsets, ctx context.Context)
return results, nil
}

// cronJob is a wrapper for batch/v1.CronJob to implement the suspendScaledResource interface
// cronJob is a wrapper for cronjob.v1.batch to implement the suspendScaledResource interface
type cronJob struct {
*batch.CronJob
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/scalable/daemonsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func getDaemonSets(namespace string, clientsets *Clientsets, ctx context.Context
return results, nil
}

// daemonSet is a wrapper for apps/v1.DeamonSet to implement the Workload interface
// daemonSet is a wrapper for deamonset.v1.apps to implement the Workload interface
type daemonSet struct {
*appsv1.DaemonSet
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/scalable/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func getDeployments(namespace string, clientsets *Clientsets, ctx context.Contex
return results, nil
}

// deployment is a wrapper for apps/v1.Deployment to implement the replicaScaledResource interface
// deployment is a wrapper for deployment.v1.apps to implement the replicaScaledResource interface
type deployment struct {
*appsv1.Deployment
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/scalable/horizontalpodautoscalers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func getHorizontalPodAutoscalers(namespace string, clientsets *Clientsets, ctx c
return results, nil
}

// horizontalPodAutoscaler is a wrapper for autoscaling/v2.HorizontalPodAutoscaler to implement the replicaScaledResource interface
// horizontalPodAutoscaler is a wrapper for horizontalpodautoscaler.v2.autoscaling to implement the replicaScaledResource interface
type horizontalPodAutoscaler struct {
*appsv1.HorizontalPodAutoscaler
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/scalable/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func getJobs(namespace string, clientsets *Clientsets, ctx context.Context) ([]W
return results, nil
}

// job is a wrapper for batch/v1.Job to implement the suspendScaledResource interface
// job is a wrapper for job.v1.batch to implement the suspendScaledResource interface
type job struct {
*batch.Job
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/scalable/poddisruptionbudgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func getPodDisruptionBudgets(namespace string, clientsets *Clientsets, ctx conte
return results, nil
}

// podDisruptionBudget is a wrapper for policy/v1.PodDisruptionBudget to implement the Workload interface
// podDisruptionBudget is a wrapper for poddisruptionbudget.v1.policy to implement the Workload interface
type podDisruptionBudget struct {
*policy.PodDisruptionBudget
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/scalable/rollouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func getRollouts(namespace string, clientsets *Clientsets, ctx context.Context)
return results, nil
}

// rollout is a wrapper for argoproj.io/v1alpha1.Rollout to implement the replicaScaledResource interface
// rollout is a wrapper for rollout.v1alpha1.argoproj.io to implement the replicaScaledResource interface
type rollout struct {
*argov1alpha1.Rollout
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/scalable/scaledobjects.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func getScaledObjects(namespace string, clientsets *Clientsets, ctx context.Cont
return results, nil
}

// scaledObject is a wrapper for keda.sh/v1alpha1.ScaledObject to implement the replicaScaledResource interface
// scaledObject is a wrapper for scaledobject.v1alpha1.keda.sh to implement the replicaScaledResource interface
type scaledObject struct {
*kedav1alpha1.ScaledObject
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/scalable/stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func getStacks(namespace string, clientsets *Clientsets, ctx context.Context) ([
return results, nil
}

// stack is a wrapper for zalando.org/v1.Stack to implement the replicaScaledResource interface
// stack is a wrapper for stack.v1.zalando.org to implement the replicaScaledResource interface
type stack struct {
*zalandov1.Stack
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/scalable/statefulsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func getStatefulSets(namespace string, clientsets *Clientsets, ctx context.Conte
return results, nil
}

// statefulset is a wrapper for apps/v1.StatefulSet to implement the replicaScaledResource interface
// statefulset is a wrapper for statefulset.v1.apps to implement the replicaScaledResource interface
type statefulSet struct {
*appsv1.StatefulSet
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/values/regexList.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (r *RegexList) Set(text string) error {
entries := strings.Split(text, ",")
for _, entry := range entries {
entry = strings.TrimSpace(entry)
re, err := regexp.Compile(entry)
re, err := regexp.Compile(fmt.Sprintf("^%s$", entry))
if err != nil {
return fmt.Errorf("failed to compile stringlist entry as a regex: %w", err)
}
Expand Down
Loading
Loading