mirror of
https://github.com/stakater/Reloader.git
synced 2026-03-05 10:50:25 +00:00
Compare commits
15 Commits
feature/us
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03ef58df13 | ||
|
|
9aa957c839 | ||
|
|
20e2680539 | ||
|
|
f51b62dee9 | ||
|
|
f776e2dfd0 | ||
|
|
003fbbfa1f | ||
|
|
8834ab097d | ||
|
|
1e68bd58cd | ||
|
|
3ee87d3725 | ||
|
|
5c3593fb1c | ||
|
|
8537502bbd | ||
|
|
fd5f03adfb | ||
|
|
32899e1983 | ||
|
|
6c15e5db24 | ||
|
|
4a95a813cd |
2
.github/workflows/loadtest.yml
vendored
2
.github/workflows/loadtest.yml
vendored
@@ -54,7 +54,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.25'
|
go-version: '1.26'
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
|
|||||||
6
.github/workflows/pull_request.yaml
vendored
6
.github/workflows/pull_request.yaml
vendored
@@ -22,6 +22,7 @@ env:
|
|||||||
KUBERNETES_VERSION: "1.30.0"
|
KUBERNETES_VERSION: "1.30.0"
|
||||||
KIND_VERSION: "0.23.0"
|
KIND_VERSION: "0.23.0"
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
|
RELOADER_EDITION: oss
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
qa:
|
qa:
|
||||||
@@ -154,6 +155,7 @@ jobs:
|
|||||||
VERSION=merge-${{ steps.generate_tag.outputs.GIT_TAG }}
|
VERSION=merge-${{ steps.generate_tag.outputs.GIT_TAG }}
|
||||||
COMMIT=${{github.event.pull_request.head.sha}}
|
COMMIT=${{github.event.pull_request.head.sha}}
|
||||||
BUILD_DATE=${{ steps.prep.outputs.created }}
|
BUILD_DATE=${{ steps.prep.outputs.created }}
|
||||||
|
EDITION=${{ env.RELOADER_EDITION }}
|
||||||
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
|
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
|
||||||
|
|
||||||
cache-to: type=inline
|
cache-to: type=inline
|
||||||
@@ -173,6 +175,10 @@ jobs:
|
|||||||
pull: true
|
pull: true
|
||||||
push: false
|
push: false
|
||||||
build-args: |
|
build-args: |
|
||||||
|
VERSION=merge-${{ steps.generate_tag.outputs.GIT_UBI_TAG }}
|
||||||
|
COMMIT=${{github.event.pull_request.head.sha}}
|
||||||
|
BUILD_DATE=${{ steps.prep.outputs.created }}
|
||||||
|
EDITION=${{ env.RELOADER_EDITION }}
|
||||||
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
|
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
|
||||||
BUILDER_IMAGE=${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.highest_tag.outputs.tag }}
|
BUILDER_IMAGE=${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.highest_tag.outputs.tag }}
|
||||||
cache-to: type=inline
|
cache-to: type=inline
|
||||||
|
|||||||
9
.github/workflows/push.yaml
vendored
9
.github/workflows/push.yaml
vendored
@@ -15,6 +15,7 @@ env:
|
|||||||
KIND_VERSION: "0.23.0"
|
KIND_VERSION: "0.23.0"
|
||||||
HELM_REGISTRY_URL: "https://stakater.github.io/stakater-charts"
|
HELM_REGISTRY_URL: "https://stakater.github.io/stakater-charts"
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
|
RELOADER_EDITION: oss
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -103,7 +104,12 @@ jobs:
|
|||||||
file: ${{ env.DOCKER_FILE_PATH }}
|
file: ${{ env.DOCKER_FILE_PATH }}
|
||||||
pull: true
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
|
build-args: |
|
||||||
|
VERSION=merge-${{ github.event.number }}
|
||||||
|
COMMIT=${{ github.sha }}
|
||||||
|
BUILD_DATE=${{ steps.prep.outputs.created }}
|
||||||
|
EDITION=${{ env.RELOADER_EDITION }}
|
||||||
|
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
|
||||||
cache-to: type=inline
|
cache-to: type=inline
|
||||||
platforms: linux/amd64,linux/arm,linux/arm64
|
platforms: linux/amd64,linux/arm,linux/arm64
|
||||||
tags: |
|
tags: |
|
||||||
@@ -152,6 +158,7 @@ jobs:
|
|||||||
VERSION=merge-${{ github.event.number }}
|
VERSION=merge-${{ github.event.number }}
|
||||||
COMMIT=${{ github.sha }}
|
COMMIT=${{ github.sha }}
|
||||||
BUILD_DATE=${{ steps.prep.outputs.created }}
|
BUILD_DATE=${{ steps.prep.outputs.created }}
|
||||||
|
EDITION=${{ env.RELOADER_EDITION }}
|
||||||
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
|
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
|
||||||
cache-to: type=inline
|
cache-to: type=inline
|
||||||
platforms: linux/amd64,linux/arm,linux/arm64
|
platforms: linux/amd64,linux/arm,linux/arm64
|
||||||
|
|||||||
3
.github/workflows/release.yaml
vendored
3
.github/workflows/release.yaml
vendored
@@ -11,6 +11,7 @@ env:
|
|||||||
KUBERNETES_VERSION: "1.30.0"
|
KUBERNETES_VERSION: "1.30.0"
|
||||||
KIND_VERSION: "0.23.0"
|
KIND_VERSION: "0.23.0"
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
|
RELOADER_EDITION: oss
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
@@ -110,6 +111,7 @@ jobs:
|
|||||||
VERSION=${{ steps.generate_tag.outputs.RELEASE_VERSION }}
|
VERSION=${{ steps.generate_tag.outputs.RELEASE_VERSION }}
|
||||||
COMMIT=${{ github.sha }}
|
COMMIT=${{ github.sha }}
|
||||||
BUILD_DATE=${{ steps.prep.outputs.created }}
|
BUILD_DATE=${{ steps.prep.outputs.created }}
|
||||||
|
EDITION=${{ env.RELOADER_EDITION }}
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
|
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
|
||||||
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
|
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
|
||||||
@@ -160,6 +162,7 @@ jobs:
|
|||||||
VERSION=${{ steps.generate_tag.outputs.RELEASE_VERSION }}
|
VERSION=${{ steps.generate_tag.outputs.RELEASE_VERSION }}
|
||||||
COMMIT=${{ github.sha }}
|
COMMIT=${{ github.sha }}
|
||||||
BUILD_DATE=${{ steps.prep.outputs.created }}
|
BUILD_DATE=${{ steps.prep.outputs.created }}
|
||||||
|
EDITION=${{ env.RELOADER_EDITION }}
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
|
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
|
||||||
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
|
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ ARG BUILDER_IMAGE
|
|||||||
ARG BASE_IMAGE
|
ARG BASE_IMAGE
|
||||||
|
|
||||||
# Build the manager binary
|
# Build the manager binary
|
||||||
FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE:-golang:1.25.5} AS builder
|
FROM --platform=${BUILDPLATFORM} ${BUILDER_IMAGE:-golang:1.26} AS builder
|
||||||
|
|
||||||
ARG TARGETOS
|
ARG TARGETOS
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
@@ -12,6 +12,7 @@ ARG GOPRIVATE
|
|||||||
ARG COMMIT
|
ARG COMMIT
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
|
ARG EDITION=oss
|
||||||
|
|
||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
@@ -36,7 +37,8 @@ RUN CGO_ENABLED=0 \
|
|||||||
GO111MODULE=on \
|
GO111MODULE=on \
|
||||||
go build -ldflags="-s -w -X github.com/stakater/Reloader/pkg/common.Version=${VERSION} \
|
go build -ldflags="-s -w -X github.com/stakater/Reloader/pkg/common.Version=${VERSION} \
|
||||||
-X github.com/stakater/Reloader/pkg/common.Commit=${COMMIT} \
|
-X github.com/stakater/Reloader/pkg/common.Commit=${COMMIT} \
|
||||||
-X github.com/stakater/Reloader/pkg/common.BuildDate=${BUILD_DATE}" \
|
-X github.com/stakater/Reloader/pkg/common.BuildDate=${BUILD_DATE} \
|
||||||
|
-X github.com/stakater/Reloader/pkg/common.Edition=${EDITION}" \
|
||||||
-installsuffix 'static' -mod=mod -a -o manager ./
|
-installsuffix 'static' -mod=mod -a -o manager ./
|
||||||
|
|
||||||
# Use distroless as minimal base image to package the manager binary
|
# Use distroless as minimal base image to package the manager binary
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
name: reloader
|
name: reloader
|
||||||
description: Reloader chart that runs on kubernetes
|
description: Reloader chart that runs on kubernetes
|
||||||
version: 2.2.7
|
version: 2.2.8
|
||||||
appVersion: v1.4.12
|
appVersion: v1.4.13
|
||||||
keywords:
|
keywords:
|
||||||
- Reloader
|
- Reloader
|
||||||
- kubernetes
|
- kubernetes
|
||||||
|
|||||||
@@ -139,21 +139,26 @@ helm uninstall {{RELEASE_NAME}} -n {{NAMESPACE}}
|
|||||||
|
|
||||||
#### 🔄 `reloadOnCreate` Behavior
|
#### 🔄 `reloadOnCreate` Behavior
|
||||||
**When true:**
|
**When true:**
|
||||||
✅ New ConfigMaps/Secrets trigger rolling updates
|
✅ New ConfigMaps/Secrets trigger rolling updates for referencing workloads
|
||||||
✅ New deployments referencing existing resources reload
|
|
||||||
|
**When false:**
|
||||||
|
❌ ConfigMaps/Secrets creations have no effect on referencing workloads
|
||||||
|
|
||||||
|
#### 🗑️ `reloadOnDelete` Behavior
|
||||||
|
**When true:**
|
||||||
|
✅ Deleted ConfigMaps/Secrets trigger rolling updates for referencing workloads
|
||||||
|
|
||||||
|
**When false:**
|
||||||
|
❌ ConfigMaps/Secrets deletions have no effect on referencing workloads
|
||||||
|
|
||||||
|
#### 🔄 `syncAfterRestart` Behavior
|
||||||
|
**When true:**
|
||||||
✅ In HA mode, new leader reloads all tracked workloads
|
✅ In HA mode, new leader reloads all tracked workloads
|
||||||
|
|
||||||
**When false:**
|
**When false:**
|
||||||
❌ Updates during leader downtime are missed
|
❌ Updates during leader downtime are missed
|
||||||
⏳ Potential 15s delay window (default `LeaseDuration`)
|
⏳ Potential 15s delay window (default `LeaseDuration`)
|
||||||
|
|
||||||
#### 🗑️ `reloadOnDelete` Behavior
|
|
||||||
**When true:**
|
|
||||||
✅ Deleted resources trigger rolling updates of referencing workloads
|
|
||||||
|
|
||||||
**When false:**
|
|
||||||
❌ Deletions have no effect on referencing pods
|
|
||||||
|
|
||||||
#### Default Settings
|
#### Default Settings
|
||||||
⚠️ All flags default to `false` (must be enabled explicitly):
|
⚠️ All flags default to `false` (must be enabled explicitly):
|
||||||
- `reloadOnCreate`
|
- `reloadOnCreate`
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ fullnameOverride: ""
|
|||||||
image:
|
image:
|
||||||
name: stakater/reloader
|
name: stakater/reloader
|
||||||
repository: ghcr.io/stakater/reloader
|
repository: ghcr.io/stakater/reloader
|
||||||
tag: v1.4.12
|
tag: v1.4.13
|
||||||
# digest: sha256:1234567
|
# digest: sha256:1234567
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ reloader:
|
|||||||
labels:
|
labels:
|
||||||
provider: stakater
|
provider: stakater
|
||||||
group: com.stakater.platform
|
group: com.stakater.platform
|
||||||
version: v1.4.12
|
version: v1.4.13
|
||||||
# Support for extra environment variables.
|
# Support for extra environment variables.
|
||||||
env:
|
env:
|
||||||
# Open supports Key value pair as environment variables.
|
# Open supports Key value pair as environment variables.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ spec:
|
|||||||
app: reloader-reloader
|
app: reloader-reloader
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: "ghcr.io/stakater/reloader:v1.4.12"
|
- image: "ghcr.io/stakater/reloader:v1.4.13"
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
name: reloader-reloader
|
name: reloader-reloader
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ spec:
|
|||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
- name: RELOADER_DEPLOYMENT_NAME
|
- name: RELOADER_DEPLOYMENT_NAME
|
||||||
value: reloader-reloader
|
value: reloader-reloader
|
||||||
image: ghcr.io/stakater/reloader:v1.4.12
|
image: ghcr.io/stakater/reloader:v1.4.13
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
failureThreshold: 5
|
failureThreshold: 5
|
||||||
|
|||||||
4
go.mod
4
go.mod
@@ -1,6 +1,6 @@
|
|||||||
module github.com/stakater/Reloader
|
module github.com/stakater/Reloader
|
||||||
|
|
||||||
go 1.25.5
|
go 1.26
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/argoproj/argo-rollouts v1.8.3
|
github.com/argoproj/argo-rollouts v1.8.3
|
||||||
@@ -15,7 +15,6 @@ require (
|
|||||||
k8s.io/apimachinery v0.35.0
|
k8s.io/apimachinery v0.35.0
|
||||||
k8s.io/client-go v0.35.0
|
k8s.io/client-go v0.35.0
|
||||||
k8s.io/kubectl v0.35.0
|
k8s.io/kubectl v0.35.0
|
||||||
k8s.io/utils v0.0.0-20251222233032-718f0e51e6d2
|
|
||||||
sigs.k8s.io/secrets-store-csi-driver v1.5.5
|
sigs.k8s.io/secrets-store-csi-driver v1.5.5
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -65,6 +64,7 @@ require (
|
|||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
k8s.io/klog/v2 v2.130.1 // indirect
|
k8s.io/klog/v2 v2.130.1 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
|
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
|
||||||
|
k8s.io/utils v0.0.0-20251222233032-718f0e51e6d2 // indirect
|
||||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
|
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
|
||||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
|
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ func TestHealthz(t *testing.T) {
|
|||||||
want := 200
|
want := 200
|
||||||
|
|
||||||
if got != want {
|
if got != want {
|
||||||
t.Fatalf("got: %q, want: %q", got, want)
|
t.Fatalf("got: %d, want: %d", got, want)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Have the liveness probe serve a 500
|
// Have the liveness probe serve a 500
|
||||||
@@ -63,7 +63,7 @@ func TestHealthz(t *testing.T) {
|
|||||||
want = 500
|
want = 500
|
||||||
|
|
||||||
if got != want {
|
if got != want {
|
||||||
t.Fatalf("got: %q, want: %q", got, want)
|
t.Fatalf("got: %d, want: %d", got, want)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ func TestRunLeaderElection(t *testing.T) {
|
|||||||
want := 500
|
want := 500
|
||||||
|
|
||||||
if got != want {
|
if got != want {
|
||||||
t.Fatalf("got: %q, want: %q", got, want)
|
t.Fatalf("got: %d, want: %d", got, want)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cancel the leader election context, so leadership is released and
|
// Cancel the leader election context, so leadership is released and
|
||||||
@@ -108,7 +108,7 @@ func TestRunLeaderElection(t *testing.T) {
|
|||||||
want = 500
|
want = 500
|
||||||
|
|
||||||
if got != want {
|
if got != want {
|
||||||
t.Fatalf("got: %q, want: %q", got, want)
|
t.Fatalf("got: %d, want: %d", got, want)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,11 +18,12 @@ import (
|
|||||||
var Version = "dev"
|
var Version = "dev"
|
||||||
var Commit = "unknown"
|
var Commit = "unknown"
|
||||||
var BuildDate = "unknown"
|
var BuildDate = "unknown"
|
||||||
|
var Edition = "oss"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MetaInfoConfigmapName = "reloader-meta-info"
|
MetaInfoConfigmapName = "reloader-meta-info"
|
||||||
MetaInfoConfigmapLabelKey = "reloader.stakater.com/meta-info"
|
MetaInfoConfigmapLabelKey = "reloader.stakater.com/meta-info"
|
||||||
MetaInfoConfigmapLabelValue = "reloader-oss"
|
MetaInfoConfigmapLabelValue = "reloader"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MetaInfo contains comprehensive metadata about the Reloader instance.
|
// MetaInfo contains comprehensive metadata about the Reloader instance.
|
||||||
@@ -47,6 +48,9 @@ type BuildInfo struct {
|
|||||||
CommitHash string `json:"commitHash"`
|
CommitHash string `json:"commitHash"`
|
||||||
// CommitTime is the timestamp of the Git commit used to build this binary
|
// CommitTime is the timestamp of the Git commit used to build this binary
|
||||||
CommitTime time.Time `json:"commitTime"`
|
CommitTime time.Time `json:"commitTime"`
|
||||||
|
|
||||||
|
// Edition indicates the edition of Reloader (e.g., OSS, Enterprise)
|
||||||
|
Edition string `json:"edition"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewBuildInfo() *BuildInfo {
|
func NewBuildInfo() *BuildInfo {
|
||||||
@@ -55,6 +59,7 @@ func NewBuildInfo() *BuildInfo {
|
|||||||
ReleaseVersion: Version,
|
ReleaseVersion: Version,
|
||||||
CommitHash: Commit,
|
CommitHash: Commit,
|
||||||
CommitTime: ParseUTCTime(BuildDate),
|
CommitTime: ParseUTCTime(BuildDate),
|
||||||
|
Edition: Edition,
|
||||||
}
|
}
|
||||||
|
|
||||||
return metaInfo
|
return metaInfo
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
module github.com/stakater/Reloader/test/loadtest
|
module github.com/stakater/Reloader/test/loadtest
|
||||||
|
|
||||||
go 1.25
|
go 1.26
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/spf13/cobra v1.8.1
|
github.com/spf13/cobra v1.8.1
|
||||||
|
|||||||
Reference in New Issue
Block a user