Reddit DevOps
278 subscribers
69 photos
32.2K links
Reddit DevOps. #devops
Thanks @reddit2telegram and @r_channels
Download Telegram
SonarQube with ReactJS - false positive on duplicates and coverage on new code

I'm trying to analyze ongoing ReactJS project using SonarQube (first time with that tool) version 6.7.5 but after second code scan I'm getting Quality Gate failed due to 0% Coverage on New Code and 5% Duplicated Lines on New Code.

First problem - I have no clue why I'm getting it at all (no coverage on new code) when I see new code got picked up by SonarQube. It looks like most of functional components are not covered by tests

Second problem - duplicates. Most of them are false positive like import statements or declarations (ex. react-table and columns declaration). Is there any way to mark them as non-duplicate? Or is there any workaround to get those kind of code blocks as valid (not dups)?

https://redd.it/ed4t0s
@r_devops
Conditional statement for choosing node(agent) in Jenkins pipeline?

Hi guys! I'm new to jenkins pipeline. We are using scripted pipeline.


I'm trying to do the following in my jenkinsfile with the purpose that if "master" is being used, then run in "slave". Is that what the following conditional does in scripted pipeline? If not, is there a better/right way?


node ("master||slave") {
.....
}

https://redd.it/ed3nsw
@r_devops
Most advanced GitHub Actions examples?

My team and I are re-evaluating SaaS-based replacements for Jenkins. with one of those being GitHub Actions. Let me say we’ve been able to achieve some fairly advanced Jenkins pipelines having started with evolving shared libraries that abstracted the underpinnings for building and deploying a wide variety of projects with a high degree of control.

I would appreciate links to projects or what not showing off the current limits that people are pushing GitHub Actions including any technical articles on some of the best practices around them.

Thanks!

https://redd.it/ed0obe
@r_devops
Use GitHub actions at your own risk

[https://julienrenaux.fr/2019/12/20/github-actions-security-risk/](https://julienrenaux.fr/2019/12/20/github-actions-security-risk/)

TL;DR: Using GitHub actions with branch names or tags is unsafe. Use commit hash instead.

Something to keep in mind when you use GitHub actions marketplace!

https://redd.it/edbs4q
@r_devops
[stable/prometheus-operator] ldap sync grafana dashboard keeps logging out

Do anyone face the below issue or some solutions ?

\*\*Describe the bug\*\*

grafana dashboard keeps logging out after setting up the ldap configuration

lvl=eror msg="Failed to look up user based on cookie" logger=context error="user token not found

​

\*\*Which chart\*\*:

prometheus-operator-8.3.3

​

\*\*What happened\*\*:

After setting up the below config to integrate grafana with AD, able to login with AD creds for a second(only first time) and when i browse any dashboards it keeps logging out

​

Next attempts, there is a green tick it's authorized but not able to login

lvl=eror msg="Failed to look up user based on cookie" logger=context error="user token not found"

​

Config

grafana.ini:

paths:

data: /var/lib/grafana/data

logs: /var/log/grafana

plugins: /var/lib/grafana/plugins

provisioning: /etc/grafana/provisioning

analytics:

check\_for\_updates: true

log:

mode: console

filters: ldap:debug

\# session:

\# cookie\_secure: true

security:

\# cookie\_secure: true

cookie\_samesite: "none"

auth:

login\_maximum\_inactive\_lifetime\_days: 7

login\_maximum\_lifetime\_days: 30

token\_rotation\_interval\_minutes: 600

api\_key\_max\_seconds\_to\_live: -1

grafana\_net:

url: [https://grafana.net](https://grafana.net)

\## LDAP Authentication can be enabled with the following values on grafana.ini

\## NOTE: Grafana will fail to start if the value for ldap.toml is invalid

auth.ldap:

enabled: true

allow\_sign\_up: true

config\_file: /etc/grafana/ldap.toml

​

ldap:

enabled: true

config: |-

verbose\_logging = true

​

\[\[servers\]\]

host = "[adhost.com](https://adhost.com)"

port = 3269

use\_ssl = true

start\_tls = false

ssl\_skip\_verify = true

bind\_dn = "BindAddress\\\\%s"

search\_filter = "(sAMAccountName=%s)"

search\_base\_dns = \["dc=xxx,dc=com"\]

​

\[servers.attributes\]

name = "givenName"

surname = "sn"

username = "sAMAccountName"

member\_of = "memberOf"

email = "mail"

​

\*\*What you expected to happen\*\*:

Dashboard should not automatically logout for every few seconds

​

\*\*How to reproduce it\*\* (as minimally and precisely as possible):

I see some of the page showing same issue, but none of them resolved

example: [https://community.grafana.com/t/after-upgrade-from-grafana-5-to-6-dashboard-keeps-logging-out/14931/61](https://community.grafana.com/t/after-upgrade-from-grafana-5-to-6-dashboard-keeps-logging-out/14931/61)

https://redd.it/ediee8
@r_devops
Why the outrageous pricing on Web Summit and other tech events?

Just got an email saying I would get a discount and pay 50% on the tickets for the next summit, and that would be 950 euros. So, the full price will be 1900 euros, and it's likely to be higher as it come closes to the date. Not only websummit, but AWS reinvent tickets were around 1800 dollars.


How they justify the pricing?

https://redd.it/ede13j
@r_devops
Just published first version of Ansible for Kubernetes, my second book!

I'm excited to share that I just published the first early version of Ansible for Kubernetes ([blog post here](https://www.jeffgeerling.com/blog/2019/ansible-kubernetes-my-second-self-published-book)), and it's available on LeanPub—DRM free, with free updates forever.

I self-published my first book, Ansible for DevOps, a few years ago, and have been updating it regularly since. I hope to do the same with this book, and plan on adding another five chapters before reaching '1.0' status.

In the blog post, I discuss more about why I chose to write on Ansible + Kubernetes, and my timeline for completing the book (barring any more annoying health issues that have been hampering my writing in the past!).

https://redd.it/edbcm2
@r_devops
Got first potential job offer for DevOps position, but it's remote. Should I accept it?

The title is self-explanatory but let me add more info.
I currently work as a net admin and from some time ago I started to learn more skills for a DevOps job.

Eventually started applying and got a potential job for a (junior)DevOps but with full remote work.
I honestly think it would be crippling for my first job as DevOps to be 100% remote.
Maybe after couple of years, I would go for full-time work from home but jumping to that from the start seems bad for me.

The company is well aware that this will be my first gig and they said it shouldn't be a problem for me. I will contact with the other team members through slack and should consider it.
I think it should be better to first start with the job in an office environment with the team, and after some time gradually start working remotely. Maybe once a week.

Thoughts, explanations, info? Thanks

https://redd.it/eds1el
@r_devops
DevOps: A simple example workflow pattern featuring Go, Docker, Kubernetes, CircleCI

Here is a quick video explaining through an **example** about a typical workflow along with what all types of **tools** that might be required in general in DevOps including very brief introduction on containerisation(Docker), container orchestration(Kubernetes), Auto-testing/deploying(CircleCI), Monitoring and Load Balancing.

This should be useful for a **beginner** to get a brief general overview.

[https://www.youtube.com/watch?v=9pVd2Fjbaew](https://www.youtube.com/watch?v=9pVd2Fjbaew)

https://redd.it/edryu1
@r_devops
Advice for Kubernetes infrastructure setup for a project.

I got a project to deploy to Kubernetes.

Project itself is Python Flask REST api and is split into multiple microservices.

My knowledge is not on some high level and this is my first time to work in a microservice based env, besides that first time actually doing something with Kubernetes.

With my limited knowledge this is a list of services from a docker-compose file:

\- Billing service ( Stripe ) ( links: rabbitMQ, Postgres )

\- User management service ( links: rabbitMQ, Postgres, Redis )

\- Video compression service ( links: rabbitMQ )

\- Video watermark service ( links: rabbitMQ, Postgres )

\- Rest api service ( links: rabbitMQ, Postgres )

\- Notification service ( links: rabbitMQ )

​

From these services my first guess is that some of them asks for more resources than other. Video services for sure.

​

Any advice on how to approach this in Kubernetes deployment?

https://redd.it/edsgnr
@r_devops
Android app for AWS Lambda

I'm sharing an Android app I've been working on that makes it easy to invoke AWS Lambda functions from an Android device. Link: https://play.google.com/store/apps/details?id=com.alexsci.android.lambdarunner
I've been using it to trigger release scripts and other DevOps helper Lambda functions from my phone. More info: https://alexsci.com/android-apps/aws-lambda-invoker/getting-started.html

https://redd.it/edtvja
@r_devops
Use Helm for deploying bespoke apps?

Do you guys use helm to deploy your own apps by writing private chart?

Or just use it to deploy the published apps from the repo?

https://redd.it/edm3lc
@r_devops
Forbid to push in production on Friday is a #DevOps anti pattern

More than just make Dev and Ops working better together, DevOps aims at delivering as soon as possible any developed and tested features to our users, get the expected value and having quick feedbacks.

Forbid to deploy on Friday is to lose 20% of time to deliver this value to your users. Sometimes, we even forbid it on Thursday afternoon or before Bank Holidays, thus forbid more than 30% of time !


More than lose this important time, we give the impression that we are not confident of our CI/CD pipeline, of our tests, maybe not even trust our teams. If you are not confident to deploy on Friday, why are you to do it any other day?


This rules implies than deploying is dangerous, risky. We should not FEAR to deploy in production.


If you believe you are #DevOps, you should be able to deploy any times, nights and days, even on Friday!

More details here : https://rochefolle.com/index.php/en/2019/12/08/devops-what-if-we-deploy-on-friday/

https://redd.it/edn3cz
@r_devops
Terraform Access Key/Secret and IAM best practices

I am creating a new IAM user/role that will be used from my CI server. This part is trivial.
When terraform creates this new resource, because I am using `resource "aws_iam_access_key"` it creates a new access key. Which I need, so that I can use it from my multi-account CI server. I want to know what the best practices are regarding the storage and retrieval of said key.

So for example, is it okay for it to be stored in terraform state?
Would I just retrieve this value from state when I want to add it to my CI server?

Would it be best to manually create these keys before hand? (I feel like this would defeat the purpose of IAM via IaC)


How are you guys handling this issue?
Any insight will be much appreciated !

https://redd.it/edeiw3
@r_devops
Have you replaced docker with another tool for containerizing images?

I couldn’t convince the Linux team to install docker on our build servers and we’re going with podman I think. Have you used podman or any other tool?

https://redd.it/edyuaf
@r_devops
📦 This project was design to allow anyone to drop a digital packaged in front of your digital front porch - all serverless.

A weekend project that I did out of necessity when working with clients. And it also showcase what type of interesting things you can do with Serverless :). Here is the URL: https://github.com/0x4447/0x4447_product_front_porch, and I'm open to questions.

https://redd.it/edwn74
@r_devops
High availability WordPress glusterfs question

Hey there,
I'm planning a higher availability WordPress setup. Right now my setup is one load-balancer, one mysql database.

Now I started building the lemp server, but decided to host the files on one or two glusterfs dedicated nodes. My question is, should I have all the WordPress files on each of the lemp served and just mount the wp-content folder via the glusterfs node or should I host the entire worldpress glusterfs and just have the lemp nodes read from it? What would you suggest?

Thank you

https://redd.it/edyl5u
@r_devops