dan-vaughan / k8s-prometheus-custom-scaling

Demonstration of building a Kubernetes app with scaling on custom metrics
https://medium.com/@dv_90336/building-kubernetes-apps-with-custom-scaling-a-gentle-introduction-a332d7ebc795
Apache License 2.0
14 stars 14 forks source link

404 issues on apt-get update #3

Open txynidakis opened 3 years ago

txynidakis commented 3 years ago

Hi I've got issues with running docker-compose up with the below error

I've tired to use the latest ubuntu image but there is an issue with installing python-pip

$ docker-compose up Creating network "k8s-prometheus-custom-scaling_default" with the default driver Building prometheus_demo Step 1/12 : FROM ubuntu:19.04 19.04: Pulling from library/ubuntu 4dc9c2fff018: Pull complete 0a4ccbb24215: Pull complete c0f243bc6706: Pull complete 5ff1eaecba77: Pull complete Digest: sha256:2adeae829bf27a3399a0e7db8ae38d5adb89bcaf1bbef378240bc0e6724e8344 Status: Downloaded newer image for ubuntu:19.04 ---> c88ac1f841b7 Step 2/12 : RUN apt-get update ---> Running in 0254b8dfb50c Ign:1 http://archive.ubuntu.com/ubuntu disco InRelease Ign:2 http://security.ubuntu.com/ubuntu disco-security InRelease Ign:3 http://archive.ubuntu.com/ubuntu disco-updates InRelease Err:4 http://security.ubuntu.com/ubuntu disco-security Release 404 Not Found [IP: 91.189.88.142 80] Ign:5 http://archive.ubuntu.com/ubuntu disco-backports InRelease Err:6 http://archive.ubuntu.com/ubuntu disco Release 404 Not Found [IP: 91.189.88.142 80] Err:7 http://archive.ubuntu.com/ubuntu disco-updates Release 404 Not Found [IP: 91.189.88.142 80] Err:8 http://archive.ubuntu.com/ubuntu disco-backports Release 404 Not Found [IP: 91.189.88.142 80] Reading package lists... E: The repository 'http://security.ubuntu.com/ubuntu disco-security Release' does not have a Release file. E: The repository 'http://archive.ubuntu.com/ubuntu disco Release' does not have a Release file. E: The repository 'http://archive.ubuntu.com/ubuntu disco-updates Release' does not have a Release file. E: The repository 'http://archive.ubuntu.com/ubuntu disco-backports Release' does not have a Release file.

I was able to get the application running using ubuntu:19.10

but couldn't load the App on http://localhost:8000

$ docker-compose up Creating network "k8s-prometheus-custom-scaling_default" with the default driver Creating prometheus_demo ... done Attaching to prometheus_demo prometheus_demo | [2020-10-15 23:52:03 +0000] [1] [INFO] Starting gunicorn 19.10.0 prometheus_demo | [2020-10-15 23:52:03 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1) prometheus_demo | [2020-10-15 23:52:03 +0000] [1] [INFO] Using worker: sync prometheus_demo | [2020-10-15 23:52:03 +0000] [11] [INFO] Booting worker with pid: 11 prometheus_demo | [2020-10-15 23:52:03 +0000] [12] [INFO] Booting worker with pid: 12 prometheus_demo | [2020-10-15 23:52:03 +0000] [13] [INFO] Booting worker with pid: 13 prometheus_demo | [2020-10-15 23:52:03 +0000] [14] [INFO] Booting worker with pid: 14

` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

8a7de547c36e flipstone42/k8s-prometheus-custom-scaling:latest "gunicorn -c config.…" 3 minutes ago Up 3 minutes 0.0.0.0:80->8000/tcp prometheus_demo `

Not sure where the problem may be

Kind regards

txynidakis commented 3 years ago

Think the version of NodeJS might be an issue as well

dan-vaughan commented 3 years ago

Thanks for letting me know, I'll look into this.

dan-vaughan commented 3 years ago

Hey @txynidakis, thank you for your patience. This issue was due to Ubuntu 19.04 becoming EOL. I've rebuilt the Dockerfile, (and updated the rest of the repository for Kubernetes 1.19), so you may want to re-read the blog post. Either way, this issue is now solved, so if you can confirm that it's solved on your end, we can close the issue 😄

txynidakis commented 3 years ago

Hi @flipstone42, still can't get localhost:8000 to load

I've pulled down the master and ran the docker-composer up command, there were quite a few warning but the image did build

ash: 70de7ec3bb60916f4562 Version: webpack 4.44.2 Time: 2760ms Built at: 10/28/2020 11:55:13 PM Asset Size Chunks Chunk Names bundle.js 1.73 MiB 0 [emitted] [big] main Entrypoint main [big] = bundle.js [21] ./js/index.jsx 448 bytes {0} [built] [26] ./js/routes.js 727 bytes {0} [built] [50] ./node_modules/react-bootstrap/esm/index.js + 219 modules 365 KiB {0} [built] | 220 modules [51] ./node_modules/react-router-dom/es/index.js + 28 modules 76.5 KiB {0} [built] | 29 modules

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). This can impact web performance. Assets: bundle.js (1.73 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. Entrypoints: main (1.73 MiB) bundle.js

WARNING in webpack performance recommendations: You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. For more info visit https://webpack.js.org/guides/code-splitting/ Removing intermediate container 4f8ad1b09725 ---> 068825282580 Step 6/9 : WORKDIR /app/demo_app ---> Running in e9ac358e8896 Removing intermediate container e9ac358e8896 ---> 9bcb0da9ef4e Step 7/9 : ENV prometheus_multiproc_dir /tmp ---> Running in a0832815f09f Removing intermediate container a0832815f09f ---> f8d81700d776 Step 8/9 : EXPOSE 8000 ---> Running in 765ac4053b84 Removing intermediate container 765ac4053b84 ---> b7aa67171fb1 Step 9/9 : CMD [ "gunicorn", "-c", "config.py", "-w", "4", "-b", "0.0.0.0:8000", "server"] ---> Running in 72b926321e43 Removing intermediate container 72b926321e43 ---> c2d27c9a5f9b

Successfully built c2d27c9a5f9b Successfully tagged flipstone42/k8s-prometheus-custom-scaling:latest WARNING: Image for service prometheus_demo was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build.

(master) $ docker image ls -a REPOSITORY TAG IMAGE ID CREATED SIZE flipstone42/k8s-prometheus-custom-scaling latest c2d27c9a5f9b 3 minutes ago 1.26GB nikolaik/python-nodejs python3.8-nodejs14 6b1484b2553f 12 hours ago 1.19GB

(master) $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a2016c8ee980 flipstone42/k8s-prometheus-custom-scaling:latest "gunicorn -c config.…" About a minute ago Up About a minute 0.0.0.0:80->8000/tcp prometheus_demo

(master) $ docker container logs prometheus_demo [2020-10-28 23:56:58 +0000] [1] [INFO] Starting gunicorn 20.0.4 [2020-10-28 23:56:58 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1) [2020-10-28 23:56:58 +0000] [1] [INFO] Using worker: sync [2020-10-28 23:56:58 +0000] [9] [INFO] Booting worker with pid: 9 [2020-10-28 23:56:58 +0000] [10] [INFO] Booting worker with pid: 10 [2020-10-28 23:56:59 +0000] [11] [INFO] Booting worker with pid: 11

What other info can I help you with?

dan-vaughan commented 3 years ago

That should be fixed now. Please try again.