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)
- Error message not clear HOT 2
- govulncheck mirror HOT 1
- Go 1.22 support HOT 2
- Coupling of CloudRuntime (ATHENS_CLOUD_RUNTIME) config var with log formatting is unexpected HOT 2
- Remove Circle CI HOT 1
- Duplicate HTTP `Content-Type` header HOT 2
- support the git-credential-manager HOT 2
- Use AWS SDK v2 for Go HOT 7
- Serve a SumDB
- Add a splash page
- make test-e2e-docker fails
- Use $VERSION.zip instead of source.zip
- Migrate off of debian container image
- Retheme the docs site
- Improve the readme
- Introduction pages are broken
- List doesn't redirect
- Athens is creating unsigned requests to S3 buckets causing 403 errors HOT 4
- Make Stash timeout configurable
- Github token to access private github repos is not working HOT 5
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.