Skip to content
This repository was archived by the owner on Apr 6, 2022. It is now read-only.

Commit 3ba84f6

Browse files
authored
Merge pull request #30 from d-kuro/d-kuro/v0.0.1
release v0.0.1
2 parents b08a193 + 0dae542 commit 3ba84f6

File tree

4 files changed

+34
-35
lines changed

4 files changed

+34
-35
lines changed

README.md

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# scheduled-pod-autoscaler
22

3-
[![PkgGoDev](https://pkg.go.dev/badge/d-kuro/scheduled-pod-autoscaler)](https://pkg.go.dev/d-kuro/scheduled-pod-autoscaler) ![](https://github.com/d-kuro/scheduled-pod-autoscaler/workflows/main/badge.svg)
3+
[![PkgGoDev](https://pkg.go.dev/badge/github.com/d-kuro/scheduled-pod-autoscaler)](https://pkg.go.dev/github.com/d-kuro/scheduled-pod-autoscaler) ![](https://github.com/d-kuro/scheduled-pod-autoscaler/workflows/main/badge.svg)
44

5-
**Work in Progress** GitOps Native Schedule Scaling of Kubernetes Resources.
5+
Custom Kubernetes controller for GitOps native scheduled scaling.
6+
7+
Autoscaling with `HorizontalPodAutoscaler` is difficult to use for spike access etc.
8+
`ScheduledPodAutoscaler` can for more flexible autoscaling by controlling min/max replicas at specific times.
69

710
## Overview
811

9-
scheduled-pod-autoscaler is made up of two custom resources.
12+
`ScheduledPodAutoscaler` is made up of two custom resources.
1013

1114
The parent-child relationship can look like this:
1215

@@ -22,7 +25,7 @@ default └─Schedule/test-3 - 6m4s
2225

2326
### ScheduledPodAutoscaler
2427

25-
`ScheduledPodAutoscaler` is a custom resource that wraps `HorizontalPodAutoscaler`.
28+
`ScheduledPodAutoscaler` is a custom resource that wraps `HorizontalPodAutoscaler`.
2629
The `ScheduledPodAutoscaler` Controller generates a `HorizontalPodAutoscaler` from this resource.
2730

2831
The specs of the `HorizontalPodAutoscaler` defined here will be used when no scheduled scaling is taking place.
@@ -59,17 +62,23 @@ nginx 3 10 Available 6m52s
5962

6063
### Schedule
6164

62-
`Schedule` is a custom resource for defining scheduled scaling.
65+
`Schedule` is a custom resource for defining scheduled scaling.
6366
You can define multiple children's `Schedule` for the parent `ScheduledPodAutoscaler`.
6467

6568
The `ScheduledPodAutoscaler` controller refers to the `Schedule` and
6669
rewrites `HorizontalPodAutoscaler` created by `ScheduledPodAutoscaler` when it is time for scheduled scaling.
67-
`HorizontalPodAutoscaler` is not managed in Git, so there is no diffs in GitOps.
70+
`HorizontalPodAutoscaler` is not managed in Git, so there are no diffs in GitOps.
6871

6972
> 📝 Note: A case of schedule conflicts
7073
>
7174
> In case of a schedule conflict, using the maximum value of min/max replicas.
7275
76+
> 📝 Note: Warm-up time
77+
>
78+
> The `ScheduledPodAutoscaler` controller only changes the min/max replica of `HorizontalPodAutoscaler`.
79+
> Launching the Pod will take some time.
80+
> Be sure to set a generous amount of time for scheduled scaling.
81+
7382
```console
7483
$ kubectl get schedule -o wide
7584
NAME REFERENCE TYPE STARTTIME ENDTIME STARTDAYOFWEEK ENDDAYOFWEEK MINPODS MAXPODS STATUS AGE
@@ -157,10 +166,10 @@ By default, it is installed in the `kube-system` namespace.
157166

158167
```console
159168
# Kubernetes 1.16+
160-
$ kubectl apply -f https://raw.githubusercontent.com/d-kuro/scheduled-pod-autoscaler/v0.0.1-rc.1/manifests/install/install.yaml
169+
$ kubectl apply -f https://raw.githubusercontent.com/d-kuro/scheduled-pod-autoscaler/v0.0.1/manifests/install/install.yaml
161170
162171
# Kubernetes < 1.16
163-
$ kubectl apply -f https://raw.githubusercontent.com/d-kuro/scheduled-pod-autoscaler/v0.0.1-rc.1/manifests/install/legacy/install.yaml
172+
$ kubectl apply -f https://raw.githubusercontent.com/d-kuro/scheduled-pod-autoscaler/v0.0.1/manifests/install/legacy/install.yaml
164173
```
165174

166175
### Kustomize
@@ -172,7 +181,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
172181
kind: Kustomization
173182
174183
resources:
175-
- github.com/d-kuro/scheduled-pod-autoscaler/manifests/install?ref=v0.0.1-rc.1
184+
- github.com/d-kuro/scheduled-pod-autoscaler/manifests/install?ref=v0.0.1
176185
```
177186

178187
## Spec
@@ -216,26 +225,16 @@ The port of the metrics endpoint can be changed using the `metrics-addr` option.
216225
| `scheduled_pod_auroscaler_min_replicas` | gauge | Lower limit for the number of pods that can be set by the scheduled pod autoscaler |
217226
| `scheduled_pod_auroscaler_max_replicas` | gauge | Upper limit for the number of pods that can be set by the scheduled pod autoscaler |
218227

219-
## Options
220-
221-
```text
222-
Usage scheduled-pod-autoscaler:
223-
-enable-leader-election
224-
Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.
225-
-kubeconfig string
226-
Paths to a kubeconfig. Only required if out-of-cluster.
227-
-master --kubeconfig
228-
(Deprecated: switch to --kubeconfig) The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.
229-
-metrics-addr string
230-
The address the metric endpoint binds to. (default ":8080")
231-
-probe-addr string
232-
The address the liveness probe and readiness probe endpoints bind to. (default ":9090")
233-
-zap-devel
234-
Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error)
235-
-zap-encoder value
236-
Zap log encoding ('json' or 'console')
237-
-zap-log-level value
238-
Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value > 0 which corresponds to custom debug levels of increasing verbosity
239-
-zap-stacktrace-level value
240-
Zap Level at and above which stacktraces are captured (one of 'info', 'error').
241-
```
228+
## Controller Options
229+
230+
| name | type | description |
231+
| - | - | - |
232+
| `--enable-leader-election` | bool | Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager. |
233+
| `--metrics-addr` | string | The address the metric endpoint binds to. (default ":8080") |
234+
| `--probe-addr` | string | The address the liveness probe and readiness probe endpoints bind to. (default ":9090") |
235+
| `--zap-devel` | bool | Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) |
236+
| `--zap-encoder` | value | Zap log encoding ('json' or 'console') |
237+
| `--zap-log-level` | value | Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value > 0 which corresponds to custom debug levels of increasing verbosity |
238+
| `--zap-stacktrace-level` | value | Zap Level at and above which stacktraces are captured (one of 'info', 'error'). |
239+
| `--kubeconfig` | string | Paths to a kubeconfig. Only required if out-of-cluster. |
240+
| `--master` | string | (Deprecated: switch to --kubeconfig) The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. |

manifests/deployment/scheduled-pod-autoscaler.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
- /manager
1818
args:
1919
- --enable-leader-election
20-
image: ghcr.io/d-kuro/scheduled-pod-autoscaler:v0.0.1-rc.1
20+
image: ghcr.io/d-kuro/scheduled-pod-autoscaler:v0.0.1
2121
name: manager
2222
ports:
2323
- containerPort: 8080

manifests/install/install.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ spec:
768768
- --enable-leader-election
769769
command:
770770
- /manager
771-
image: ghcr.io/d-kuro/scheduled-pod-autoscaler:v0.0.1-rc.1
771+
image: ghcr.io/d-kuro/scheduled-pod-autoscaler:v0.0.1
772772
livenessProbe:
773773
httpGet:
774774
path: /healthz

manifests/install/legacy/install.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ spec:
770770
- --enable-leader-election
771771
command:
772772
- /manager
773-
image: ghcr.io/d-kuro/scheduled-pod-autoscaler:v0.0.1-rc.1
773+
image: ghcr.io/d-kuro/scheduled-pod-autoscaler:v0.0.1
774774
livenessProbe:
775775
httpGet:
776776
path: /healthz

0 commit comments

Comments
 (0)