Comments (3)
I'm trying it out with Minikube and getting the expected error. Will fix.
kube-downscaler-754b9659b6-vmt26 downscaler 2019-02-18 20:26:09,918 INFO: Downscaler v0.8 started with config Namespace(debug=False, default_downtime='never', default_uptime='Mon-Fri 07:30-20:30 CET', dry_run=True, exclude_deployments='kube-downscaler,downscaler', exclude_namespaces='kube-system', exclude_statefulsets='', grace_period=900, interval=60, kind=['deployment'], namespace=None, once=False)
kube-downscaler-754b9659b6-vmt26 downscaler 2019-02-18 20:26:09,918 INFO: **DRY-RUN**: no downscaling will be performed!
kube-downscaler-754b9659b6-vmt26 downscaler 2019-02-18 20:26:09,975 ERROR: Failed to autoscale : namespaces "default" is forbidden: User "system:serviceaccount:default:kube-downscaler" cannot get resource "namespaces" in API group "" in the namespace "default"
kube-downscaler-754b9659b6-vmt26 downscaler Traceback (most recent call last):
kube-downscaler-754b9659b6-vmt26 downscaler File "/usr/local/lib/python3.7/site-packages/pykube/http.py", line 99, in raise_for_status
kube-downscaler-754b9659b6-vmt26 downscaler resp.raise_for_status()
kube-downscaler-754b9659b6-vmt26 downscaler File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
kube-downscaler-754b9659b6-vmt26 downscaler raise HTTPError(http_error_msg, response=self)
kube-downscaler-754b9659b6-vmt26 downscaler requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://10.96.0.1:443/api/v1/namespaces/default
kube-downscaler-754b9659b6-vmt26 downscaler
kube-downscaler-754b9659b6-vmt26 downscaler During handling of the above exception, another exception occurred:
kube-downscaler-754b9659b6-vmt26 downscaler
kube-downscaler-754b9659b6-vmt26 downscaler Traceback (most recent call last):
kube-downscaler-754b9659b6-vmt26 downscaler File "/kube_downscaler/main.py", line 40, in run_loop
kube-downscaler-754b9659b6-vmt26 downscaler dry_run=dry_run, grace_period=grace_period)
kube-downscaler-754b9659b6-vmt26 downscaler File "/kube_downscaler/scaler.py", line 123, in scale
kube-downscaler-754b9659b6-vmt26 downscaler default_uptime, default_downtime, forced_uptime, dry_run, now, grace_period)
kube-downscaler-754b9659b6-vmt26 downscaler File "/kube_downscaler/scaler.py", line 98, in autoscale_resources
kube-downscaler-754b9659b6-vmt26 downscaler namespace_obj = pykube.Namespace.objects(api).get_by_name(resource.namespace)
kube-downscaler-754b9659b6-vmt26 downscaler File "/usr/local/lib/python3.7/site-packages/pykube/query.py", line 71, in get_by_name
kube-downscaler-754b9659b6-vmt26 downscaler self.api.raise_for_status(r)
kube-downscaler-754b9659b6-vmt26 downscaler File "/usr/local/lib/python3.7/site-packages/pykube/http.py", line 106, in raise_for_status
kube-downscaler-754b9659b6-vmt26 downscaler raise HTTPError(resp.status_code, payload["message"])
kube-downscaler-754b9659b6-vmt26 downscaler pykube.exceptions.HTTPError: namespaces "default" is forbidden: User "system:serviceaccount:default:kube-downscaler" cannot get resource "namespaces" in API group "" in the namespace "default"
from kube-downscaler.
Good point, thanks!
from kube-downscaler.
Fixed in 3e2c482:
INFO: Downscaler v0.8 started with config Namespace(debug=False, default_downtime='never', default_uptime='Mon-Fri 07:30-20:30 CET', dry_run=True, exclude_deployments='kube-downscaler,downscaler', exclude_namespaces='kube-system', exclude_statefulsets='', grace_period=900, interval=60, kind=['deployment'], namespace=None, once=False)
INFO: **DRY-RUN**: no downscaling will be performed!
INFO: Scaling down Deployment default/kube-janitor from 1 to 0 replicas (uptime: Mon-Fri 07:30-20:30 CET, downtime: never)
INFO: **DRY-RUN**: would update Deployment default/kube-janitor
INFO: Scaling down Deployment default/nginx from 1 to 0 replicas (uptime: Mon-Fri 07:30-20:30 CET, downtime: never)
INFO: **DRY-RUN**: would update Deployment default/nginx
from kube-downscaler.
Related Issues (20)
- Suspending CronJob will break CronJobs with startingDeadlineSeconds HOT 5
- Comma separated time definitions HOT 1
- Namespace is retrieved for every resource (one extra API call per resource)
- Question: Any possibilty to downscale on holidays ? HOT 2
- downscaler/force-uptime: "false" is not working when defined in a namespace resource HOT 1
- Detect up/downscaling churn and back off
- Respect owner references
- Add e2e tests with KIND
- Including multiple namespaces?
- Route downscaled services to a maintenance page
- The downscaler/uptime does not seem to work as expected
- kube-system resources downscaling behavior is potentially problematic HOT 2
- `--namespace` and `--exclude-namespaces` seems to be mutually excluded options HOT 2
- Scale up & down should support priority
- Only downscale, with no automatic upscale HOT 2
- Deployments scaled down even though downtime=never HOT 7
- support grace period for updated deployments HOT 3
- Error with helm chart if I use value namespace.active_in HOT 1
- Support Stack resources with HPA
- New annotation downscaler/exclude-until HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kube-downscaler.