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 / 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
@weltonrodrigo
weltonrodrigo / dcode-analysis.ipynb
Last active August 31, 2020 17:18
dCode Analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@weltonrodrigo
weltonrodrigo / PDFA_def.ps
Created September 9, 2016 23:03
PDFA_def to convert from PDF to PDFA
%!
% This prefix file for creating a PDF/A document is derived from
% the sample included with Ghostscript 9.07, released under the
% GNU Affero General Public License.
% Modified 4/15/2013 by MCB Systems.
% Feel free to modify entries marked with "Customize".
% This assumes an ICC profile to reside in the file (AdobeRGB1998.icc),
% unless the user modifies the corresponding line below.
@weltonrodrigo
weltonrodrigo / spirituality.csv
Last active April 6, 2016 17:36
Level in Espirituality scale by age
Spirituality Age
1 4.9 23
2 3.1 30
3 4 32
4 3.9 NA
5 4.8 29
6 4.9 30
7 3.8 23
8 NA 55
9 3.3 22