Skip to content

Commit cf44c9b

Browse files
committed
fix: upgrade K8s client library to add Keep Alive to watches
This has been an outstanding issue for over a month, especially prevalent in AKS. After some inactivity in the cluster, the persistent connection to the K8s API server got interrupted and was never able to recover. This new fix in the K8s client library puts a 30s keep alive to the Watch connection so that it does not get interrupted.
1 parent 935b434 commit cf44c9b

File tree

3 files changed

+113
-36
lines changed

3 files changed

+113
-36
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ RUN chmod 755 /usr/bin/dumb-init
3434
RUN groupadd -g 10001 snyk
3535
RUN useradd -g snyk -d /srv/app -u 10001 snyk
3636

37+
# @kubernetes/[email protected] started using net-keepalive, which requires the following packages to build modules
38+
RUN yum --disableplugin=subscription-manager install -y make gcc gcc-c++
39+
3740
WORKDIR /srv/app
3841

3942
COPY --chown=snyk:snyk --from=skopeo-build /usr/bin/skopeo /usr/bin/skopeo
@@ -50,6 +53,8 @@ RUN mkdir -p .config
5053

5154
RUN npm install
5255

56+
RUN yum remove -y make gcc gcc-c++
57+
5358
# add the rest of the app files
5459
ADD --chown=snyk:snyk . .
5560

package-lock.json

Lines changed: 107 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"lint": "eslint \"src/**/*.ts\" && (cd test && eslint \"**/*.ts\")"
3434
},
3535
"dependencies": {
36-
"@kubernetes/client-node": "^0.14.0",
36+
"@kubernetes/client-node": "^0.14.2",
3737
"@snyk/dep-graph": "^1.28.0",
3838
"async": "^3.2.0",
3939
"aws-sdk": "^2.867.0",

0 commit comments

Comments
 (0)