-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add skaffold to tighten local development loop
- Loading branch information
1 parent
2c56e59
commit deb5583
Showing
8 changed files
with
101 additions
and
10 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/.github/ | ||
/charts/ | ||
/tests/ | ||
/.gitignore | ||
/LICENSE | ||
/README.md | ||
/.python-version | ||
/pyproject.toml | ||
/requirements.lock | ||
/requirements-dev.lock | ||
/skaffold.yaml | ||
|
||
/target/ | ||
/.venv/ | ||
|
||
/.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM rust:1.79-slim-bookworm AS cache | ||
|
||
# prepare git cli | ||
RUN apt-get update && apt-get install -y git | ||
|
||
# create /src dir | ||
RUN mkdir /src | ||
WORKDIR /src | ||
|
||
# warm-up dependencies build cache | ||
COPY ./Cargo.* /src/ | ||
COPY build.rs /src/ | ||
RUN mkdir src && \ | ||
echo 'fn main() { println!("Hello, world!"); }' > src/main.rs && \ | ||
cargo build && \ | ||
rm -rf src | ||
|
||
FROM cache AS build | ||
|
||
COPY . /src/ | ||
RUN cargo build | ||
|
||
FROM debian:bookworm-slim | ||
WORKDIR /app | ||
COPY --from=build /src/target/debug/pod-graceful-drain /app/pod-graceful-drain | ||
ENTRYPOINT ["/app/pod-graceful-drain"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/.git/ | ||
/.github/ | ||
/charts/ | ||
/tests/ | ||
/.gitignore | ||
/LICENSE | ||
/README.md | ||
/.python-version | ||
/pyproject.toml | ||
/requirements.lock | ||
/requirements-dev.lock | ||
/skaffold.yaml | ||
|
||
/.venv/ | ||
/target/ | ||
|
||
/.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# skaffold is just to help tighten the local development/test loop | ||
apiVersion: skaffold/v4beta11 | ||
kind: Config | ||
metadata: | ||
name: pod-graceful-drain | ||
build: | ||
artifacts: | ||
- image: ghcr.io/foriequal0/pod-graceful-drain | ||
docker: | ||
dockerfile: docker/skaffold.Dockerfile | ||
context: . | ||
local: | ||
push: false | ||
useBuildkit: true | ||
concurrency: 0 | ||
deploy: | ||
helm: | ||
releases: | ||
- name: pod-graceful-drain | ||
chartPath: charts/pod-graceful-drain | ||
valuesFiles: | ||
- charts/pod-graceful-drain/values.yaml | ||
setValues: | ||
experimentalGeneralIngress: true | ||
# Skaffold sends this parameter to Helm as a command line parameter | ||
# '--set=logLevel=info,pod_graceful_drain=trace'. If we omit the backslash, | ||
# Helm interprets a comma in the parameter as a delimiter for key=value pair, | ||
# and it tries to set non-existent 'pod_graceful_drain' value to 'trace'. | ||
# This escaping backslash is why I RIIR'd everything. | ||
# Whenever I see Google-related products, I see this kind of practice. | ||
# They implement some features in seemingly-unharmful broken ways because it is quick and simple. | ||
# When they find features are broken, they don't fix it for compatibility reasons. | ||
# Instead, they cover them up with still-broken ad-hoc mechanisms in obscure, undocumented ways. | ||
# And they leak throughout their entire layers of abstractions like this. | ||
logLevel: "info\\,pod_graceful_drain=trace" |