Comments (4)
If a container crashes, the init container is not executed, so that won't work unfortunately.
Not sure if it makes sense to support this in the helm charts. Running athens using a socket requires some kind of proxy in front of it to be usable. And the helm charts doesn't support multiple containers in the deployment.
I have found a way to work around this issue by using abstract sockets. These sockets does not use the file system.
We build our custom athens docker image to install some required tooling, including curl
which makes it easier to implement the live and readiness probes:
FROM gomods/athens:v0.13.0
RUN wget -c "https://github.com/Avinode/git-credential-github-apps/releases/download/v1.2.0/git-credential-github-apps_1.2.0_${TARGETOS}_${TARGETARCH}.tar.gz" -O - \
| tar -xz -C /usr/local/bin/
RUN apk --no-cache add curl
USER athens
Then we run a deployment with two containers, where one of them is a reverse proxy.
containers:
- name: proxy
image: proxy-image
ports:
- name: http
containerPort: 8080
env:
- name: PORT
value: "8080"
- name: PROXY_URL
value: "unix://athens/@/var/run/athens/athens.sock"
- name: athens
image: custom-athens-docker-image
env:
- name: ATHENS_UNIX_SOCKET
value: "@/var/run/athens/athens.sock"
readinessProbe:
exec:
command:
- sh
- -c
- curl --fail --abstract-unix-socket $(echo "$ATHENS_UNIX_SOCKET" | cut -d @ -f 2) http://athens/healthz
initialDelaySeconds: 10
periodSeconds: 3
failureThreshold: 3
livenessProbe:
exec:
command:
- sh
- -c
- curl --fail --abstract-unix-socket $(echo "$ATHENS_UNIX_SOCKET" | cut -d @ -f 2) http://athens/healthz
initialDelaySeconds: 10
periodSeconds: 3
failureThreshold: 3
Thanks for the feedback @DrPsychick , appreciate it 👍
from athens.
Would this not better be suited to be solved in the k8s deployment (helm chart or so), because silently overwriting/deleting an existing socket - I don't know if that is the right approach. I would favour "fail early" and expose that the socket is already there, as it is.
from athens.
It's possible to implement some kind of workaround in k8s, but it's not straight forward.
We ran into this issue when athens was OOMKilled, and was unable to restart as the socket file was left behind.
I see your point of not silently deleting an existing socket file, my use case is probably a bit k8s specific.
Would it be an option to make it configurable (ATHENS_UNIX_SOCKET_DELETE_IF_EXISTS=true|false
)?
from athens.
Would an init container, "preparing the volume" not be sufficient for a k8s deployment? If you're using the official helm chart, I'd rather support custom init containers for that to solve this k8s specific issue.
https://github.com/gomods/athens-charts
from athens.
Related Issues (20)
- Problem with link in README.MD HOT 1
- Clarify expected behavior of /@latest endpoint in fallback NetworkMode HOT 1
- Add builds for ARM64 HOT 4
- Refresh TLS certificates automatically
- Don't check TLS key file permissions HOT 1
- verifying module: checksum mismatch but only with proxy HOT 1
- Datadog trace and stat exporters immediately stop
- Enforce timeout on vcsLister.List() HOT 1
- Athens leaks etcd leases HOT 7
- Athens should not check the status of all etcd endpoints on startup
- Replace logrus with log/slog HOT 1
- How do I scale the athens container for better performance? HOT 1
- server response: 404 page not found HOT 1
- Limiting the maximum disk usage HOT 6
- always verifying module HOT 2
- Using proxy socks5 HOT 3
- arm64 build of v0.13.0 can not work
- Error message not clear HOT 2
- govulncheck mirror HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from athens.