Skip to content

Commit cb3a80f

Browse files
Implements an informer for metrics-api types
This patch is for improving scalability of metrics data. It does that by implementing an informer/lister for the metrics-api data. This change will cache metrics data and avoid retrieving metrics data with directly from the api-server, with each update. Other addition includes - Files for scale testing with project KWOK
1 parent 756414a commit cb3a80f

File tree

15 files changed

+686
-66
lines changed

15 files changed

+686
-66
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@master
14+
uses: actions/checkout@v3
1515
- name: Set up Go
16-
uses: actions/setup-go@master
16+
uses: actions/setup-go@v4
1717
with:
18-
go-version: 1.20
18+
go-version: 'stable'
1919
- name: Binary release
20-
uses: goreleaser/goreleaser-action@v2
20+
uses: goreleaser/goreleaser-action@v4
2121
with:
2222
version: latest
23-
args: release --rm-dist
23+
args: release --clean
2424
env:
2525
GITHUB_TOKEN: ${{ secrets.RELEASER_SECRET }}
2626
- name: Update new version in krew-index

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ brew install ktop
4545
The binary is relased as an OCI container at `ghcr.io/vladimirvivien/ktop`.
4646
If you have a container runtime installed (Docker for instance), you launch ktop as shown below:
4747

48-
``
48+
```
4949
export KUBECONFIG=/home/user/.kube/config
5050
docker run --network=host --rm --platform="linux/arm64" -it -v $KUBECONFIG:/config -e KUBECONFIG=/config -e TERM=xterm-256color ghcr.io/vladimirvivien/ktop:latest
5151
```

hack/kwok/kwok-deployments.yaml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: fake-web-1
5+
namespace: default
6+
spec:
7+
replicas: 100
8+
selector:
9+
matchLabels:
10+
app: fake-web-1
11+
template:
12+
metadata:
13+
labels:
14+
app: fake-web-1
15+
spec:
16+
affinity:
17+
nodeAffinity:
18+
requiredDuringSchedulingIgnoredDuringExecution:
19+
nodeSelectorTerms:
20+
- matchExpressions:
21+
- key: type
22+
operator: In
23+
values:
24+
- kwok
25+
# A taints was added to an automatically created Node.
26+
# You can remove taints of Node or add this tolerations.
27+
tolerations:
28+
- key: "kwok.x-k8s.io/node"
29+
operator: "Exists"
30+
effect: "NoSchedule"
31+
containers:
32+
- name: fake-container
33+
image: fake-image
34+
---
35+
apiVersion: apps/v1
36+
kind: Deployment
37+
metadata:
38+
name: fake-web-2
39+
namespace: default
40+
spec:
41+
replicas: 50
42+
selector:
43+
matchLabels:
44+
app: fake-web-2
45+
template:
46+
metadata:
47+
labels:
48+
app: fake-web-2
49+
spec:
50+
affinity:
51+
nodeAffinity:
52+
requiredDuringSchedulingIgnoredDuringExecution:
53+
nodeSelectorTerms:
54+
- matchExpressions:
55+
- key: type
56+
operator: In
57+
values:
58+
- kwok
59+
# A taints was added to an automatically created Node.
60+
# You can remove taints of Node or add this tolerations.
61+
tolerations:
62+
- key: "kwok.x-k8s.io/node"
63+
operator: "Exists"
64+
effect: "NoSchedule"
65+
containers:
66+
- name: fake-container
67+
image: fake-image
68+
---
69+
apiVersion: apps/v1
70+
kind: Deployment
71+
metadata:
72+
name: fake-backend-1
73+
namespace: default
74+
spec:
75+
replicas: 25
76+
selector:
77+
matchLabels:
78+
app: fake-backend-1
79+
template:
80+
metadata:
81+
labels:
82+
app: fake-backend-1
83+
spec:
84+
affinity:
85+
nodeAffinity:
86+
requiredDuringSchedulingIgnoredDuringExecution:
87+
nodeSelectorTerms:
88+
- matchExpressions:
89+
- key: type
90+
operator: In
91+
values:
92+
- kwok
93+
# A taints was added to an automatically created Node.
94+
# You can remove taints of Node or add this tolerations.
95+
tolerations:
96+
- key: "kwok.x-k8s.io/node"
97+
operator: "Exists"
98+
effect: "NoSchedule"
99+
containers:
100+
- name: fake-container
101+
image: fake-image
102+
---
103+
apiVersion: apps/v1
104+
kind: Deployment
105+
metadata:
106+
name: fake-backend-2
107+
namespace: default
108+
spec:
109+
replicas: 10
110+
selector:
111+
matchLabels:
112+
app: fake-backend-2
113+
template:
114+
metadata:
115+
labels:
116+
app: fake-backend-2
117+
spec:
118+
affinity:
119+
nodeAffinity:
120+
requiredDuringSchedulingIgnoredDuringExecution:
121+
nodeSelectorTerms:
122+
- matchExpressions:
123+
- key: type
124+
operator: In
125+
values:
126+
- kwok
127+
# A taints was added to an automatically created Node.
128+
# You can remove taints of Node or add this tolerations.
129+
tolerations:
130+
- key: "kwok.x-k8s.io/node"
131+
operator: "Exists"
132+
effect: "NoSchedule"
133+
containers:
134+
- name: fake-container
135+
image: fake-image

0 commit comments

Comments
 (0)