You have tests everywhere, but you still get an error when you try to run your application because of some wrong infrastructure setup. Know one way to fix that.

It’s fantastic when you have all of your unit tests returning green signs everywhere. Still, when you execute your project, it raises an error because an infrastructure setup is wrong, making it impossible to run your Web API properly 😑. It can be how you set up your logs, database, providers, well, many other things. One approach to fix it or minimize its impact is through integration tests. So how can you do a quick setup for that 🤔? By the way, in this blog post, we’re going to consider the following technologies:

Describing the sample project

Here’s the…

It’s crucial to configure your domain to answer IPv4 and IPv6 addresses. How can we do that with GKE Ingress? Come closer, and let’s discover how to do it and some of its limitations.

In the past, when you were about to release a website to be accessed worldwide, you usually would have the following:

  • A domain where your users would use to access your website.
  • Reserved IPv4 public address.
  • A configuration that consists of a DNS entry of type A mapping your IPv4 address to your domain.
  • Some infrastructure stuff that would deliver your website.

Nowadays, we must have an IPv6 address as well! There are certain areas in the world where IPv4 connections only are not supported anymore due to addresses exhaustion. …

When you configure your application and receive an error 502 (Bad Gateway), mostly this happens because of a wrong setup. To illustrate, let’s see one circumstance and how to fix it.

Past few days, I was configuring a GKE cluster for my personal projects. Some of them had to be accessed through the internet; hence I created an ingress to do this job. Here’s an example of ingress using Terraform:

The service named spacejam-np-service was bound to a deployment like the following:

Know another way to avoid unexpected incidents in production. It will allow you to write production-ready startup shell scripts. Learn about The Set Builtin.

When you build an application and make it available through container technology, either you have an ENTRYPOINT or CMD instructions at the end of its Dockerfile. Depending on which framework you’re using and some requirements you have, sometimes it’s better to have a bash script responsible for running your project. When it’s available, generally, you’ll see a bunch of commands that are executed, like the following script I created for the project Django Multiple Schemas:

Let’s suppose the command python migrate failed its…

Nothing like a quick setup with Terraform to make your application available. There are many ways to deploy it, but how about using Google Compute Engine with the cheapest machine and using a container image? Let’s see how!

Recently I developed a worker that would listen to published tasks through a database. For this sole purpose, I used Django Q. When I finished its development, I started wondering how I would enable it in production. As my whole stack is on GCP for personal projects, I found an exciting way to deploy it with Google Compute Engine using a container image. Let’s see how we can do it pretty quickly with the help of Terraform.

Some limits you must be aware of before we start

There are some limitations that you should pay attention to before spending any time on this solution. …

Increased cognitive load can have a considerable impact on the ongoing of a project. Know how to minimize it a bit through one simple approach with environment variables.

Recently I had to create a new JavaScript project. I chose a framework and some libraries that I haven’t used before. First, I tried to find lessons learned and projects on GitHub targeting the tools I decided on and then use them as a way to create my own project. Suddenly, I noticed a problem in all examples and even in big projects: they had process.env been invoked in many different files.

This approach may be seen as harmless because it’s relatively trivial and works; nevertheless, isn’t it better to help people who get in touch if your project regarding…

Reinventing the wheel, depending on the context, can be brilliant! Curiosity can lead us into new enchanting things.

If I had to recommend someone to start a blog, taking into consideration things like time to market, huge ecosystems, tutorials, and no expected advanced knowledge in programming at all, I would tell them to start right away with Blogger, or if more options are needed, then Wordpress would be the best choice probably. …

Abandone REST de vez, ou nem tanto

Primeiramente, caso queira pular direto para o projeto com código testável e tudo mais, já deixo aqui o repositório:

E além disso, caso queira ver um exemplo do criador do framework, com outras situações como uso massivo do Relay:

A postagem exige um conhecimento básico de GraphQL, mas, assim como eu, acredito que você possa aprender testando um projeto pronto ou criando um seu do zero, em vez de ficar só na teoria, contudo é importante testar e ler materiais por fora, como as diversos links de ajuda que coloquei no final.

Aproveitando o que já temos no Django

Normalmente Django é usado quando é necessário ter…

Sim, não é fácil, mas também não é complicado

Sair da zona de conforto normalmente tem mais prós do que contras, só que os contras podem tomar proporções gigantescas. Eu costumo pensar muito sobre essa questão quando tenho oportunidade de algo. Eis a situação que caiu sobre mim: reescrever um projeto para Python, para aprender de verdade. Mas como assim, “aprender de verdade”? O que quero dizer é que ficar só no campo do estudo lendo livros, fazendo cursos, etc., não é tão proveitoso quanto pegar um projeto de verdade para lidar com problemas reais.

“Experimentando” várias linguagens, no final a sensação é tipo assim

Fiz um projeto em Kotlin com Apache Camel (inclusive comentei um pouco dele aqui)…

Use AdviceWith de uma maneira simplificada

Quando escrevemos rotas no Apache Camel, vários meios de integração podem ser utilizados para trafegar uma mensagem de uma ponta a outra, como por exemplo SOAP, REST, Socket TCP, Stomp, e tantos outros. Tudo depende de sua necessidade de negócio.

Testes unitários ou de integração não são uma preocupação. Como utilizo Spring Boot nos projetos, existe uma seção dedicada no projeto explicando como realizar testes usando o framework. Uma prática muito comum é alterar os consumers e producers (DSLs from e to, respectivamente) das rotas (expliquei um pouco na postagem Telão Interativo SPTV com Apache Camel). O problema disso é…

Willian Antunes

I am an eternal seeker of curiosity.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store