Skip to content

Instantly share code, notes, and snippets.

View matiasah's full-sized avatar

Matías Hermosilla matiasah

View GitHub Profile
@matiasah
matiasah / squash-pull-request.md
Last active January 30, 2021 02:35
Squash Pull Request

Reset the current branch to the commit just before the last 12:

git reset --hard HEAD~12

HEAD@{1} is where the branch was just before the previous command.
This command sets the state of the index to be as it would just
after a merge from that commit:

git merge --squash HEAD@{1}
@matiasah
matiasah / ssh-user.md
Last active January 30, 2021 02:31
Crear cuenta SSH con clave privada RSA
  1. Crear cuenta de usuario "pipeline":
sudo adduser --disabled-password **pipeline**
  1. Crear carpeta .ssh en usuario "pipeline":
sudo mkdir /home/**pipeline**/.ssh
@matiasah
matiasah / nginx-ingress.md
Last active January 30, 2021 02:30
Configurar controlador Ingress Kubernetes
  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 / image-registry-kubernetes.md
Last active June 6, 2023 03:03
Configure a Container Image Registry with Kubernetes
  1. To authenticate to the private registry
docker login registry.gitlab.com
  1. Create the docker authentication credential as a Kubernetes secret (regcred)
kubectl create secret generic regcred \
    --from-file=.dockerconfigjson=$HOME/.docker/config.json \
    --type=kubernetes.io/dockerconfigjson \
@matiasah
matiasah / ingress-kube-api-server.md
Last active March 7, 2021 20:11
Implementar recurso Ingress para kube-apiserver

Crear ClusterIssuer 'staging' de nginx

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-staging
spec:
  acme:
    email: «correo»
    preferredChain: ""
@matiasah
matiasah / gitlab-runner.md
Last active February 4, 2021 04:02
Instalar GitLab Runner
@matiasah
matiasah / elastic-beanstalk-pipeline-gitlab-runner.md
Last active May 12, 2021 01:06
Elastic Beanstalk Pipeline (Gitlab Runner)

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 / cloudfront-s3-pipeline.md
Last active May 12, 2021 01:09
CloudFront + S3 Pipeline (Gitlab Runner)

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 / kubernetes-frontend-pipeline.md
Last active May 12, 2021 01:23
Kubernetes Frontend Pipeline (Gitlab Runner)

Environment variables

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

Pipeline

.gitlab-ci.yml

image: docker:latest
@matiasah
matiasah / kubernetes-backend-pipeline.md
Last active May 12, 2021 01:18
Kubernetes Backend Pipeline (GitLab Runner)

Environment variables

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

Pipeline

.gitlab-ci.yml

image: docker:latest