Skip to content

Instantly share code, notes, and snippets.

View weltonrodrigo's full-sized avatar
🏠
Working from home

Welton Rodrigo Torres Nascimento weltonrodrigo

🏠
Working from home
  • Brasília, Distrito Federal, Brasil
View GitHub Profile
@weltonrodrigo
weltonrodrigo / municipios_brasileiros_maiusculas_sem_acento.csv
Last active August 5, 2022 01:33
Lista de municípios brasileiros em maiúsculas sem acentos.
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
nome
ABADIA DE GOIAS
ABADIA DOS DOURADOS
ABADIANIA
ABAETE
ABAETETUBA
ABAIARA
ABAIRA
ABARE
ABATIA
@weltonrodrigo
weltonrodrigo / eventhub-auto-inflate-on-egress.md
Last active March 16, 2026 17:28
Azure eventhub auto-inflates only on ingress, not egress

Does Azure eventhub auto-inflates on egress?

No.


Yeah, that took me a long time.

The ingress rate is what makes the eventhub namespace scale, but not the consumption (the egress). Egress don't get throttled either, you'll have to keep an eye at the rate of consumption and partition limits.

@weltonrodrigo
weltonrodrigo / kubectl_completion.md
Created March 10, 2022 16:28
`kubectl completion zsh` too slow

Believe it or not, when you do a kubectl completion zsh on your ~/.zshrc, kubectl actually tries to contact the cluster of the current-context.

This is nuts and I don't understand why it would make sense.

As this can easly take seconds to complete, you can force it to quickly give up by pointing it to a impossible HTTPS_PROXY like this:

On your ~/.zshrc…

@weltonrodrigo
weltonrodrigo / kustomization.md
Created March 10, 2022 02:26
Docker registry pull secret kustomization madness

When creating an imagePullSecret with kustomize secretGenerator, you need to set type to kubernetes.io/dockerconfigjson, not Opaque.

Like:

secretGenerator:
- files:
  - .dockerconfigjson
  name: docker-pull-secret
 type: kubernetes.io/dockerconfigjson
@weltonrodrigo
weltonrodrigo / ingress_neg.md
Created March 5, 2022 22:23
GKE ingress asks for LoadBalancer or NodePort service

This message on the GKE ingress:

Warning  Translate  42m (x25 over 63m)    loadbalancer-controller  Translation failed: invalid ingress spec: service "<namespace>/<servicename>" is type "ClusterIP",
expected "NodePort" or "LoadBalancer"; service "<namespace>/<servicename>" is type "ClusterIP", expected "NodePort" or "LoadBalancer"; service "<namespace>/<servicename>" is type "ClusterIP", expected "NodePort" or "LoadBalancer"; service "<namespace>/<servicename>" is type "ClusterIP", expected "NodePort" or "LoadBalan
cer"; service "<namespace>/<servicename>" is type "ClusterIP", expected "NodePort" or "LoadBalancer"

What this actually means is that the network endpoint groups are not being created automatically, so, without a NEG, the load balancer would need an exernal ip and port to reach the pods.

You can assert that by the absence of the NEG status annotation on the ingress and also in the backend service.

@weltonrodrigo
weltonrodrigo / error_470_azure.md
Last active October 14, 2024 17:04
HTTP 470 azure

What is an error with status HTTP 470 on Azure?

This is probably Azure Firewall.

Check the body of the response, it has some debug information:

< HTTP/1.1 470 status code 470
< Date: Sun, 27 Feb 2022 04:29:17 GMT
&lt; Content-Length: 70
@weltonrodrigo
weltonrodrigo / dive_with_docker_host.md
Last active June 2, 2022 19:20
Using dive with remote docker

Using dive (container explorer tool) with a remote docker

When using DOCKER_HOST with a remote daemon, like DOCKER_HOST=ssh:user@vm:22, you'll get an error when using dive to explore an image.

$ dive ubuntu:latest
Image Source: docker://ubuntu:latest
@weltonrodrigo
weltonrodrigo / eventhub_kafka.py
Last active February 23, 2022 17:51
Demonstração de como conectar no azure eventhub pela api kafka no python.
import logging
import pprint
import sys
from json import dumps
from typing import List
from kafka import KafkaProducer
from kafka.errors import KafkaError
from kafka.future import Future
@weltonrodrigo
weltonrodrigo / AzureMapsTokenController.java
Last active May 12, 2022 13:32
Exemplo de Controller springboot para obter no backend um token do azure maps a ser usado na aplicação javascript.
package br.org.prf.azuremapsexample.controllers;
import com.azure.core.credential.AccessToken;
import com.azure.core.credential.TokenRequestContext;
import com.azure.identity.DefaultAzureCredentialBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
@weltonrodrigo
weltonrodrigo / cloud-init.yaml
Created February 13, 2022 20:18
cloud-init for docker installation on GCE for ubuntu instances
#cloud-config
apt:
sources:
docker.list:
source: deb [arch=amd64] https://download.docker.com/linux/ubuntu $RELEASE stable
keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
packages:
- apt-transport-https