Skip to content

Commit

Permalink
Merge branch 'master' into db/-/log-level
Browse files Browse the repository at this point in the history
  • Loading branch information
dabcoder authored Aug 9, 2024
2 parents 08f16d1 + 70ab566 commit 5a53a39
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 102 deletions.
103 changes: 26 additions & 77 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Pull Request

on:
pull_request_target:
pull_request:
branches:
- master
paths:
Expand Down Expand Up @@ -107,70 +107,19 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.STAKATER_DOCKERHUB_USERNAME }}
password: ${{ secrets.STAKATER_DOCKERHUB_PASSWORD }}

- name: Generate image repository path for Docker registry
run: |
echo DOCKER_IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and Push Docker Image to Docker registry
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
pull: true
push: true
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
cache-to: type=inline
platforms: linux/amd64,linux/arm,linux/arm64
tags: |
${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and Push Docker UBI Image to Docker registry
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_UBI_FILE_PATH }}
pull: true
push: true
build-args: |
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
BUILDER_IMAGE=${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
cache-to: type=inline
platforms: linux/amd64,linux/arm64
tags: |
${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Login to ghcr registry
uses: docker/login-action@v3
with:
registry: ${{env.REGISTRY}}
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Generate image repository path for ghcr registry
run: |
echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and Push Docker Image to ghcr registry
# To identify any broken changes in dockerfiles or dependencies

- name: Build Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
pull: true
push: true
push: false
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
cache-to: type=inline
platforms: linux/amd64,linux/arm,linux/arm64
Expand All @@ -181,13 +130,13 @@ jobs:
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Build and Push Docker UBI Image to ghcr registry
- name: Build Docker UBI Image
uses: docker/build-push-action@v5
with:
context: .
file: ${{ env.DOCKER_UBI_FILE_PATH }}
pull: true
push: true
push: false
build-args: |
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
BUILDER_IMAGE=${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
Expand All @@ -200,22 +149,22 @@ jobs:
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Comment on PR
uses: mshick/add-pr-comment@v2
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message-success: '@${{ github.actor }} Images are available for testing. `docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`\n`docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}`'
message-failure: '@${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!'
allow-repeats: true

- name: Notify Slack
uses: 8398a7/action-slack@v3
if: always() # Pick up events even if the job fails or is canceled.
with:
status: ${{ job.status }}
fields: repo,author,action,eventName,ref,workflow
env:
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}
# - name: Comment on PR
# uses: mshick/add-pr-comment@v2
# if: always()
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# message-success: '@${{ github.actor }} Images are available for testing. `docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`\n`docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}`'
# message-failure: '@${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!'
# allow-repeats: true

# - name: Notify Slack
# uses: 8398a7/action-slack@v3
# if: always() # Pick up events even if the job fails or is canceled.
# with:
# status: ${{ job.status }}
# fields: repo,author,action,eventName,ref,workflow
# env:
# GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
# SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}
4 changes: 2 additions & 2 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ jobs:
- name: Helm Template
run: |
helm template reloader deployments/kubernetes/chart/reloader/ \
--set reloader.deployment.resources.limits.cpu=150m \
--set reloader.deployment.resources.limits.memory=512Mi \
--set-string reloader.deployment.resources.limits.cpu=1 \
--set reloader.deployment.resources.limits.memory=128Mi \
--set reloader.deployment.resources.requests.cpu=10m \
--set reloader.deployment.resources.requests.memory=128Mi > deployments/kubernetes/reloader.yaml
Expand Down
4 changes: 2 additions & 2 deletions deployments/kubernetes/chart/reloader/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
apiVersion: v1
name: reloader
description: Reloader chart that runs on kubernetes
version: 1.0.120
appVersion: v1.0.120
version: 1.0.122
appVersion: v1.0.122
keywords:
- Reloader
- kubernetes
Expand Down
19 changes: 16 additions & 3 deletions deployments/kubernetes/chart/reloader/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,23 @@ spec:
- image: "{{ .Values.reloader.deployment.image.name }}:{{ .Values.reloader.deployment.image.tag }}"
imagePullPolicy: {{ .Values.reloader.deployment.image.pullPolicy }}
name: {{ template "reloader-fullname" . }}
{{- if or (.Values.reloader.deployment.env.open) (.Values.reloader.deployment.env.secret) (.Values.reloader.deployment.env.field) (.Values.reloader.deployment.env.existing) (eq .Values.reloader.watchGlobally false) (.Values.reloader.enableHA) (.Values.reloader.enableMetricsByNamespace)}}
env:
- name: GOMAXPROCS
{{- if .Values.reloader.deployment.gomaxprocsOverride }}
value: {{ .Values.reloader.deployment.gomaxprocsOverride | quote }}
{{- else }}
valueFrom:
resourceFieldRef:
resource: limits.cpu
{{- end }}
- name: GOMEMLIMIT
{{- if .Values.reloader.deployment.gomemlimitOverride }}
value: {{ .Values.reloader.deployment.gomemlimitOverride | quote }}
{{- else }}
valueFrom:
resourceFieldRef:
resource: limits.memory
{{- end }}
{{- range $name, $value := .Values.reloader.deployment.env.open }}
{{- if not (empty $value) }}
- name: {{ $name | quote }}
Expand Down Expand Up @@ -133,8 +148,6 @@ spec:
- name: METRICS_COUNT_BY_NAMESPACE
value: enabled
{{- end }}
{{- end }}

ports:
- name: http
containerPort: 9090
Expand Down
13 changes: 13 additions & 0 deletions deployments/kubernetes/chart/reloader/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,16 @@ tests:
asserts:
- isEmpty:
path: spec.template.spec.containers[0].securityContext

- it: template still sets POD_NAME and POD_NAMESPACE environment variables when enableHA is true
set:
reloader:
enableHA: true
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
16 changes: 10 additions & 6 deletions deployments/kubernetes/chart/reloader/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ reloader:
seccompProfile:
type: RuntimeDefault

containerSecurityContext:
{}
containerSecurityContext: {}
# capabilities:
# drop:
# - ALL
Expand Down Expand Up @@ -94,10 +93,10 @@ reloader:
labels:
provider: stakater
group: com.stakater.platform
version: v1.0.119
version: v1.0.121
image:
name: ghcr.io/stakater/reloader
tag: v1.0.119
tag: v1.0.121
pullPolicy: IfNotPresent
# Support for extra environment variables.
env:
Expand Down Expand Up @@ -149,8 +148,13 @@ reloader:
# imagePullSecrets:
# - name: myregistrykey

service:
{}
# Put "0" in either to have go runtime ignore the set value.
# Otherwise, see https://pkg.go.dev/runtime#hdr-Environment_Variables for GOMAXPROCS and GOMEMLIMIT
gomaxprocsOverride: ""
gomemlimitOverride: ""

service: {}

# labels: {}
# annotations: {}
# port: 9090
Expand Down
11 changes: 10 additions & 1 deletion deployments/kubernetes/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@ spec:
app: reloader-reloader
spec:
containers:
- image: "ghcr.io/stakater/reloader:v1.0.119"
- image: "ghcr.io/stakater/reloader:v1.0.121"
imagePullPolicy: IfNotPresent
name: reloader-reloader
env:
- name: GOMAXPROCS
valueFrom:
resourceFieldRef:
resource: limits.cpu
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
ports:
- name: http
containerPort: 9090
Expand Down
30 changes: 19 additions & 11 deletions deployments/kubernetes/reloader.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.119"
chart: "reloader-1.0.121"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
Expand All @@ -25,7 +25,7 @@ metadata:
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.119"
chart: "reloader-1.0.121"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
Expand Down Expand Up @@ -92,7 +92,7 @@ metadata:
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.119"
chart: "reloader-1.0.121"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
Expand All @@ -115,13 +115,13 @@ metadata:
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.119"
chart: "reloader-1.0.121"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: v1.0.119
version: v1.0.121
name: reloader-reloader
namespace: default
spec:
Expand All @@ -135,19 +135,27 @@ spec:
metadata:
labels:
app: reloader-reloader
chart: "reloader-1.0.119"
chart: "reloader-1.0.121"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: v1.0.119
version: v1.0.121
spec:
containers:
- image: "ghcr.io/stakater/reloader:v1.0.119"
- image: "ghcr.io/stakater/reloader:v1.0.121"
imagePullPolicy: IfNotPresent
name: reloader-reloader

env:
- name: GOMAXPROCS
valueFrom:
resourceFieldRef:
resource: limits.cpu
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
ports:
- name: http
containerPort: 9090
Expand All @@ -174,8 +182,8 @@ spec:
{}
resources:
limits:
cpu: 150m
memory: 512Mi
cpu: "1"
memory: 128Mi
requests:
cpu: 10m
memory: 128Mi
Expand Down

0 comments on commit 5a53a39

Please sign in to comment.