azure-samples / azure-voting-app-redis Goto Github PK
View Code? Open in Web Editor NEWAzure voting app used in docs.
License: MIT License
Azure voting app used in docs.
License: MIT License
The very same sample code could not just be used for demonstrating Kubernetes, but also for showing how Web App for Containers works. In order to do so, I'd suggest:
Using windows 10 pro. I get the following error:
ERROR: for azure-vote-front Cannot start service azure-vote-front: driver failed programming external connectivity on endpoint azure-vote-front (6e8d284e934d814c52d9295fc43768da53d6bf90c2ded2fd559e147999f17165): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8085:tcp:172.18.0.3:80: input/output error
ERROR: Encountered errors while bringing up the project.
Any ideas, on how to fix this?
I set a password on my redis database by adding command: ["redis-server"] and args = ["--requirepass " ] to the azure-vote-back container specification in my copy of azure-vote-all-in-one-redis.yml. I was able to validate with redis-cli AUTH on that container that the password was really set.
I also added the extra environment variable, REDIS_PWD, that was referenced in main.py in the azure-vote-front container and set it to the same password.
However, the azure-vote-front app could not connect to the redis database. It gave the error: "redis.exceptions.ResponseError: NOAUTH Authentication required."
But when I used kubectl exec cats-and-dogs-front -i -t -- bash
to access the container and used apt-get update and apt-get install redis-tools and then used redis-cli against the correct host and port, I was able to connect. I was also able to run the AUTH command and authenticate. Additionally, I could see that REDIS_PWD was set with the correct password by running env | grep REDIS
.
My conclusion was that the redis password was being set correctly both in the front and back apps and that I did not have a connectivity issue between the containers themselves (since redis-cli worked). So, I concluded that something must be wrong with the python code.
I researched the redis-py module being used and found docs at https://redis-py.readthedocs.io/en/latest/ which suggested that redis.Redis() is provided for backwards compatibility with older versions of redis-py and that redis.StrictRedis() is preferred.
So, I changed the code to use redis.StrictRedis instead of redis.Redis when the REDIS_PWD environment variable is set.
I built my own docker image at rberlind/azure-vote-front:redis-pwd and modified the yml file to use that image. Everything then worked.
I will submit a pull request.
when i try to start the docker container I am getting error below
docker-compose up -d
Pulling azure-vote-back (redis:)...
latest: Pulling from library/redis
ERROR: no matching manifest for windows/amd64 10.0.16299 in the manifest list entries
While Building the Docker container and listing the docker images
when deploying the app to kubernetes, using the yaml from the repo, the following warning is shown :
Warning: spec.template.spec.nodeSelector[beta.kubernetes.io/os]: deprecated since v1.14; use "kubernetes.io/os" instead
since this is sample code, this should be corrected.
This is minor given the purpose of the app, but if your are using it to play around with slight more advanced Kubernetes scenarios (like scaling up or updating the deployment), the counters get reset every time an instance of the front end is initialized.
Pulling the bitnami/redis image yields the following error:
docker pull mcr.microsoft.com/oss/bitnami/redis:6.0.8
6.0.8: Pulling from oss/bitnami/redis
no matching manifest for linux/arm64/v8 in the manifest list entries
The bitnami/redis image seems to not support ARM. This repo is used for the kubernetes tutorial giving people an extra step they have to fix following the tutorial. For some this might be obvious for others this might be a blocker.
Possible solutions:
Image used in Azure vote front end for redis is deprecated, please update correct image version like one which is using CBL mariner as baseline
mcr.microsoft.com/cbl-mariner/base/redis:6.2-cm2.0
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
I followed the tutorial for deploying this app in Azure Container Registry but tried to launch the app with Azure Container Instance (with a Linux machine). The deployment went well but when reaching the site, I got a 502 error.
Do not really know if I made a mistake or if this is due to the code itself.
The base container for the azure-vote-app is 922 MB in size. This can be improved significantly, by using an Alpine based image instead of Ubuntu. This is good for at least two reasons:
1: Download/upload times decreases which is very good in e.g. a workshop where several participants share the same WIFI (talking from experience here...)
2: Best practice with containers is to keep them as small as possible
I can make a PR with a smaller image referenced in the Dockerfile, if that would be appreciated
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.