Reddit DevOps
274 subscribers
65 photos
32.1K links
Reddit DevOps. #devops
Thanks @reddit2telegram and @r_channels
Download Telegram
How much to charge

I do web and app dev. Occasionally I get asked to set up servers and other devops. Some of these things I have scripts for and if I charge for time I feel I'm getting shortchanged. For example lately I've been asked to set up a system with nginx as load balancer and multiple server instances. Can anyone help me with pricing?

https://redd.it/fg7s6a
@r_devops
How do you manage dockerized nginx configs created by automated web proxies like jwilder/nginx-proxy or maybe traefik?

Hello.

I am wondering if I may doing some of the things wrong.

I have been using both solution (jwilder/nginx-proxy and traefik v1), but once there came problems with http responses like 413 (basically the default request size is limited to 2MB - far to small) or some CORS policies, then I have to fix this by putting some modifications in nginx conf files.

As we know logging in to the server, installing nano / vim and manually editing the conf files are a no-no way in dockerized environment since this will not persist after container shutdown, scale, restart, or whatever any other reason.

Its funny how some basic automation that things like traefik provides are initially great, but later seems to be like "oh well f\*\*\*ed now..."

I think that there will be answers like Consul (which I am not familiar with) or something. My alternative is to do some fancy magic with Jenkins, but I don't feel it as "the right way"

https://redd.it/fgvk1e
@r_devops
How to use Terraform to schedule daily backups of your Google SQL database

At work, I had to schedule daily backups of a Google SQL database into a Google Storage bucket with Terraform, I figured that writing an article about it could maybe help other developers!

[Here is the link to the article](https://medium.com/inato/how-to-use-terraform-to-schedule-backups-for-your-google-cloud-sql-database-8688da8180e1)

I’ll be glad to have your feedbacks on it! :)

https://redd.it/fgw3s3
@r_devops
AWS ECR, ECS based deployment: nginx: [emerg] host not found in upstream “app:9000” in /etc/nginx/conf.d/default.conf:2

I am struggling to **configure** AWS **ECS Task definition** to run simple PHP-FPM & Nginx based containers.

My "app" container is running at app:9000
port and Nginx is in 80
port. Nginx is forwarding the request to app container through a fastcgi\_pass app-upstream;

All of these are running perfectly in local. The same configuration is running perfectly in DigitalOcean Docker Instance but fails in AWS ECS.

I am guessing some task-definition configuration issue, but I can't find it.

**Error Logs:**

I am getting this log from **Nginx container**

nginx: [emerg] host not found in upstream "app:9000" in /etc/nginx/conf.d/default.conf:2

Image: [https://i.stack.imgur.com/EhXmc.png](https://i.stack.imgur.com/EhXmc.png)

and this log from **App** ***(PHP-FPM)*** **container**

[10-Mar-2020 02:39:37] NOTICE: fpm is running, pid 1
[10-Mar-2020 02:39:37] NOTICE: ready to handle connections
[10-Mar-2020 02:39:38] NOTICE: Finishing ...
[10-Mar-2020 02:39:38] NOTICE: exiting, bye-bye!

Image: [https://i.stack.imgur.com/2VWIV.png](https://i.stack.imgur.com/2VWIV.png)

**ECS**

I've created a simple cluster with T2 Small instance, which is running perfectly.

**Dockerfile**

In this Github Repo, I've added the Dockerfile
for App, Nginx image, docker-compose.yml
file and task-defination.json
file for reference if there is any mistake in docker files.

**Source code in Github** repo: [https://github.com/arifulhb/docker-ecr-sample](https://github.com/arifulhb/docker-ecr-sample)

Expecting someone can help me out to fix this.

TIA

*Ariful*

https://redd.it/fg7jlm
@r_devops
Chaos Engineering - A Question.

Hey, all! For better or worse, my company wants to get into the Chaos Engineering thing.

My question is, is there a sort of universally agreed upon template to tracking issues? We have quite a few tools we have built in house, and I have different scenarios I'd like to keep track of for each one, and will be adding more in the future.

I was going to toss something together, but figured it would be best to make sure I'm not missing out on something the community is already using.

This is one of the few things for which I haven't been able to find a readily available, pre-made spreadsheet.

Any help would be awesome. Thanks, all!

PS: Totally new to this concept - reading the white paper now.

https://redd.it/fgy39a
@r_devops
Terraform - Create DNS record for provisioned VMs

Hello all.

I've started to test Terraform IaC and automation and would like to provision a couple of VMs on our OpenNebula cluster, and then use IP addresses of those provisioned VMs as inputs for PowerDNS provider to create records.

Currently, I'm stuck in creating multiple records (looping through provisioned VMs and getting hostname+ip). IP reservations are handled in OpenNebula, so all info about records should be in `opennebula_virtual_machine.test-cluster.*`

A bit of code:

resource "opennebula_virtual_machine" "test-cluster" {
count = 2
name = "vm-${count.index + 1}.int.domain.tld"
....
}

And the idea is to use something like this "pseudocode":

resource "powerdns_record" "add_records" {
for vm in opennebula_virtual_machine.test-cluster {
name = "vm.name"
records = "vm.ip"
zone = "int.domain.tld"
ttl = 300
type = "A"
}
}

I can't get the loop syntax right, so any help would be very appreciated!

https://redd.it/fgymov
@r_devops
Path to non-technical position

I'm pretty bored and unhappy with being an infrastructure/devops/SRE/what-have-you. I've actually wanted to do something else for a while but the money and lifestyle have kept me put. However I'm realizing it's time to take action.

Not really interested in management, it seems like a nightmare to be honest. I have looked at tech consulting and sales engineering as two options. Seems like they are more people-facing, and still have a lot of the problem-solving that drew me to tech in the first place. Also they have similar income/status to being an engineer.

Anyone make the jump? Got any tips? Any other careers that might be interesting to someone who wants to be done with technical work but still in tech?

https://redd.it/fh0c1a
@r_devops
Can any NGINX people tell me what's wrong with my simple conf? (paste below)

error_log /var/log/nginx/error.log;

events {}
http {
server {
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/cert.crt;
ssl_certificate_key /etc/nginx/ssl/private.key;
location / {
proxy_pass https://15.201.115.134.xip.io:8443/;
proxy_read_timeout 3600;
}
}

So I made a simple config for Nginx to proxy me to the endpoint. I can get there going directly to it but when I do it with NGINX it gives me a 504 Gateway Timeout. Now...if I change the port from 8443 to 80 or 443 it takes me to "Application not available." So I know its getting there but its not getting to 8443. Am I missing something simple? (URL obfuscated obviously)

Thanks for the help. :)

https://redd.it/fh3987
@r_devops
Repository for delivering to customers

Hi Devops!

We are currently using Nexus3 for on-prem docker repository and setup proxy-cache instances of Nexus3 when we want to create a new K8s environment either on a demo server or a remote QA environment etc.

What is currently the best approach to release builds to both internal and external customers so they can refresh their on-prem environments ?

We are researching **on prem** solutions that our pipeline can push to , specify which user has access to which artifact (kind of like licensing) and serve both internal and external customers.

Any best practices / known solutions that you could suggest for handling these deliveries?

Thanks

https://redd.it/fh43x6
@r_devops
Docker Needs to be Started Manually

I am painfully new to Docker and recently just setup an instance to use for Redis. I found out fairly quickly that it seems it has to started manually after a server reboot.

Would I use Kubernetes to resolve this? How do I automate this?

https://redd.it/fh5is9
@r_devops
Implement a release process for managing and controlling software application releases

Software Development process is not complete and mature without a well-defined release process for the software applications. Every software application needs to be delivered or deployed at some point in time and for agile projects, this is happening more often. Therefore, there is a need to maintain software quality across the application releases to avoid deploying untested or malicious code to production environments.

Defining a release process for software applications helps in ensuring that software releases maintain a constant release quality. In addition, software changes and new features are traceable or can be correlated to specific releases easily. As a result, changelogs and release notes are easier for a generation.

​

[more info](https://medium.com/@wshihadeh/tips-for-implementing-a-software-release-process-8551db21fe85)

https://redd.it/fgul1t
@r_devops
Can I use a reverse Proxy (Like NGINX) in a public subnet to access a web server over port 80 in a private subnet? (I can't use an ELB for this use case)



https://redd.it/fh6mrs
@r_devops
Terraform concept needs to be explained

Hi guys, I've just started learning terraform and was messing around trying to create auto scaling group . I've come across a 'Lifecycle_hook' concept but didn't get it. Looking into the docs didn't help much. Could u explain what it does and how is it used? Thanks a lot

https://redd.it/fgt6ls
@r_devops
Seen this blog 'How to setup Role-based access to Kubernetes Cluster '?

If you are working on Kubernetes for some time you may have faced a scenario where you have to give some users limited access to your Kubernetes cluster. For example, you may want a user, say Alice from development, to have access only to some resources that are in the development namespace and nothing else. To achieve this type of role-based access, we use the concept of Authentication and Authorization in Kubernetes.

Broadly, there are three kinds of users that need access to a Kubernetes cluster:

#### 1. Developers/Admins:

Users that are responsible to do administrative or developmental tasks on the cluster. This includes operations like upgrading the cluster or creating the resources/workloads on the cluster.

#### 2. End Users:

Users that access the applications deployed on our Kubernetes cluster. Access restrictions for these users are managed by the applications themselves. For example, a web application running on Kubernetes cluster, will have its own security mechanism in place, to prevent unauthorized access.

#### 3. Applications/Bots:

There is a possibility that other applications need access to the Kubernetes cluster, typically to talk to resources or workloads inside the cluster. Kubernetes facilitates this by using [Service Accounts](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/), which is a topic for another post. Here, we are going to focus on Role-Based Access Control (RBAC).

So the category of users that can be managed with RBAC is developers/admins. In a nutshell, when using RBAC, you would create users and assign them roles. Each role is mapped with certain authorizations, thus restricting each user to a set of actions defined by the roles they are assigned to. As of now, Kubernetes doesn’t have any mechanism to create or manage users inside the cluster. They need to be created and managed externally. Now let’s see Kubernetes RBAC in action.

What we will do here is create a user that will be allowed to do some tasks or access only some resources from a namespace. This user should not be able to perform any other tasks or access to any other resources.

[Read the full post here](https://www.infracloud.io/role-based-access-kubernetes/)

https://redd.it/fgu7xg
@r_devops
How to install eclipse che on kubernetes cluster that i have set with kubeadm ?

I followed too many guides but most of them use minikube which will create a single noded cluster but the one i have is installed on 3 VMs using kubeadm, is there any method to install eclipse che

https://redd.it/fgtt6y
@r_devops
Opinion of HR only interviews

I'm curious what peoples opinions are on being interviewed purely by HR?

I've got through to the final stage of an interview process, after going through technical screening, take home assignment and general conversation with the tech team.

I'm now being asked to have an interview with HR to look at my 'cultural fit' within the company.

My previous experience with this has always been negative. I generally feel a HR team can't accurately gage if you are suitable for a role, that decision should be made within the team you are joining, not by the HR team. Worse still they are likely to ask generic questions about performance which I never feel are relevant.

https://redd.it/fhgxyw
@r_devops
Using Litmus Chaos Engine on Kubernetes with Autonomous Monitoring for Verification

This [Github repository](https://github.com/zebrium/zebrium-kubernetes-demo) installs a demo app environment with multiple services on a Kubernetes cluster and runs a series of chaos experiments on the cluster. It then uses Autonomous Monitoring to automatically detect the issues caused by the chaos experiments. It's pretty cool!

https://redd.it/fhihxl
@r_devops
Kubernetes Cluster API updated to v1alpha3 and now supports launching clusters on 7 platforms

Cluster API allows you to bootstrap and manage clusters from Kubernetes itself. It can be seen as an operator for Kubernetes clusters.

The quickstart has been updated for v1alpha3
https://cluster-api.sigs.k8s.io/user/quick-start.html

Cloud platforms
* AWS
* Azure
* GCP

On-prem
* vSphere
* OpenStack
* Bare-metal (metal3 via openstack ironic)

dev
* docker (think KIND - kubernetes inside docker style)

https://redd.it/fhkl0o
@r_devops
Twelve Dot One Factor Apps (Blog Post)

I have been following the Twelve-Factor App methodology for a considerable amount of years. I mean, just like the Pirate Code, I see them more as guidelines than rules. There Is a factor I’d like to challenge. Can tell you how and why in this blog post I have written just for you ;)

[Twelve Dot One Factor Apps](https://zemanel.eu/posts/2020/03/twelve-dot-one-factor-apps/)

https://redd.it/fhk4xz
@r_devops
How to add external cluster to spinnaker

I have two Kubernetes clusters, I have Spinnaker deployed to dev and want to be able to run pipelines on prod. I can't seem to figure out how to add another cluster, I see something in the helm chart values file about adding a secret but not exactly sure what it fully means and google has been less than helpful today.

​

How can I add an external kubernetes cluster to my Spinnaker setup which was installed via helm - no text editor in the halyard container to create files with

https://redd.it/fhklcs
@r_devops