Skip to content

Commit

Permalink
Implements an informer for metrics-api types
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vladimirvivien committed Apr 10, 2023
1 parent 756414a commit cb3a80f
Show file tree
Hide file tree
Showing 15 changed files with 686 additions and 66 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@master
uses: actions/setup-go@v4
with:
go-version: 1.20
go-version: 'stable'
- name: Binary release
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.RELEASER_SECRET }}
- name: Update new version in krew-index
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ brew install ktop
The binary is relased as an OCI container at `ghcr.io/vladimirvivien/ktop`.
If you have a container runtime installed (Docker for instance), you launch ktop as shown below:

``
```
export KUBECONFIG=/home/user/.kube/config
docker run --network=host --rm --platform="linux/arm64" -it -v $KUBECONFIG:/config -e KUBECONFIG=/config -e TERM=xterm-256color ghcr.io/vladimirvivien/ktop:latest
```
Expand Down
135 changes: 135 additions & 0 deletions hack/kwok/kwok-deployments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: fake-web-1
namespace: default
spec:
replicas: 100
selector:
matchLabels:
app: fake-web-1
template:
metadata:
labels:
app: fake-web-1
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- kwok
# A taints was added to an automatically created Node.
# You can remove taints of Node or add this tolerations.
tolerations:
- key: "kwok.x-k8s.io/node"
operator: "Exists"
effect: "NoSchedule"
containers:
- name: fake-container
image: fake-image
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: fake-web-2
namespace: default
spec:
replicas: 50
selector:
matchLabels:
app: fake-web-2
template:
metadata:
labels:
app: fake-web-2
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- kwok
# A taints was added to an automatically created Node.
# You can remove taints of Node or add this tolerations.
tolerations:
- key: "kwok.x-k8s.io/node"
operator: "Exists"
effect: "NoSchedule"
containers:
- name: fake-container
image: fake-image
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: fake-backend-1
namespace: default
spec:
replicas: 25
selector:
matchLabels:
app: fake-backend-1
template:
metadata:
labels:
app: fake-backend-1
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- kwok
# A taints was added to an automatically created Node.
# You can remove taints of Node or add this tolerations.
tolerations:
- key: "kwok.x-k8s.io/node"
operator: "Exists"
effect: "NoSchedule"
containers:
- name: fake-container
image: fake-image
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: fake-backend-2
namespace: default
spec:
replicas: 10
selector:
matchLabels:
app: fake-backend-2
template:
metadata:
labels:
app: fake-backend-2
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: In
values:
- kwok
# A taints was added to an automatically created Node.
# You can remove taints of Node or add this tolerations.
tolerations:
- key: "kwok.x-k8s.io/node"
operator: "Exists"
effect: "NoSchedule"
containers:
- name: fake-container
image: fake-image
Loading

0 comments on commit cb3a80f

Please sign in to comment.