This file contains 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
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: pv-mounter | |
spec: | |
selector: | |
matchLabels: | |
app: pv-mounter | |
template: |
This file contains 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
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: s3-copy | |
--- | |
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: s3-copy-bucket-a | |
namespace: s3-copy |
This file contains 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
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: s3-copy | |
--- | |
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: s3-bucket-a-sync | |
namespace: s3-copy |
This file contains 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
#!/bin/bash | |
# this script will allow you to append policy within a bucket | |
# you need to install jq awscli to use this script | |
[ $# != 1 ] && { echo "Usage: $0 \"bucket_name\""; exit 1; } | |
bucket="$1" | |
json_to_add="{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::ACCOUNT-B:user/s3-cross-account\"},\"Action\":[\"s3:ListBucket\",\"s3:GetObject\"],\"Resource\":[\"arn:aws:s3:::${bucket}\",\"arn:aws:s3:::${bucket}/*\"]}" | |
# get bucket policy | |
aws s3api get-bucket-policy --bucket ${bucket} --query Policy --output text > policy-${bucket}.json |
This file contains 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": [ | |
{ | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "arn:aws:iam::Account-B:user/s3-cross-account" | |
}, | |
"Action": [ | |
"s3:GetObject", |
This file contains 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": [ | |
{ | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "arn:aws:iam::ACCOUNT_B:user/s3-cross-account" | |
}, | |
"Action": [ | |
"s3:ListBucket", |
This file contains 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": "ReadBucketA", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListBucket", | |
"s3:GetObject" | |
], |
This file contains 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
job: | |
parallel: 50 | |
image: alpine:latest | |
script: | |
- echo "hello my friend" | |
- sleep 60 | |
tags: | |
- k8s,ops |
This file contains 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
... | |
hpa: | |
minReplicas: 1 | |
maxReplicas: 10 | |
metrics: | |
- type: External | |
external: | |
metricName: gitlab_runner_jobs_builds_concurrent_saturation | |
targetAverageValue: 0.4 |
This file contains 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
$ kubectl get --raw "/apis/external.metrics.k8s.io/v1beta1" | jq . | |
{ | |
"kind": "APIResourceList", | |
"apiVersion": "v1", | |
"groupVersion": "external.metrics.k8s.io/v1beta1", | |
"resources": [ | |
{ | |
"name": "gitlab_runner_jobs_builds_concurrent_saturation", | |
"singularName": "", | |
"namespaced": true, |
NewerOlder