Skip to content

Instantly share code, notes, and snippets.

View eugenestarchenko's full-sized avatar
🇺🇦
#StandWithUkraine

Eugene Starchenko eugenestarchenko

🇺🇦
#StandWithUkraine
View GitHub Profile
@eugenestarchenko
eugenestarchenko / aws-auth-cm.sh
Created April 12, 2022 19:04 — forked from pmatv/aws-auth-cm.sh
Map IAM group to EKS ConfigMap
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
IAM_GROUP=${1:-admins}
EKS_ROLE_ARN=${2:-arn:aws:iam::111122223333:role/eks-node-role}
RBAC_GROUP=${3:-system:masters}
@eugenestarchenko
eugenestarchenko / assume_role.py
Created December 7, 2021 00:33 — forked from DaisukeMiyamoto/assume_role.py
AWS Boto3 Assume Role example
import boto3
from boto3.session import Session
def assume_role(arn, session_name):
"""aws sts assume-role --role-arn arn:aws:iam::00000000000000:role/example-role --role-session-name example-role"""
client = boto3.client('sts')
account_id = client.get_caller_identity()["Account"]
print(account_id)
@eugenestarchenko
eugenestarchenko / sonar.md
Created September 28, 2021 12:06 — forked from sysboss/sonar.md
SonarQube on AWS EC2 - Installation and integration with Jenkins

This article will briefly describe how to install SonarQube as Docker container on Amazon EC2 and integrate it with Jenkins.

Create database instance and user

Go to RDS > Parameter Groups
Create a new Parameter Group with the following parameter:

max_allowed_packet = 268435456

We need to create a new RDS database for SonarQube (you may use an existing MySQL instance)

  1. Go to RDS Instances
@eugenestarchenko
eugenestarchenko / -setup-windows-wsl-devenv.md
Created May 3, 2021 14:35 — forked from leodutra/-setup-windows-wsl-devenv.md
Install and Setup Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

Setup Windows Subsystem 2 for Linux

Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

To setup native Linux, see this gist

Preview

Requirements

#!/bin/bash
# install packages/dependencies for compilation
sudo yum -y install gcc make ncurses-devel
cd /tmp
# the latest version of ncdu is published here: http://dev.yorhel.nl/ncdu
# update the link below if necessary:
wget -nv http://dev.yorhel.nl/download/ncdu-1.10.tar.gz
@eugenestarchenko
eugenestarchenko / ThisisFine
Created December 29, 2020 20:33
ThisisFine
ThisisFine
@eugenestarchenko
eugenestarchenko / main.workflow
Created September 13, 2020 14:12 — forked from pahud/main.workflow
Github Actions with Amazon EKS CI/CD
workflow "Demo workflow" {
on = "push"
resolves = ["SNS Notification"]
}
action "Build Image" {
uses = "actions/docker/cli@c08a5fc9e0286844156fefff2c141072048141f6"
runs = ["/bin/sh", "-c", "docker build -t $IMAGE_URI ."]
env = {
IMAGE_URI = "xxxxxxxx.dkr.ecr.ap-northeast-1.amazonaws.com/github-action-demo:latest"
@eugenestarchenko
eugenestarchenko / Notes.txt
Created August 6, 2020 15:13 — forked from dijeesh/Notes.txt
EKS 1.16.8 Upgrade, kube-proxy:v1.16.8 errors
EKS clusters created from 1.12 onwards use a config file (by mounting a configmap called kube-proxy-config
If you are updating a cluster that was originally created on < 1.12, you will need to updated the kube-proxy configmaps and daemonsets.
1. Create kube-proxy-config configmap
kubectl -n kube-system apply -f kube-proxy-config.yaml
2. Update kube-proxy configmap, replace the server: with your API Server endpoint details and apply.
@eugenestarchenko
eugenestarchenko / drone-runner-kube-values.yaml
Created May 26, 2020 12:11 — forked from zgorizzo69/drone-runner-kube-values.yaml
drone server and drone runner for kubernetes chart values example for blog.cogarius.com
image:
repository: drone/drone-runner-kube
tag: 1.0.0-beta.1
pullPolicy: IfNotPresent
## If you need to pull images from a private Docker image repository, pass in the name
## of a Kubernetes Secret that contains the needed secret. For more details, see:
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
imagePullSecrets: []
@eugenestarchenko
eugenestarchenko / console.py
Created March 17, 2020 18:44 — forked from weavenet/console.py
Python script to assume STS role and generate AWS console URL.
#!/usr/bin/env python
import getpass
import json
import requests
import sys
import urllib
import boto3