Skip to content

Instantly share code, notes, and snippets.

View nivogt's full-sized avatar

Nicolas Vogt nivogt

View GitHub Profile
---
apiVersion: apiextensions.crossplane.io/v1
kind: CompositeResourceDefinition
metadata:
name: eksclusters.eks.sarathy.io
spec:
group: eks.sarathy.io
names:
kind: EKSCluster
plural: eksclusters
@nivogt
nivogt / eks.yaml
Last active February 10, 2022 08:01
- name: eks-nodegroup
base:
apiVersion: eks.aws.crossplane.io/v1alpha1
kind: NodeGroup
spec:
forProvider:
instanceTypes:
- t2.medium
scalingConfig:
minSize: 1
---
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: amazon-eks-cluster
labels:
provider: aws
service: eks
compute: managed
spec:
apiVersion: meta.pkg.crossplane.io/v1
kind: Configuration
metadata:
name: eks-cluster-composition
annotations:
provider: aws
spec:
crossplane:
version: ">=v1.0.0"
dependsOn:
# personal helm repository
apiVersion: v1
kind: Secret
metadata:
name: nvogt-helm
namespace: argocd
labels:
argocd.argoproj.io/secret-type: repository
stringData:
url: https://nivogt.github.io/ghostblog/
#
# Helm Repositories
# Non standard Helm Chart repositories have to be registered
# Each repository must have 'url', 'type' and 'name' fields
#
---
apiVersion: v1
kind: Secret
metadata:
name: prometheus-helm-repo
---
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cm
namespace: argocd
labels:
app.kubernetes.io/name: argocd-cm
app.kubernetes.io/part-of: argocd
data:
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-ssh-known-hosts-cm
namespace: argocd
labels:
app.kubernetes.io/name: argocd-cm
app.kubernetes.io/part-of: argocd
data:
ssh_known_hosts: |
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: cicd-spot
region: my_region
managedNodeGroups:
- name: spot-ng-1
instanceTypes: [ "t2.medium", "t3.medium" ]
@nivogt
nivogt / Gen-policy.sh
Last active January 3, 2022 09:44
Generate iam permission from terraform trace
#!/bin/bash
INPUT_FILE=*.log
OUTPUT_FILE=policy.json
# get statements
# group all permissions by group into one statement block
# eg. ec2:CreateInstance and ec2:DeleteInstance will be in the same statement
STATEMENTS=$(grep "DEBUG: Request" $INPUT_FILE |awk '{print $(NF-1)}' | awk -F "/" '{print $1}' | sort | uniq )
LAST_STATEMENT=$(echo $STATEMENTS | awk '{print $NF}')