Skip to content

Instantly share code, notes, and snippets.

Avatar

Matías Hermosilla matiasah

View GitHub Profile
@matiasah
matiasah / pkix.md
Created Jan 14, 2022
Fix PKIX exception in Java
View pkix.md

How to fix PKIX exception in Java

Import the site's certificate into the cacerts.

Without proxy Java 11:

%JAVA11_HOME%/bin/keytool -delete -noprompt -alias <site> -storepass changeit -cacerts
%JAVA11_HOME%/bin/keytool -printcert -rfc -sslserver <site>:443 > %CERT_PATH%/<site>.pem
%JAVA11_HOME%/bin/keytool -importcert -file %CERT_PATH%/<site>.pem -alias <site> -storepass changeit -cacerts -noprompt
@matiasah
matiasah / kubernetes-backend-pipeline.md
Last active May 12, 2021
Kubernetes Backend Pipeline (GitLab Runner)
View kubernetes-backend-pipeline.md

Environment variables

Environment variable Description
KUBECONFIG Address pointing to the kubeconfig.yaml file

Pipeline

.gitlab-ci.yml

image: docker:latest
@matiasah
matiasah / kubernetes-frontend-pipeline.md
Last active May 12, 2021
Kubernetes Frontend Pipeline (Gitlab Runner)
View kubernetes-frontend-pipeline.md

Environment variables

Environment variable Description
KUBECONFIG Address pointing to the kubeconfig.yaml file

Pipeline

.gitlab-ci.yml

image: docker:latest
@matiasah
matiasah / cloudfront-s3-pipeline.md
Last active May 12, 2021
CloudFront + S3 Pipeline (Gitlab Runner)
View cloudfront-s3-pipeline.md

Environment variables

Environment variable Description
AWS_ACCESS_KEY_ID Access key of the IAM account
AWS_SECRET_ACCESS_KEY Secret key of the IAM account
AWS_REGION Region of the Elastic Beanstalk instance
S3_BUCKET_NAME Name of the S3 bucket
CDN_DISTRIBUTION_ID Id. of the CloudFront distribution
@matiasah
matiasah / elastic-beanstalk-pipeline-gitlab-runner.md
Last active May 12, 2021
Elastic Beanstalk Pipeline (Gitlab Runner)
View elastic-beanstalk-pipeline-gitlab-runner.md

Environment variables

Environment variable Description
AWS_ACCESS_KEY_ID Access key of the IAM account
AWS_SECRET_ACCESS_KEY Secret key of the IAM account
AWS_REGION Region of the Elastic Beanstalk instance
ELASTIC_BEANSTALK_ENV Name of the elastic beanstalk environment

Pipeline

@matiasah
matiasah / gitlab-runner.md
Last active Feb 4, 2021
Instalar GitLab Runner
View gitlab-runner.md
@matiasah
matiasah / ingress-kube-api-server.md
Last active Mar 7, 2021
Implementar recurso Ingress para kube-apiserver
View ingress-kube-api-server.md

Crear ClusterIssuer 'staging' de nginx

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-staging
spec:
  acme:
    email: «correo»
    preferredChain: ""
@matiasah
matiasah / image-registry-kubernetes.md
Last active Mar 9, 2021
Configurar registro de imágenes con Kubernetes
View image-registry-kubernetes.md
  1. Autentificarse
docker login registry.gitlab.com
  1. Cargar autentificación de docker (regcred)
kubectl create secret generic regcred \
    --from-file=.dockerconfigjson=$HOME/.docker/config.json \
    --type=kubernetes.io/dockerconfigjson \
@matiasah
matiasah / nginx-ingress.md
Last active Jan 30, 2021
Configurar controlador Ingress Kubernetes
View nginx-ingress.md
  1. Instalar Ingress Controller de Nginx utilizando Helm
    https://kubernetes.github.io/ingress-nginx/deploy/

  2. Configurar tipo de servicio a 'NodePort'

kubectl patch svc ingress-nginx-controller -p '{"spec": {"type": "NodePort"}}'
  1. Configurar dirección IP externa (pública) del servicio 'ingress-nginx-controller'
@matiasah
matiasah / ssh-user.md
Last active Jan 30, 2021
Crear cuenta SSH con clave privada RSA
View ssh-user.md
  1. Crear cuenta de usuario "pipeline":
sudo adduser --disabled-password **pipeline**
  1. Crear carpeta .ssh en usuario "pipeline":
sudo mkdir /home/**pipeline**/.ssh