Skip to content

Commit 0f1761d

Browse files
committed
docs to english
1 parent e03b151 commit 0f1761d

9 files changed

Lines changed: 60 additions & 60 deletions

File tree

.github/workflows/build-and-push.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Build und Push des Images zu GHCR (nur von main).
2-
# Credentials: GITHUB_TOKEN wird von GitHub bereitgestellt.
1+
# Build and push images to GHCR (from main only).
2+
# Credentials: GITHUB_TOKEN is provided by GitHub.
33
#
4-
# Multi-Stage: Jede Stage (z. B. staging, production) bekommt ein eigenes
5-
# Image mit einer eigenen Kubeconfig. Die Secrets heißen:
4+
# Multi-Stage: Each stage (e.g. staging, production) gets its own
5+
# image with its own kubeconfig. The secrets are named:
66
# KUBECONFIG_B64_STAGING
77
# KUBECONFIG_B64_PRODUCTION
88
#
9-
# Tags pro Stage:
10-
# <stage> (auf main, entspricht latest)
11-
# <stage>-<sha> (immer)
9+
# Tags per stage:
10+
# <stage> (on main, equivalent to latest)
11+
# <stage>-<sha> (always)
1212
name: Build and push to GHCR
1313

1414
on:

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# dockerized-deployment: kubectl + helm, base64 kubeconfig, für GHA-Deployments
1+
# dockerized-deployment: kubectl + helm, base64 kubeconfig, for GHA deployments
22
FROM alpine:3.21
33

44
RUN apk add --no-cache \
@@ -18,14 +18,14 @@ RUN curl -sSL "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" \
1818
| tar -xz -C /usr/local/bin --strip-components=1 linux-amd64/helm \
1919
&& chmod +x /usr/local/bin/helm
2020

21-
# Kubeconfig zur Build-Zeit (Pipeline übergibt KUBECONFIG_B64); optional überschreibbar per Env zur Laufzeit
21+
# Kubeconfig at build time (pipeline passes KUBECONFIG_B64); optionally overridable via env at runtime
2222
ARG KUBECONFIG_B64
2323
RUN if [ -n "$KUBECONFIG_B64" ]; then \
2424
mkdir -p /opt/kubeconfig && \
2525
echo "$KUBECONFIG_B64" | base64 -d > /opt/kubeconfig/default && \
2626
chmod 600 /opt/kubeconfig/default; \
2727
fi
28-
# ENV sorgt dafür, dass kubectl auch bei überschriebenem Entrypoint (z. B. GHA container: jobs) die Kubeconfig nutzt
28+
# ENV ensures kubectl uses the kubeconfig even with overridden entrypoint (e.g. GHA container: jobs)
2929
ENV KUBECONFIG=/opt/kubeconfig/default
3030

3131
COPY entrypoint.sh /entrypoint.sh

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
# dockerized-deployment
22

3-
Docker-Image mit **kubectl** und **Helm** für CI/CD. Führt beliebige Skripte (z. B. Helm-Deployments) aus.
3+
Docker image with **kubectl** and **Helm** for CI/CD. Runs arbitrary scripts (e.g. Helm deployments).
44

55
## Image
66

7-
- **kubectl** und **Helm** (Alpine-basiert)
8-
- **Kubeconfig**: wird zur **Build-Zeit** in der Pipeline dieses Repos übergeben (Secret `KUBECONFIG_B64`) und als Default ins Image eingebacken. In einem Job kann man optional per Env **`KUBECONFIG_B64`** überschreiben; wenn nicht gesetzt, gilt immer die zur Build-Zeit eingebackene Kubeconfig.
7+
- **kubectl** and **Helm** (Alpine-based)
8+
- **Kubeconfig**: passed at **build time** via the pipeline of this repo (secret `KUBECONFIG_B64`) and baked into the image as default. In a job, you can optionally override it via env **`KUBECONFIG_B64`**; if not set, the kubeconfig baked in at build time is always used.
99

1010
## Build & Push
1111

12-
Bei Push auf `main` baut `.github/workflows/build-and-push.yml` pro Stage ein Image und pusht es nach **GHCR**. Die Stages sind als Matrix definiert (z. B. `staging`, `production`), jede mit einem eigenen Secret.
12+
On push to `main`, `.github/workflows/build-and-push.yml` builds an image per stage and pushes it to **GHCR**. Stages are defined as a matrix (e.g. `staging`, `production`), each with its own secret.
1313

14-
**In diesem Repository** müssen pro Stage Secrets gesetzt sein (base64-kodierte Kubeconfig):
14+
**In this repository**, secrets must be set per stage (base64-encoded kubeconfig):
1515

16-
| Stage | Secret | Image-Tag |
16+
| Stage | Secret | Image Tag |
1717
|---|---|---|
1818
| `staging` | `KUBECONFIG_B64_STAGING` | `ghcr.io/<owner>/dockerized-deployment:staging` |
1919
| `production` | `KUBECONFIG_B64_PRODUCTION` | `ghcr.io/<owner>/dockerized-deployment:production` |
2020

21-
Zum Anlegen eines Secrets von einer K3s-Instanz per SSH und `gh`:
21+
To create a secret from a K3s instance via SSH and `gh`:
2222

2323
```bash
2424
SECRET_NAME=KUBECONFIG_B64_STAGING ./scripts/set-kubeconfig-secret.sh
2525
```
2626

27-
Das Skript liest `/etc/rancher/k3s/k3s.yaml` vom SSH-Host, setzt die Server-URL auf `https://<host>:6443`, kodiert base64 und setzt das Secret per `gh secret set`. Optional: `SSH_HOST=myhost.example.com`, `SSH_USER=user`, `SECRET_NAME` oder `GITHUB_REPO=owner/repo` setzen.
27+
The script reads `/etc/rancher/k3s/k3s.yaml` from the SSH host, sets the server URL to `https://<host>:6443`, base64-encodes it, and sets the secret via `gh secret set`. Optional: set `SSH_HOST=myhost.example.com`, `SSH_USER=user`, `SECRET_NAME`, or `GITHUB_REPO=owner/repo`.
2828

29-
- Push-Credentials: `GITHUB_TOKEN`
29+
- Push credentials: `GITHUB_TOKEN`
3030

31-
## Nutzung in einer anderen GitHub Action (z. B. Deployment)
31+
## Usage in another GitHub Action (e.g. Deployment)
3232

33-
Image als Container nutzen; **Default-Kubeconfig** ist die beim Build eingebackene (pro Stage). Optional: mit `KUBECONFIG_B64` im Job eine andere Kubeconfig setzen.
33+
Use the image as a container; the **default kubeconfig** is the one baked in at build time (per stage). Optionally, set `KUBECONFIG_B64` in the job to use a different kubeconfig.
3434

35-
**Falls "Error response from daemon: denied" beim Pull:** Das andere Repo hat mit `GITHUB_TOKEN` standardmäßig kein Lese-Recht für dieses Package. Entweder:
35+
**If you get "Error response from daemon: denied" on pull:** The other repo does not have read access to this package by default with `GITHUB_TOKEN`. Either:
3636

37-
- **Package öffentlich machen:** Repo dockerized-deployment → rechte Seite **Packages**Package öffnen**Package settings****Change visibility****Public**. Dann braucht der Deploy-Job keine speziellen Rechte.
38-
- **Oder Zugriff erlauben:** Unter Package settings → Manage Actions access das Ziel-Repository mit **Read** hinzufügen.
37+
- **Make the package public:** Repo dockerized-deployment → right sidebar **Packages**open package**Package settings****Change visibility****Public**. Then the deploy job does not need special permissions.
38+
- **Or grant access:** Under [Package settings → Manage Actions access](https://github.com/orgs/project-construct-x/packages/container/dockerized-deployment/settings), add the target repository with **Read** permission.
3939

4040
```yaml
4141
jobs:
@@ -46,7 +46,7 @@ jobs:
4646
credentials:
4747
username: ${{ github.actor }}
4848
password: ${{ secrets.GITHUB_TOKEN }}
49-
# Optional: eigene Kubeconfig statt der eingebackenen
49+
# Optional: own kubeconfig instead of the baked-in one
5050
# env:
5151
# KUBECONFIG_B64: ${{ secrets.KUBECONFIG_B64 }}
5252
steps:
@@ -58,9 +58,9 @@ jobs:
5858
--set image.tag="${{ github.sha }}"
5959
```
6060
61-
Für Production einfach den Tag tauschen: `dockerized-deployment:production`.
61+
For production, simply swap the tag: `dockerized-deployment:production`.
6262

63-
Alternativ ohne `container:` – Image nur für einen Step:
63+
Alternatively, without `container:` – image only for a single step:
6464

6565
```yaml
6666
- name: Deploy with Helm
@@ -75,11 +75,11 @@ Alternativ ohne `container:` – Image nur für einen Step:
7575
'
7676
```
7777

78-
Empfohlen: Job mit `container:` (erstes Beispiel), dann läuft der ganze Job im Image und `run: |` ist das multiline Skript.
78+
Recommended: job with `container:` (first example), then the entire job runs inside the image and `run: |` is the multiline script.
7979

80-
## Lokal bauen & testen
80+
## Local Build & Test
8181

82-
Mit Kubeconfig zur Build-Zeit (Default im Image):
82+
With kubeconfig at build time (default in image):
8383

8484
```bash
8585
export KUBECONFIG_B64=$(cat ~/.kube/config | base64 -w0)
@@ -88,13 +88,13 @@ docker run --rm dockerized-deployment kubectl get nodes
8888
docker run --rm dockerized-deployment helm list -A
8989
```
9090

91-
Optional: zur Laufzeit andere Kubeconfig setzen:
91+
Optional: set a different kubeconfig at runtime:
9292

9393
```bash
9494
docker run --rm -e KUBECONFIG_B64="$OTHER_KUBECONFIG_B64" dockerized-deployment kubectl get nodes
9595
```
9696

97-
Multiline-Skript (mit Default-Kubeconfig):
97+
Multiline script (with default kubeconfig):
9898

9999
```bash
100100
docker run --rm dockerized-deployment sh -c '
@@ -111,4 +111,4 @@ This documentation is located in the `/docs` folder.
111111

112112
All code files are distributed under the Apache 2.0 license. See [LICENSE](./LICENSE) for more information.
113113

114-
All non-code files are distributed under the Creative Commons Attribution 4.0 International license. See [LICENSE_non-code](./LICENSE_non-code) for more information.
114+
All non-code files are distributed under the Creative Commons Attribution 4.0 International license. See [LICENSE_non_code](./LICENSE_non_code) for more information.

docs/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Documentation
22

3-
Dokumentation für das **dockerized-deployment** Docker-Image mit kubectl und Helm.
3+
Documentation for the **dockerized-deployment** Docker image with kubectl and Helm.
44

5-
## Inhaltsverzeichnis
5+
## Table of Contents
66

7-
- [Usage Guide](usage.md)Verwendung des Images in GitHub Actions und lokal
8-
- [CI/CD Pipeline Example](cicd-example.md)Komplette Single-Service CI/CD-Pipeline mit Build, Push und Helm-Deploy
9-
- [Configuration Reference](configuration.md)Umgebungsvariablen, Build-Args und Secrets
10-
- [Development Guide](development.md)Lokales Bauen, Testen und Beitragen
7+
- [Usage Guide](usage.md)Using the image in GitHub Actions and locally
8+
- [CI/CD Pipeline Example](cicd-example.md)Complete single-service CI/CD pipeline with build, push, and Helm deploy
9+
- [Configuration Reference](configuration.md)Environment variables, build args, and secrets
10+
- [Development Guide](development.md)Local build, testing, and contributing

docs/cicd-example.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
--timeout=5m
136136
```
137137
138-
> Den Image-Tag auf `production` (oder eine andere Stage) ändern, um den jeweiligen Cluster anzusprechen.
138+
> Swap the image tag to `production` (or another stage) to target the respective cluster.
139139

140140
## Key Patterns
141141

@@ -168,7 +168,7 @@ container:
168168
password: ${{ secrets.GITHUB_TOKEN }}
169169
```
170170

171-
> Tag auf `production` ändern, um den Production-Cluster anzusprechen.
171+
> Swap the tag to `production` to target the production cluster.
172172

173173
### Dynamic image tag
174174

docs/configuration.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
## GitHub Actions Secrets
1212

13-
Pro Stage wird ein eigenes Secret benötigt (siehe [Stage Matrix](#stage-matrix)).
13+
Each stage needs its own secret (see [Stage Matrix](#stage-matrix)).
1414

1515
| Secret | Required | Description |
1616
|---|---|---|
17-
| `KUBECONFIG_B64_<STAGE>` | Pro Stage | Base64-encoded Kubeconfig für die jeweilige Stage, wird als Build-Arg ins Image gebacken |
17+
| `KUBECONFIG_B64_<STAGE>` | Per stage | Base64-encoded kubeconfig for the respective stage, baked into the image as build-arg |
1818
| `GITHUB_TOKEN` | Automatic | Provided by GitHub; used to authenticate to GHCR |
1919

2020
## Stage Matrix
2121

22-
Die Stages werden in `.github/workflows/build-and-push.yml` als Matrix definiert. Jeder Eintrag ist ein Tupel aus `name` (Stage-Identifier, wird als Image-Tag verwendet) und `secret` (Name des GitHub-Secrets mit der Kubeconfig).
22+
Stages are defined in `.github/workflows/build-and-push.yml` as a matrix. Each entry is a tuple of `name` (stage identifier, used as image tag) and `secret` (name of the GitHub secret containing the kubeconfig).
2323

2424
```yaml
2525
strategy:
@@ -32,14 +32,14 @@ strategy:
3232
secret: KUBECONFIG_B64_PRODUCTION
3333
```
3434
35-
Die Matrix sorgt dafür, dass derselbe Build-Job pro Stage einmal läuftmit dem jeweiligen Secret und Stage-spezifischen Image-Tags:
35+
The matrix ensures the same build job runs once per stagewith the respective secret and stage-specific image tags:
3636
37-
| Stage | Secret | Image-Tag (latest) | Image-Tag (SHA) |
37+
| Stage | Secret | Image Tag (latest) | Image Tag (SHA) |
3838
|---|---|---|---|
3939
| `staging` | `KUBECONFIG_B64_STAGING` | `staging` | `staging-abc1234` |
4040
| `production` | `KUBECONFIG_B64_PRODUCTION` | `production` | `production-abc1234` |
4141

42-
Neue Stages werden einfach als weiteres Tupel in der Matrix ergänzt:
42+
New stages are simply added as another tuple in the matrix:
4343

4444
```yaml
4545
- name: development

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
--set image.tag="${{ github.sha }}"
2929
```
3030
31-
> Den Tag auf `production` (oder eine andere Stage) ändern, um den entsprechenden Cluster anzusprechen.
31+
> Swap the tag to `production` (or another stage) to target the respective cluster.
3232

3333
### Override Kubeconfig at runtime
3434

entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ KUBE_DIR="${HOME:-/root}/.kube"
55
mkdir -p "$KUBE_DIR"
66

77
if [ -n "${KUBECONFIG_B64}" ]; then
8-
# Runtime-Override: Job kann eigene Kubeconfig per Env setzen
8+
# Runtime override: job can set its own kubeconfig via env
99
echo "$KUBECONFIG_B64" | base64 -d > "$KUBE_DIR/config"
1010
chmod 600 "$KUBE_DIR/config"
1111
export KUBECONFIG="$KUBE_DIR/config"
1212
elif [ -f /opt/kubeconfig/default ]; then
13-
# Default: zur Build-Zeit eingebackene Kubeconfig
13+
# Default: kubeconfig baked in at build time
1414
export KUBECONFIG=/opt/kubeconfig/default
1515
fi
1616

scripts/test-container.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
2-
# Einfacher Test des gebauten Images (GHCR): kubectl + helm mit eingebackener Kubeconfig.
3-
# Optional: GHCR_TOKEN (oder GITHUB_TOKEN) + GHCR_USER für Login bei privatem Image.
4-
# Token nie im Repo speichern; nur per Umgebungsvariable übergeben.
2+
# Simple test of the built image (GHCR): kubectl + helm with baked-in kubeconfig.
3+
# Optional: GHCR_TOKEN (or GITHUB_TOKEN) + GHCR_USER for login with private image.
4+
# Never store tokens in the repo; pass only via environment variable.
55

66
set -e
77

@@ -13,23 +13,23 @@ if docker pull "$IMAGE" 2>/dev/null; then
1313
PULL_OK=1
1414
fi
1515
if [[ -z "$PULL_OK" ]]; then
16-
echo "Pull fehlgeschlagen (Image privat?). Melde bei GHCR an ..."
16+
echo "Pull failed (image private?). Logging in to GHCR ..."
1717
TOKEN="${GHCR_TOKEN:-$GITHUB_TOKEN}"
1818
GH_USER="${GHCR_USER:-$(gh api user -q .login 2>/dev/null || true)}"
1919
if [[ -n "$TOKEN" && -n "$GH_USER" ]]; then
2020
echo "$TOKEN" | docker login ghcr.io -u "$GH_USER" --password-stdin
2121
elif [[ -z "$TOKEN" && -n "$GH_USER" ]]; then
2222
gh auth token | docker login ghcr.io -u "$GH_USER" --password-stdin
2323
else
24-
[[ -z "$GH_USER" ]] && echo "GHCR_USER fehlt (z. B. export GHCR_USER=dein-github-username)"
25-
[[ -z "$TOKEN" ]] && echo "Token setzen: export GHCR_TOKEN=ghp_... (oder gh auth login)"
24+
[[ -z "$GH_USER" ]] && echo "GHCR_USER missing (e.g. export GHCR_USER=your-github-username)"
25+
[[ -z "$TOKEN" ]] && echo "Set token: export GHCR_TOKEN=ghp_... (or gh auth login)"
2626
exit 1
2727
fi
2828
if ! docker pull "$IMAGE"; then
2929
echo ""
30-
echo "Zugriff verweigert. Entweder:"
31-
echo " - Package auf Public stellen: Repo → Packages → dockerized-deployment → Package settings → Change visibility → Public"
32-
echo " - Oder deinem GitHub-User Leserecht für das Package geben (Manage actions access)."
30+
echo "Access denied. Either:"
31+
echo " - Make the package public: Repo → Packages → dockerized-deployment → Package settings → Change visibility → Public"
32+
echo " - Or grant your GitHub user read access to the package (Manage actions access)."
3333
exit 1
3434
fi
3535
fi
@@ -43,4 +43,4 @@ echo "--- helm list -A ---"
4343
docker run --rm "$IMAGE" helm list -A
4444

4545
echo ""
46-
echo "Container-Test OK."
46+
echo "Container test OK."

0 commit comments

Comments
 (0)