I'm new to a DevOps role (it is also my first tech job). How do I get better at my job and set myself up for growth?
I work as an infrastructure developer which deals with a lot of CI/CD stuff and containerization. Essentially Jenkins and OpenShift have a lot to do with my position. I like the idea of cloud stuff but my company doesn't do much cloud computing at all, so I don't know if I should spend my time on learning much more of that since I love this company and would like to stay here.
I am assuming just learning the tools of my position would get me 80% of the way. What else should I be doing to learn as much as possible and to develop skills that will make my manager think I am valuable, and will set me up to move to a higher position within the next 2 years?
https://redd.it/13kz3nt
@r_devops
I work as an infrastructure developer which deals with a lot of CI/CD stuff and containerization. Essentially Jenkins and OpenShift have a lot to do with my position. I like the idea of cloud stuff but my company doesn't do much cloud computing at all, so I don't know if I should spend my time on learning much more of that since I love this company and would like to stay here.
I am assuming just learning the tools of my position would get me 80% of the way. What else should I be doing to learn as much as possible and to develop skills that will make my manager think I am valuable, and will set me up to move to a higher position within the next 2 years?
https://redd.it/13kz3nt
@r_devops
Reddit
r/devops on Reddit: I'm new to a DevOps role (it is also my first tech job). How do I get better at my job and set myself up for…
Posted by u/AbundantExp - No votes and 2 comments
When did DevOps start "clicking" for you?
Was it months? Years? Was it never?
Or maybe it was 0 time...you...genius?
https://redd.it/13kzr6g
@r_devops
Was it months? Years? Was it never?
Or maybe it was 0 time...you...genius?
https://redd.it/13kzr6g
@r_devops
Reddit
r/devops on Reddit: When did DevOps start "clicking" for you?
Posted by u/SeriouslySally36 - No votes and 7 comments
What kind of Monitoring or Observability questions should I be asking?
Hello,
I am looking for some guidance on a new task I was given. My task involves integrating observability into our new applications, specifically in the context of Google Kubernetes Engine (GKE) and our primary use of Google Cloud Managed Service for Prometheus. I am a bit lost on what kind of questions I should be asking, which areas should I focus on, considering our usage of GKE and Google Cloud Managed Service for Prometheus? Any best practices, lessons learned, or recommended resources you can offer would be super helpful.
https://redd.it/13lf5in
@r_devops
Hello,
I am looking for some guidance on a new task I was given. My task involves integrating observability into our new applications, specifically in the context of Google Kubernetes Engine (GKE) and our primary use of Google Cloud Managed Service for Prometheus. I am a bit lost on what kind of questions I should be asking, which areas should I focus on, considering our usage of GKE and Google Cloud Managed Service for Prometheus? Any best practices, lessons learned, or recommended resources you can offer would be super helpful.
https://redd.it/13lf5in
@r_devops
Reddit
r/devops on Reddit: What kind of Monitoring or Observability questions should I be asking?
Posted by u/Sebasterd_09 - No votes and 2 comments
How I Used Terraform Effectively | Terraform
Increase Your Deployment Efficiency and Scale with Terraform’s Best Practices
https://medium.com/illumination/how-i-usedterraform-effectively-a-guide-to-best-practices-2c5aa6495214
https://redd.it/13li9rh
@r_devops
Increase Your Deployment Efficiency and Scale with Terraform’s Best Practices
https://medium.com/illumination/how-i-usedterraform-effectively-a-guide-to-best-practices-2c5aa6495214
https://redd.it/13li9rh
@r_devops
Medium
How I Used Terraform Effectively: A Guide To Best Practices
Increase Your Deployment Efficiency and Scale with Terraform’s Best Practices
Which role to accept?
2 YOE DevOps engineer
Got offered DevOps role in swe team. Dealing with on prem self managed gitlab cicd and kubernetes.
Also offered SRE role in gaming industry dealing with cloud and terraform and pager duty. SRE role has roughly around 4k more in terms of total annual compensation.
Which offer should I take?
https://redd.it/13ll1wf
@r_devops
2 YOE DevOps engineer
Got offered DevOps role in swe team. Dealing with on prem self managed gitlab cicd and kubernetes.
Also offered SRE role in gaming industry dealing with cloud and terraform and pager duty. SRE role has roughly around 4k more in terms of total annual compensation.
Which offer should I take?
https://redd.it/13ll1wf
@r_devops
Reddit
r/devops on Reddit: Which role to accept?
Posted by u/learnamap - No votes and 5 comments
Read the DevOps handbook and Phoenix project. But I don't have a way to change the Org practices because of low rank. What should I do?
The idea seems good but how to apply it?
https://redd.it/13lor87
@r_devops
The idea seems good but how to apply it?
https://redd.it/13lor87
@r_devops
Reddit
r/devops on Reddit: Read the DevOps handbook and Phoenix project. But I don't have a way to change the Org practices because of…
Posted by u/IamOkei - No votes and 3 comments
Detailed article on increasing volume size of virtual machine.
No GUI involved!.
https://medium.com/@4yub1k/safely-extend-volume-size-of-vmware-ubuntu-server-linux-3f81a04cf3ad
https://redd.it/13lra5j
@r_devops
No GUI involved!.
https://medium.com/@4yub1k/safely-extend-volume-size-of-vmware-ubuntu-server-linux-3f81a04cf3ad
https://redd.it/13lra5j
@r_devops
Medium
Safely Extend Volume Size of VMware, Ubuntu Server, Linux.
Increase size of volume on Linux systems.
Awesome Cloud Cost Repository
Based on my previous post and your great tips I decided to open a repository for awesome cloud cost. It can be a place where we share the latest and most curated tips and tricks, and better ourselves as engineers and help us through our careers.
https://github.com/jatalocks/awesome-cloud-cost
https://redd.it/13lsltj
@r_devops
Based on my previous post and your great tips I decided to open a repository for awesome cloud cost. It can be a place where we share the latest and most curated tips and tricks, and better ourselves as engineers and help us through our careers.
https://github.com/jatalocks/awesome-cloud-cost
https://redd.it/13lsltj
@r_devops
GitHub
GitHub - jatalocks/awesome-cloud-cost: A curated list of awesome tips, tricks and hacks for saving cost on the cloud
A curated list of awesome tips, tricks and hacks for saving cost on the cloud - GitHub - jatalocks/awesome-cloud-cost: A curated list of awesome tips, tricks and hacks for saving cost on the cloud
Branch and merge, improvements since TFS?
I didn't have a very good experience branch and merge in TFS some years ago, and since then most of my clients moved to Git and it's worked pretty well and it's what I'm used to.
I've had to use DevOps on my current project, and it's time to branch and I'm seriously worried.
Should I be?
https://redd.it/13ltsky
@r_devops
I didn't have a very good experience branch and merge in TFS some years ago, and since then most of my clients moved to Git and it's worked pretty well and it's what I'm used to.
I've had to use DevOps on my current project, and it's time to branch and I'm seriously worried.
Should I be?
https://redd.it/13ltsky
@r_devops
Reddit
r/devops on Reddit: Branch and merge, improvements since TFS?
Posted by u/CobaltLemur - No votes and 1 comment
Addressing GitHub’s recent availability issues Github Blog
https://github.blog/2023-05-16-addressing-githubs-recent-availability-issues/
https://redd.it/13lvlgp
@r_devops
https://github.blog/2023-05-16-addressing-githubs-recent-availability-issues/
https://redd.it/13lvlgp
@r_devops
The GitHub Blog
Addressing GitHub’s recent availability issues
GitHub recently experienced several availability incidents, both long running and shorter duration. We have since mitigated these incidents and all systems are now operating normally. Read on for more details about what caused these incidents and what we’re…
What are good options for observability for tiny startup?
I work for a tiny startup (<5 employees) with one SAAS webapp product. Our infra is in AWS and our monthly bill is ~$300 for a sense of scale. I need to set up a way for us to gather and analyze “telemetry”; specifically latencies and failure rates on HTTP endpoints. This is to support engineers supporting customers.
In a previous life for a bigger company I did the whole ansible, terraform, packer thing to provision grafana + prometheus and it worked well enough. I know that stack well enough that i am confident it provides the solution blocks i need. I’m worried about upfront investment, running costs and opportunity costs considerations.
I could probably replicate such infra for current employer but interested in hearing advice from professionals. (I’m more of a jack of all trades, master of none type…)
- I’ve considered using
- as mentioned, I can probably set up grafana + prometheus & dependencies within a few days, so I consider it a reliable fallback option.
- datadog? I’ve never used them and they’ve been in the news a lot recently and not for great reasons. Apparently expensive? Vendor lock-in concerns…
- which options am i missing?
https://redd.it/13luhnt
@r_devops
I work for a tiny startup (<5 employees) with one SAAS webapp product. Our infra is in AWS and our monthly bill is ~$300 for a sense of scale. I need to set up a way for us to gather and analyze “telemetry”; specifically latencies and failure rates on HTTP endpoints. This is to support engineers supporting customers.
In a previous life for a bigger company I did the whole ansible, terraform, packer thing to provision grafana + prometheus and it worked well enough. I know that stack well enough that i am confident it provides the solution blocks i need. I’m worried about upfront investment, running costs and opportunity costs considerations.
I could probably replicate such infra for current employer but interested in hearing advice from professionals. (I’m more of a jack of all trades, master of none type…)
- I’ve considered using
PutMetricData CloudWatch api for custom metrics. I’m not convinced it can do everything I need, but happy to hear from someone that’s instrumented an app this way. Our logs already go to CloudWatch.- as mentioned, I can probably set up grafana + prometheus & dependencies within a few days, so I consider it a reliable fallback option.
- datadog? I’ve never used them and they’ve been in the news a lot recently and not for great reasons. Apparently expensive? Vendor lock-in concerns…
- which options am i missing?
https://redd.it/13luhnt
@r_devops
Reddit
r/devops on Reddit: What are good options for observability for tiny startup?
Posted by u/pwab - No votes and 4 comments
Monitor - IIS App Pool
Is there any open-source solution to monitor IIS App Pools? if not, any thoughts to approach this?
basically looking to notify on pool crash and shutdown. Restart them remotely if required.
https://redd.it/13lyq23
@r_devops
Is there any open-source solution to monitor IIS App Pools? if not, any thoughts to approach this?
basically looking to notify on pool crash and shutdown. Restart them remotely if required.
https://redd.it/13lyq23
@r_devops
Reddit
r/devops on Reddit: Monitor - IIS App Pool
Posted by u/ash_ind - No votes and no comments
Datadog's $5M Oopsie: An Engineering Case Study in How Not to Do Observability Services
https://newsletter.pragmaticengineer.com/p/inside-the-datadog-outage
https://redd.it/13ls0cl
@r_devops
https://newsletter.pragmaticengineer.com/p/inside-the-datadog-outage
https://redd.it/13ls0cl
@r_devops
Pragmaticengineer
Inside DataDog’s $5M Outage (Real-World Engineering Challenges #8)
The observability provider was down for more than a day in March. What went wrong, how did the engineering team respond, and what can businesses learn from the incident? Exclusive.
Cloudquery, Resoto, Steampipe, or Airbyte?
I have been tasked with gathering data about resources across multiple cloud providers (AWS and Azure primarily). Whatever I use must be open source or at least on-prem.
My first goal is asset management, with a possible need for compliance and generating resource graphs in the future.
I found these 4 tools:
Cloudquery: https://cloudquery.io/
Steampipe https://steampipe.io/
Airbyte: https://airbyte.com/
Resoto: https://resoto.com/
Any idea which one is best? i.e. most maintained and stable? If I were to choose one of these tools, which one is the least likely to get completely abandoned 1-2 years down the road?
https://redd.it/13m3gjv
@r_devops
I have been tasked with gathering data about resources across multiple cloud providers (AWS and Azure primarily). Whatever I use must be open source or at least on-prem.
My first goal is asset management, with a possible need for compliance and generating resource graphs in the future.
I found these 4 tools:
Cloudquery: https://cloudquery.io/
Steampipe https://steampipe.io/
Airbyte: https://airbyte.com/
Resoto: https://resoto.com/
Any idea which one is best? i.e. most maintained and stable? If I were to choose one of these tools, which one is the least likely to get completely abandoned 1-2 years down the road?
https://redd.it/13m3gjv
@r_devops
CloudQuery
CloudQuery | Cloud ops, without the chaos
The unified control plane for cloud operations. Inspect, govern, and automate your entire cloud estate with infrastructure, security, and FinOps context.
What do I need to master in devops?
Okay, so I am a Software engineer with 3 years of work exp.
I have worked in full stack development with react and node at the core.
Also of k deploy the code I track with Droplets in do, opening ports, check the process I'd and automating the tasks using cronjobs in Linus and some more into the Linux and networking domain.
So, I know end to end deployment and all.
But what more exactly do I eed to learn to become devops, I have used kubernetes just for setting up and run some checks via kubectl.
I need some structured concepts to cover in devops.
So that I can write development+devops as a skill in my resume.
Your help will be much appreciated.
https://redd.it/13m4ku4
@r_devops
Okay, so I am a Software engineer with 3 years of work exp.
I have worked in full stack development with react and node at the core.
Also of k deploy the code I track with Droplets in do, opening ports, check the process I'd and automating the tasks using cronjobs in Linus and some more into the Linux and networking domain.
So, I know end to end deployment and all.
But what more exactly do I eed to learn to become devops, I have used kubernetes just for setting up and run some checks via kubectl.
I need some structured concepts to cover in devops.
So that I can write development+devops as a skill in my resume.
Your help will be much appreciated.
https://redd.it/13m4ku4
@r_devops
Reddit
r/devops on Reddit: What do I need to master in devops?
Posted by u/Beginning-Benefit-46 - No votes and 5 comments
GitHub Status Checks - Help Please
I am trying to understand GitHub Status checks for a protected branch.
When I try to require status checks, there are no checks to choose from. How do I make a status check?
Do I need GitHub Actions enabled in order to create a status check?
Is there a way to do this without GitHub Actions by using Jenkins?
I am trying to add simple checks, such as.
Do not allow merge into branch if build failed (build is happening in Jenkins).
Do not allow merge into branch unless the merge is coming from a particular branch.
I am trying to start small and simple to get a base understanding of how I can have GitHub and Jenkins work together. Eventually I would like to add checks for unit tests passing, etc.
https://redd.it/13m3gh8
@r_devops
I am trying to understand GitHub Status checks for a protected branch.
When I try to require status checks, there are no checks to choose from. How do I make a status check?
Do I need GitHub Actions enabled in order to create a status check?
Is there a way to do this without GitHub Actions by using Jenkins?
I am trying to add simple checks, such as.
Do not allow merge into branch if build failed (build is happening in Jenkins).
Do not allow merge into branch unless the merge is coming from a particular branch.
I am trying to start small and simple to get a base understanding of how I can have GitHub and Jenkins work together. Eventually I would like to add checks for unit tests passing, etc.
https://redd.it/13m3gh8
@r_devops
Reddit
r/devops on Reddit: GitHub Status Checks - Help Please
Posted by u/tanMud - No votes and 4 comments
I'm new to infrastructure as code and I wonder if Ansible or Terraform is the right tool for my purpose
Hello guys, first up I hope this kind of post is allowed on this sub. I've been working on a side project for a while and I'm starting to look into deployment part of things.
What I would like to achieve is a a system were the a backend application can trigger provisioning of hardware. So from what I've read Terraform and Ansible both allow for fast gui-less
Cloud provisioning. (Kinda like what docker compose is for software)
But are these tools suitable for creating for example a new vm each time a new customer registers?
Basically automated provisioning?
https://redd.it/13m0sny
@r_devops
Hello guys, first up I hope this kind of post is allowed on this sub. I've been working on a side project for a while and I'm starting to look into deployment part of things.
What I would like to achieve is a a system were the a backend application can trigger provisioning of hardware. So from what I've read Terraform and Ansible both allow for fast gui-less
Cloud provisioning. (Kinda like what docker compose is for software)
But are these tools suitable for creating for example a new vm each time a new customer registers?
Basically automated provisioning?
https://redd.it/13m0sny
@r_devops
Reddit
r/devops on Reddit: I'm new to infrastructure as code and I wonder if Ansible or Terraform is the right tool for my purpose
Posted by u/notreallyaredditor8 - 4 votes and 10 comments
How do I get real client IP inside docker container for logging to the database
I have a following docker compose file:
version: "3.8"
services:
postgres:
image: postgres:11
volumes:
- myapp_postgres_volume:/var/lib/postgresql/data
- type: tmpfs
target: /dev/shm
tmpfs:
size: 536870912 # 512MB
environment:
POSTGRES_DB: elearning_academy
POSTGRES_USER: myapp
POSTGRES_PASSWORD: myapp123
networks:
- myapp_network
pgadmin:
image: dpage/pgadmin4:5.4
volumes:
- myapp_pgadmin_volume:/var/lib/pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: myapp123
ports:
- 8080:80
networks:
- myapp_network
redis:
image: redis:6.2.4
volumes:
- myapp_redis_volume:/data
networks:
- myapp_network
wsgi:
image: wsgi:myapp3
volumes:
- /myapp/frontend/static/
- ./wsgi/myapp:/myapp
- /myapp/frontend/clientApp/node_modules
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- postgres
- redis
ports:
- 9090
- 3000:3000
- 8000:8000
environment:
C_FORCE_ROOT: 'true'
SERVICE_PORTS: 9090
networks:
- myapp_network
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
nodejs:
image: nodejs:myapp3
volumes:
- ./nodejs/frontend:/frontend
- /frontend/node_modules
depends_on:
- wsgi
ports:
- 9000:9000 # development
- 9999:9999 # production
environment:
BACKEND_API_URL: https://0.0.0.0:3000
networks:
- myapp_network
nginx:
image: mydockeraccount/nginx-brotli:1.21.0
volumes:
- ./nginx:/etc/nginx/conf.d:ro
- ./wsgi/myapp:/myapp:ro
- myapp_nginx_volume:/var/log/nginx/
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
- myapp_network
haproxy:
image: haproxy:2.3.9
volumes:
- ./haproxy:/usr/local/etc/haproxy/:ro
- /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
depends_on:
- wsgi
- nodejs
- nginx
ports:
- 9763:80
networks:
- myapp_network
deploy:
placement:
constraints: [node.role == manager]
volumes:
myapp_postgres_volume:
myapp_redis_volume:
myapp_nginx_volume:
myapp_pgadmin_volume:
networks:
myapp_network:
driver: overlay
As you can see I have a nodejs app and a django (wsgi) app. I have written django middleware to log incoming IP to the database. However, it [logs the IP different from the actual IP](https://stackoverflow.com/questions/76280610/accessing-browser-ip-address-in-django). After
I have a following docker compose file:
version: "3.8"
services:
postgres:
image: postgres:11
volumes:
- myapp_postgres_volume:/var/lib/postgresql/data
- type: tmpfs
target: /dev/shm
tmpfs:
size: 536870912 # 512MB
environment:
POSTGRES_DB: elearning_academy
POSTGRES_USER: myapp
POSTGRES_PASSWORD: myapp123
networks:
- myapp_network
pgadmin:
image: dpage/pgadmin4:5.4
volumes:
- myapp_pgadmin_volume:/var/lib/pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: myapp123
ports:
- 8080:80
networks:
- myapp_network
redis:
image: redis:6.2.4
volumes:
- myapp_redis_volume:/data
networks:
- myapp_network
wsgi:
image: wsgi:myapp3
volumes:
- /myapp/frontend/static/
- ./wsgi/myapp:/myapp
- /myapp/frontend/clientApp/node_modules
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- postgres
- redis
ports:
- 9090
- 3000:3000
- 8000:8000
environment:
C_FORCE_ROOT: 'true'
SERVICE_PORTS: 9090
networks:
- myapp_network
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
nodejs:
image: nodejs:myapp3
volumes:
- ./nodejs/frontend:/frontend
- /frontend/node_modules
depends_on:
- wsgi
ports:
- 9000:9000 # development
- 9999:9999 # production
environment:
BACKEND_API_URL: https://0.0.0.0:3000
networks:
- myapp_network
nginx:
image: mydockeraccount/nginx-brotli:1.21.0
volumes:
- ./nginx:/etc/nginx/conf.d:ro
- ./wsgi/myapp:/myapp:ro
- myapp_nginx_volume:/var/log/nginx/
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
- myapp_network
haproxy:
image: haproxy:2.3.9
volumes:
- ./haproxy:/usr/local/etc/haproxy/:ro
- /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
depends_on:
- wsgi
- nodejs
- nginx
ports:
- 9763:80
networks:
- myapp_network
deploy:
placement:
constraints: [node.role == manager]
volumes:
myapp_postgres_volume:
myapp_redis_volume:
myapp_nginx_volume:
myapp_pgadmin_volume:
networks:
myapp_network:
driver: overlay
As you can see I have a nodejs app and a django (wsgi) app. I have written django middleware to log incoming IP to the database. However, it [logs the IP different from the actual IP](https://stackoverflow.com/questions/76280610/accessing-browser-ip-address-in-django). After
Stack Overflow
Accessing browser IP address in django
I want to log an IP address from where particular url is accessed. I am implementing this functionality in django middleware. I tried obtaining IP address using method given in this answer:
def
def
reading online, I came to know that this might be due to how the docker network is configured (`overlay` as can be seen in last line of above docker compose file). I read online that I need to configure docker network in `host` mode. So I tried adding `network_mode: host` to each service and removing `networks` section from above file.
version: "3.8"
services:
postgres:
image: postgres:11
volumes:
- myapp_postgres_volume:/var/lib/postgresql/data
- type: tmpfs
target: /dev/shm
tmpfs:
size: 536870912 # 512MB
environment:
POSTGRES_DB: elearning_academy
POSTGRES_USER: myapp
POSTGRES_PASSWORD: myapp123
network_mode: host
pgadmin:
image: dpage/pgadmin4:5.4
volumes:
- myapp_pgadmin_volume:/var/lib/pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: myapp123
ports:
- 8080:80
network_mode: host
redis:
image: redis:6.2.4
volumes:
- myapp_redis_volume:/data
network_mode: host
wsgi:
image: wsgi:myapp3
volumes:
- /myapp/frontend/static/
- ./wsgi/myapp:/myapp
- /myapp/frontend/clientApp/node_modules
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- postgres
- redis
ports:
- 9090
- 3000:3000
- 8000:8000
environment:
C_FORCE_ROOT: 'true'
SERVICE_PORTS: 9090
network_mode: host
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
nodejs:
image: nodejs:myapp3
volumes:
- ./nodejs/frontend:/frontend
- /frontend/node_modules
depends_on:
- wsgi
ports:
- 9000:9000 # development
- 9999:9999 # production
environment:
BACKEND_API_URL: https://0.0.0.0:3000
network_mode: host
nginx:
image: mydockeraccount/nginx-brotli:1.21.0
volumes:
- ./nginx:/etc/nginx/conf.d:ro
- ./wsgi/myapp:/myapp:ro
- myapp_nginx_volume:/var/log/nginx/
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
network_mode: host
haproxy:
image: haproxy:2.3.9
volumes:
- ./haproxy:/usr/local/etc/haproxy/:ro
- /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
depends_on:
- wsgi
- nodejs
- nginx
ports:
- 9763:80
network_mode: host
deploy:
placement:
constraints: [node.role == manager]
volumes:
myapp_postgres_volume:
myapp_redis_volume:
myapp_nginx_volume:
myapp_pgadmin_volume:
When I run `docker stack deploy -c docker-compose.yml my_stack`, it outputs `Ignoring unsupported options: network_mode.` I tried to check how the network is created:
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
tp6olv2atq06 myapp_default overlay swarm
So it ended
version: "3.8"
services:
postgres:
image: postgres:11
volumes:
- myapp_postgres_volume:/var/lib/postgresql/data
- type: tmpfs
target: /dev/shm
tmpfs:
size: 536870912 # 512MB
environment:
POSTGRES_DB: elearning_academy
POSTGRES_USER: myapp
POSTGRES_PASSWORD: myapp123
network_mode: host
pgadmin:
image: dpage/pgadmin4:5.4
volumes:
- myapp_pgadmin_volume:/var/lib/pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: myapp123
ports:
- 8080:80
network_mode: host
redis:
image: redis:6.2.4
volumes:
- myapp_redis_volume:/data
network_mode: host
wsgi:
image: wsgi:myapp3
volumes:
- /myapp/frontend/static/
- ./wsgi/myapp:/myapp
- /myapp/frontend/clientApp/node_modules
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
- postgres
- redis
ports:
- 9090
- 3000:3000
- 8000:8000
environment:
C_FORCE_ROOT: 'true'
SERVICE_PORTS: 9090
network_mode: host
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
nodejs:
image: nodejs:myapp3
volumes:
- ./nodejs/frontend:/frontend
- /frontend/node_modules
depends_on:
- wsgi
ports:
- 9000:9000 # development
- 9999:9999 # production
environment:
BACKEND_API_URL: https://0.0.0.0:3000
network_mode: host
nginx:
image: mydockeraccount/nginx-brotli:1.21.0
volumes:
- ./nginx:/etc/nginx/conf.d:ro
- ./wsgi/myapp:/myapp:ro
- myapp_nginx_volume:/var/log/nginx/
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
network_mode: host
haproxy:
image: haproxy:2.3.9
volumes:
- ./haproxy:/usr/local/etc/haproxy/:ro
- /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
depends_on:
- wsgi
- nodejs
- nginx
ports:
- 9763:80
network_mode: host
deploy:
placement:
constraints: [node.role == manager]
volumes:
myapp_postgres_volume:
myapp_redis_volume:
myapp_nginx_volume:
myapp_pgadmin_volume:
When I run `docker stack deploy -c docker-compose.yml my_stack`, it outputs `Ignoring unsupported options: network_mode.` I tried to check how the network is created:
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
tp6olv2atq06 myapp_default overlay swarm
So it ended
up being configured in the overlay mode only and not in host mode.
Further reading online revealed that host network mode is not available for swarm started with `docker stack deploy`. (Possible related open issue: [github link](https://github.com/docker/roadmap/issues/157)).
For development, I simply connect vscode to nodejs and wsgi containers and run the apps in debug mode. So nginx is not involved at during development. However, in the deployment we do use nginx, which is also deployed as a docker container.
Now I have following questions:
**Q1.** Is configuring nginx to set `X-Real-IP` header with actual IP only solution?
**Q2.** Cant I do some docker config or changes in docker compose file to obtain real IP address inside docker container (django in my case), without doing any changes to nginx? Say somehow configuring those containers to be on `host` network?
**Q3.** If somehow I configure nginx to set `X-Real-IP` header, will it work even while development, given that nginx is not involved while development?
**Q4.** The comments to [this](https://serverfault.com/a/1055735/546170) answer seem to suggest that if the nginx itself is running as a docker container, then configuring it to add `X-Real-IP` header will not work. Is it so?
https://redd.it/13m9a2n
@r_devops
Further reading online revealed that host network mode is not available for swarm started with `docker stack deploy`. (Possible related open issue: [github link](https://github.com/docker/roadmap/issues/157)).
For development, I simply connect vscode to nodejs and wsgi containers and run the apps in debug mode. So nginx is not involved at during development. However, in the deployment we do use nginx, which is also deployed as a docker container.
Now I have following questions:
**Q1.** Is configuring nginx to set `X-Real-IP` header with actual IP only solution?
**Q2.** Cant I do some docker config or changes in docker compose file to obtain real IP address inside docker container (django in my case), without doing any changes to nginx? Say somehow configuring those containers to be on `host` network?
**Q3.** If somehow I configure nginx to set `X-Real-IP` header, will it work even while development, given that nginx is not involved while development?
**Q4.** The comments to [this](https://serverfault.com/a/1055735/546170) answer seem to suggest that if the nginx itself is running as a docker container, then configuring it to add `X-Real-IP` header will not work. Is it so?
https://redd.it/13m9a2n
@r_devops
GitHub
Original ip is not passed to containers ... · Issue #157 · docker/roadmap
The issue affects macOS, Windows, and Linux. We'd like to see in the roadmap somewhere. docker/for-mac#180