Skip to content

Instantly share code, notes, and snippets.

View RoyLDD's full-sized avatar

Yohan Gracia RoyLDD

  • Padok
  • Paris
View GitHub Profile
@RoyLDD
RoyLDD / .yaml
Created June 28, 2020 14:16
Pod with toleration and node selector
apiVersion: v1
kind: Pod
metadata:
name: kubia
spec:
containers:
- image: luksa/kubia
name: kubia
ports:
- containerPort: 8080
@RoyLDD
RoyLDD / .bash
Created June 28, 2020 14:05
EKS node user data
#!/bin/bash
set -o xtrace
/etc/eks/bootstrap.sh --apiserver-endpoint '<CLUSTER_ENDPOINT>' --b64-cluster-ca '<CLUSTER_CA>' '<CLUSTER_NAME>' --kubelet-extra-args '--register-with-taints=dedicated=app:NoSchedule --node-labels=kube/nodetype=app'
@RoyLDD
RoyLDD / .json
Created December 15, 2019 15:04
Assume role trusted account AWS
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<AWS_ACCOUNT_1>:root"
},
"Action": "sts:AssumeRole",
"Condition": {}
@RoyLDD
RoyLDD / .tf
Last active December 15, 2019 14:39
Assume role terraform
# AWS provider
provider "aws" {
version = "~> 2.0"
region = "<AWS_REGION>"
}
# Assume role policy
resource "aws_iam_policy" "assume-role-<ROLE_NAME>" {
name = "Assume-Role-<ROLE_NAME>"
description = "Allow assuming <ROLE_NAME> role on <AWS_ACCOUNT_2> account"
@RoyLDD
RoyLDD / .tf
Created December 15, 2019 14:22
terraform AWS assume role provider
#-- External provider -------------------------------------------------------
provider "aws" {
version = "~> 2.0"
region = "<AWS_REGION>"
assume_role {
role_arn = "${var.provider_env_roles[terraform.workspace]}"
}
}
#-- var.tf -------------------------------------------------------------------
@RoyLDD
RoyLDD / .sh
Created November 5, 2019 12:41
GitLab CI deploy helm runner
helm repo add gitlab https://charts.gitlab.io
helm install --namespace <NAMESPACE> --name gitlab-runner -f <PATH>/values.yaml gitlab/gitlab-runner
@RoyLDD
RoyLDD / .yaml
Last active November 5, 2019 12:42
Gitlab runner values.yaml
## GitLab Runner Image
## ref: https://hub.docker.com/r/gitlab/gitlab-runner/tags/
# image: gitlab/gitlab-runner:alpine-v11.6.0
## Specify a imagePullPolicy
imagePullPolicy: IfNotPresent
## The GitLab Server URL (with protocol) that want to register the runner against
gitlabUrl: https://<GITLAB_URL>
@RoyLDD
RoyLDD / .yaml
Last active November 5, 2019 12:45
GitLab-pipeline-deploy-example
# Deployment step
deploy:
stage: deploy
image: alpine/helm:latest
script:
- helm init --client-only
- helm --namespace $NAMESPACE upgrade -i $REPO_NAME --set image.tag=$TAG,env=$ENV,image.repository=$REPO_REGISTRY_URL $PATH_TO_VALUES
tags:
- k8s
- dev
@RoyLDD
RoyLDD / .yaml
Last active November 4, 2019 17:15
Gitlab-pipepline-example
# Pipeline steps list
stages:
- test
- build
- deploy
# Lint and unit tests
lint-test:
stage: test
image: