Skip to content

Commit f009203

Browse files
committed
rebase
2 parents 73e5e5e + 2689526 commit f009203

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+686
-20
lines changed

.github/workflows/build.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build and test operator images on push to every branch except main and pull requests
2+
on:
3+
pull_request:
4+
branches: [main]
5+
push:
6+
branches-ignore: [main]
7+
workflow_dispatch: {}
8+
jobs:
9+
build-test-operator:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/cache@v4
14+
with:
15+
path: |
16+
~/.cache/go-build
17+
~/go/pkg/mod
18+
~/go/bin/
19+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
20+
restore-keys: |
21+
${{ runner.os }}-go-
22+
- uses: actions/setup-go@v2
23+
with:
24+
go-version: "1.17.1"
25+
- name: Build & Test
26+
run: |
27+
echo "/usr/local/kubebuilder/bin" >> $GITHUB_PATH
28+
make toolchain build test
29+
working-directory: operator
30+
build-cli:
31+
strategy:
32+
matrix:
33+
os: ["darwin", "linux"]
34+
arch: ["amd64"]
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: actions/cache@v4
39+
with:
40+
path: |
41+
~/.cache/go-build
42+
~/go/pkg/mod
43+
~/go/bin/
44+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
45+
restore-keys: |
46+
${{ runner.os }}-go-
47+
- uses: actions/setup-go@v2
48+
with:
49+
go-version: "1.17.1"
50+
- name: Build the KIT CLI
51+
run: |
52+
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o ./bin/kitctl ./cmd/kitctl/
53+
working-directory: substrate
54+

.github/workflows/image.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build the operator image and push to public ECR on the main branch
2+
on:
3+
push:
4+
branches: [main]
5+
workflow_dispatch: {}
6+
jobs:
7+
build-push-docker-image:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/cache@v4
12+
with:
13+
path: |
14+
~/.cache/go-build
15+
~/go/pkg/mod
16+
~/go/bin/
17+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
18+
restore-keys: |
19+
${{ runner.os }}-go-
20+
- uses: actions/setup-go@v2
21+
with:
22+
go-version: "1.17.1"
23+
- name: Build & Test
24+
run: |
25+
echo "/usr/local/kubebuilder/bin" >> $GITHUB_PATH
26+
make toolchain build test
27+
working-directory: operator
28+
- uses: docker/login-action@v1
29+
with:
30+
registry: public.ecr.aws
31+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
32+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
33+
env:
34+
AWS_REGION: us-east-1
35+
- name: Install KO binary
36+
run: |
37+
VERSION=0.8.3
38+
OS=Linux
39+
ARCH=x86_64
40+
curl -L https://github.com/google/ko/releases/download/v${VERSION}/ko_${VERSION}_${OS}_${ARCH}.tar.gz | tar xzf - ko
41+
chmod +x ./ko
42+
mv ko ~/go/bin/
43+
- name: Push to ECR public
44+
run: |
45+
KO_DOCKER_REPO=public.ecr.aws/i7d3g4r4/kit-operator ko publish --bare ./cmd/controller
46+
working-directory: operator

.github/workflows/release.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Release operator version, generates a new Docker image and helm charts
2+
on:
3+
push:
4+
tags: ["v*"]
5+
workflow_dispatch: {}
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-go@v3
12+
with:
13+
go-version: "1.17.1"
14+
- uses: actions/cache@v4
15+
with:
16+
path: |
17+
~/.cache/go-build
18+
~/go/pkg/mod
19+
~/go/bin/
20+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
21+
restore-keys: |
22+
${{ runner.os }}-go-
23+
- uses: docker/login-action@v1
24+
with:
25+
registry: public.ecr.aws
26+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
27+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28+
env:
29+
AWS_REGION: us-east-1
30+
- name: Install KO binary
31+
run: |
32+
VERSION=0.8.3
33+
OS=Linux
34+
ARCH=x86_64
35+
curl -L https://github.com/google/ko/releases/download/v${VERSION}/ko_${VERSION}_${OS}_${ARCH}.tar.gz | tar xzf - ko
36+
chmod +x ./ko
37+
mv ko /usr/local/bin/
38+
- name: Push to ECR public
39+
run: |
40+
make publish
41+
working-directory: operator
42+
- run: |
43+
git config user.name "$GITHUB_ACTOR"
44+
git config user.email "[email protected]"
45+
- uses: helm/[email protected]
46+
with:
47+
charts_dir: operator/charts
48+
env:
49+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
50+
51+
release-cli:
52+
strategy:
53+
matrix:
54+
os: ["darwin"]
55+
arch: ["amd64"]
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v2
59+
- uses: actions/cache@v4
60+
with:
61+
path: |
62+
~/.cache/go-build
63+
~/go/pkg/mod
64+
~/go/bin/
65+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
66+
restore-keys: |
67+
${{ runner.os }}-go-
68+
- name: Set env
69+
run: |
70+
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
71+
- uses: actions/setup-go@v3
72+
with:
73+
go-version: "1.17.1"
74+
- name: Build the KIT CLI
75+
run: |
76+
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o ./bin/kitctl ./cmd/kitctl/
77+
zip ./bin/kitctl_${{ env.RELEASE_VERSION }}_${{ matrix.os }}_${{ matrix.arch }}.zip -j ./bin/kitctl
78+
working-directory: substrate
79+
- name: Attach the binary to release
80+
uses: softprops/action-gh-release@v1
81+
with:
82+
files: "./substrate/bin/kitctl_${{ env.RELEASE_VERSION }}_${{ matrix.os }}_${{ matrix.arch }}.zip"
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
- name: Update brew formulae
86+
uses: mislav/bump-homebrew-formula-action@v1
87+
with:
88+
formula-name: kitctl
89+
formula-path: kitctl.rb
90+
homebrew-tap: awslabs/kubernetes-iteration-toolkit
91+
base-branch: main
92+
download-url: https://github.com/awslabs/kubernetes-iteration-toolkit/releases/download/${{ env.RELEASE_VERSION }}/kitctl_${{ env.RELEASE_VERSION }}_${{ matrix.os }}_${{ matrix.arch }}.zip
93+
commit-message: |
94+
Update kitctl to ${{ env.RELEASE_VERSION }}
95+
Created by Github actions during Release CLI action
96+
env:
97+
COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{{$namespacePrefix := DefaultParam .CL2_NAMESPACE_PREFIX "default"}}
2+
{{$namespaceCount := DefaultParam .CL2_NAMESPACE_COUNT 1}}
3+
{{$totalEksPodIdentityPods := DefaultParam .CL2_EKS_POD_IDENTITY_PODS 5000}}
4+
{{$timeoutEksPodIdentityPodCreation := DefaultParam .CL2_TIMEOUT_EKS_POD_IDENTITY_POD_CREATION "5m"}}
5+
{{$defaultQps := DefaultParam .CL2_DEFAULT_QPS 500}}
6+
{{$defaultBurst := DefaultParam .CL2_DEFAULT_BURST 1000}}
7+
{{$uniformQps := DefaultParam .CL2_UNIFORM_QPS 500}}
8+
9+
{{$SCHEDULER_THROUGHPUT_THRESHOLD := DefaultParam .CL2_SCHEDULER_THROUGHPUT_THRESHOLD 100}}
10+
11+
name: eks-pod-identity
12+
tuningSets:
13+
# default is a tuningset that is meant to be used when we don't have any specific requirements on pace of operations.
14+
- name: default
15+
globalQPSLoad:
16+
qps: {{$defaultQps}}
17+
burst: {{$defaultBurst}}
18+
- name: UniformQPS
19+
qpsLoad:
20+
qps: {{$uniformQps}}
21+
steps:
22+
- name: Creating eks pod identity measurements
23+
measurements:
24+
- Identifier: EksPodIdentityPodStartupLatency
25+
Method: PodStartupLatency
26+
Params:
27+
action: start
28+
labelSelector: group = eks-pod-identity
29+
threshold: 300s
30+
- Identifier: EksPodIdentity
31+
# TODO: Move to SchedulingThroughputPrometheus which requires cl2 prom stack setup as pre-req
32+
Method: SchedulingThroughput
33+
Params:
34+
action: start
35+
labelSelector: group = eks-pod-identity
36+
measurmentInterval: 1s
37+
# a pod identity association with (namespace: default, sa: default) is created as prerequisite
38+
- name: create eks pod identity pods
39+
phases:
40+
- namespaceRange:
41+
min: 1
42+
max: {{$namespaceCount}}
43+
baseName: {{$namespacePrefix}}
44+
replicasPerNamespace: {{$totalEksPodIdentityPods}}
45+
tuningSet: UniformQPS
46+
objectBundle:
47+
- basename: eks-pod-identity
48+
objectTemplatePath: pod-default.yaml
49+
templateFillMap:
50+
Group: eks-pod-identity
51+
- name: Waiting for eks pod identity pods to be created
52+
measurements:
53+
- Identifier: WaitForEksPodIdentityPods
54+
Method: WaitForRunningPods
55+
Params:
56+
action: gather
57+
timeout: {{$timeoutEksPodIdentityPodCreation}}
58+
desiredPodCount: {{$totalEksPodIdentityPods}}
59+
labelSelector: group = eks-pod-identity
60+
- name: Collecting eks pod identity measurements
61+
measurements:
62+
- Identifier: EksPodIdentityPodStartupLatency
63+
Method: PodStartupLatency
64+
Params:
65+
action: gather
66+
- Identifier: EksPodIdentity
67+
Method: SchedulingThroughput
68+
Params:
69+
action: gather
70+
enableViolations: true
71+
threshold: {{$SCHEDULER_THROUGHPUT_THRESHOLD}}
72+
- name: Delete eks pod identity pods
73+
phases:
74+
- namespaceRange:
75+
min: 1
76+
max: {{$namespaceCount}}
77+
baseName: {{$namespacePrefix}}
78+
replicasPerNamespace: 0
79+
tuningSet: default
80+
objectBundle:
81+
- basename: eks-pod-identity
82+
objectTemplatePath: pod-default.yaml
83+
templateFillMap:
84+
Group: eks-pod-identity
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"Version": "2012-10-17",
3+
"Statement": [
4+
{
5+
"Effect": "Allow",
6+
"Principal": {
7+
"Service": "beta.pods.eks.aws.internal"
8+
},
9+
"Action": [
10+
"sts:AssumeRole",
11+
"sts:TagSession"
12+
]
13+
}
14+
]
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
generateName: eks-pod-identity-pod-churn-
5+
labels:
6+
group: {{.Group}}
7+
spec:
8+
containers:
9+
- image: registry.k8s.io/pause:3.9
10+
name: pause
11+
initContainers:
12+
- name: app-init
13+
image: amazon/aws-cli:latest
14+
command: ["/bin/sh"]
15+
args: ["-c", "aws sts get-caller-identity"]
File renamed without changes.
File renamed without changes.

tests/pipelines/cleanup/cleanup-template.yaml renamed to tests/tekton-resources/pipelines/cleanup/cleanup-template.yaml

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)