Skip to content

Instantly share code, notes, and snippets.

View josephphyo's full-sized avatar
🏖️

Phyo Min Htun (Joseph) josephphyo

🏖️
View GitHub Profile

IRSA in EKS within same and across AWS Accounts

This is a gist of examples also mentioned in the blog IAM Roles for Service Accounts (IRSA) in AWS EKS within and cross AWS Accounts. Prerequisite for this gist is to create the EKS Cluster as explained in my earlier blog Create Amazon EKS Cluster within its VPC using Terraform, OR you can use this github repository.

Running Example for IRSA within same account

Assuming you have the EKS Cluster running and your AWS CLI is configured to talk to the AWS Account where your EKS Cluster is running. If not please follow the our earlier blog on How to create an EKS Cluster using Terraform

@josephphyo
josephphyo / sshd config
Last active December 29, 2021 14:24
Jump Private Server Via Bastion Host Single Hop (Linux or Mac Host)
<< Add Config to sshd config - ~/.ssh/config >>
# vim ~/.ssh/config
=====================================
### Bastion Host Jump Config
## Private Server
Host private-server-1
HostName 192.168.1.2
User ubuntu
IdentityFile /path/private_key.pem
@josephphyo
josephphyo / perChecker.py
Created May 4, 2021 18:07
Stack Exercise - Python
## (5+6)*(7+8)/(4+3) #Checking Bracket with Stack
## from stack (FileName) (stack.py) import Stack (class)
from stack import Stack
def perChecker(symbolString):
s = Stack()
balanced = True
index = 0
while index < len(symbolString) and balanced:
symbol = symbolString[index]
@josephphyo
josephphyo / calculator-class.py
Last active May 2, 2021 05:38
Python Function Return Test
class calculator:
number1 = 0
number2 = 0
def __init__(self,num1 = int(input("Please Enter First Number --> ")),num2 = int(input("Please Enter Second Number2 -> "))):
self.number1 = num1
self.number2 = num2
def add(self):
result = self.number1 + self.number2
return result
def minus(self):
### Keybase proof
I hereby claim:
* I am josephphyo on github.
* I am josephphyo (https://keybase.io/josephphyo) on keybase.
* I have a public key ASCijTZVv2XC2thG4D96eFe9c7-YzJkdsbd76JOl1peSogo
To claim this, I am signing this object:
@josephphyo
josephphyo / README.md
Created December 22, 2020 17:51 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@josephphyo
josephphyo / .bashrc
Created April 22, 2020 12:15 — forked from vsouza/.bashrc
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@josephphyo
josephphyo / Cost Optimization Pillar
Last active April 12, 2020 09:14
The 5 Pillars of the AWS Well-Architected Framework
1. Cost Effective Resource selection
2. Match Supply and demand
3. Awareness of spend
4. Optimize
<< Cost Effective Resource Selection >>
Provision to current needs with an eye to future.
Right Sizing.
Use data to choose purchase option. (on-demand or spot)
Optimize by Regions, AZ and Edge (global infrastructure)
@josephphyo
josephphyo / create-kube-user.sh
Created March 1, 2020 17:46 — forked from henning/create-kube-user.sh
create k8s user, certificate, permissions and client config
#!/bin/bash
CLUSTERNAME=mycluster.mydomain
NAMESPACE=default
USERNAME=myclusteruser
GROUPNAME=mygroup
openssl genrsa -out ${USERNAME}.key 2048
CSR_FILE=$USERNAME.csr
@josephphyo
josephphyo / Managing User Accounts on Linux Instance
Created November 30, 2019 15:45
Managing User Accounts on Linux Instance - https://amzn.to/34AAx6x
1.Creating a User Account
#useradd user1
2.Add the SSH public key to the user account. First create a directory in the user's home directory for the SSH key file, then create the key file, and finally paste the public key into the key file.
#cd /home/user1
#mkdir .ssh
#cd .ssh
#vim authorized_keys (Paste user public key in this file)
3.Setup permission