export ROLEARN="arn:aws:iam::<aws_account_number>:role/<role_name>"
export SESSION_NAME=mysession
ASSUME_ROLE=$(aws sts assume-role \
--role-arn "$ROLEARN" \
--role-session-name "$SESSION_NAME")
export AWS_ACCESS_KEY_ID=$(echo $ASSUME_ROLE | jq -r .Credentials.AccessKeyId)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Name: k8s_manager.fish | |
| # Description: Colorized Context Manager for the 'bobthefish' theme. | |
| # Features: fzf switcher, environment-aware coloring, and a toggle. | |
| # Installation: Place in ~/.config/fish/conf.d/k8s_manager.fish | |
| # see https://ismailyenigul.medium.com/toggling-kubernetes-context-in-fish-shell-2fb3b67040aa for details | |
| # 1. THEME PREFERENCES | |
| # ----------------------------------------------------------------------------- | |
| set -g theme_display_k8s_context yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "AWSLogDeliveryWrite", | |
| "Effect": "Allow", | |
| "Principal": { | |
| "Service": "delivery.logs.amazonaws.com" | |
| }, | |
| "Action": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #if you added new disk | |
| for host in $(ls -1d /sys/class/scsi_host/*); do echo "- - -" > ${host}/scan ; done | |
| #if you resized the existing disk | |
| for device in $(ls -1d /sys/class/scsi_disk/*); do echo "1" > ${device}/device/rescan ; done |
Sample values.yml for argocd-helm chart to create users and grant permissions.
config:
# Argo CD's externally facing base URL (optional). Required when configuring SSO
accounts.qauser: apiKey, login
accounts.devuser: apiKey, login
accounts.adminuser: apiKey, login
.....
rbacConfig:
I use aws-vault with Yubikey to access AWS resources.
Lens is great Desktop tool to see/manage all k8s resources.
The following commands help me to open Lens The Kubernetes IDE the right EKS cluster on MacOS
# aws-vault exec -d 12h --prompt ykman my-profile --
# aws eks update-kubeconfig --name my-eks-cluster #switch to the right cluster
# /Applications/Lens.app/Contents/MacOS/Lens
This gist contains sample policy I used in my article at https://ismailyenigul.medium.com/how-to-setup-multi-aws-accounts-assume-role-with-aws-cli-45ae869661ed
For admin access from security to other accounts. save as admin-external-accounts.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Action": [
"logs:List*",
pipeline {
agent any
environment {
AWS_REGION = 'eu-west-1'
GITCOMMIT="${env.GIT_COMMIT}"
}
// options {
I used the following code block to add Tags into Cloudformation yaml file.
%{~ if length(mytags) >0 ~}
Tags:
%{~ endif ~}
%{~ for tag_key, tag_value in mytags ~}
- Key: "${tag_key}"
Value: "${tag_value}"
%{~ endfor ~}
NewerOlder