Skip to content

Commit

Permalink
Merge branch 'master' into issue-582-auto-annotation-with-resource-ty…
Browse files Browse the repository at this point in the history
…pe-squashed
  • Loading branch information
MuneebAijaz authored Apr 8, 2024
2 parents b4fe7fb + ae5bc2c commit 1cae7a0
Show file tree
Hide file tree
Showing 14 changed files with 242 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:

jobs:
qa:
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.64
uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.65
with:
MD_CONFIG: .github/md_config.json
DOC_SRC: README.md docs
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ jobs:
helm template reloader deployments/kubernetes/chart/reloader/ > deployments/kubernetes/reloader.yaml
helm template reloader deployments/kubernetes/chart/reloader/ --output-dir deployments/kubernetes/manifests && mv deployments/kubernetes/manifests/reloader/templates/* deployments/kubernetes/manifests/ && rm -r deployments/kubernetes/manifests/reloader
- name: Remove labels and annotations from manifests
run: make remove-labels-annotations

# Publish helm chart
- name: Login to ghcr via helm
run: |
Expand Down
2 changes: 1 addition & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
StylesPath = styles
MinAlertLevel = warning

Packages = https://github.com/stakater/vale-package/releases/download/v0.0.8/Stakater.zip
Packages = https://github.com/stakater/vale-package/releases/download/v0.0.14/Stakater.zip
Vocab = Stakater

# Only check MarkDown files
Expand Down
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,25 @@ bump-chart:
sed -i "s/^appVersion:.*/appVersion: v$(VERSION)/" deployments/kubernetes/chart/reloader/Chart.yaml
sed -i "s/tag:.*/tag: v$(VERSION)/" deployments/kubernetes/chart/reloader/values.yaml
sed -i "s/version:.*/version: v$(VERSION)/" deployments/kubernetes/chart/reloader/values.yaml

YQ_VERSION = v4.42.1
YQ_BIN = $(shell pwd)/yq
CURRENT_ARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')

YQ_DOWNLOAD_URL = "https://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_linux_$(CURRENT_ARCH)"

yq-install:
@echo "Downloading yq $(YQ_VERSION) for linux/$(CURRENT_ARCH)"
@curl -sL $(YQ_DOWNLOAD_URL) -o $(YQ_BIN)
@chmod +x $(YQ_BIN)
@echo "yq $(YQ_VERSION) installed at $(YQ_BIN)"

remove-labels-annotations: yq-install
@for file in $$(find deployments/kubernetes/manifests -type f -name '*.yaml'); do \
echo "Processing $$file"; \
$(YQ_BIN) eval 'del(.metadata.labels, .metadata.annotations)' -i "$$file"; \
done
$(YQ_BIN) eval 'del(.spec.template.metadata.labels)' -i deployments/kubernetes/manifests/deployment.yaml
$(YQ_BIN) eval 'del(.spec.selector.matchLabels)' -i deployments/kubernetes/manifests/deployment.yaml
$(YQ_BIN) eval '.spec.selector.matchLabels.app = "reloader-reloader"' -i deployments/kubernetes/manifests/deployment.yaml
$(YQ_BIN) eval '.spec.template.metadata.labels.app = "reloader-reloader"' -i deployments/kubernetes/manifests/deployment.yaml
151 changes: 99 additions & 52 deletions README.md

Large diffs are not rendered by default.

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.69
appVersion: v1.0.69
version: 1.0.75
appVersion: v1.0.75
keywords:
- Reloader
- kubernetes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if and (.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1") (.Values.reloader.verticalPodAutoscaler.enabled) }}
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: {{ template "reloader-fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
{{- include "reloader-labels.chart" . | nindent 4 }}
spec:
{{- with .Values.reloader.verticalPodAutoscaler.recommenders }}
recommenders:
{{- toYaml . | nindent 4 }}
{{- end }}
resourcePolicy:
containerPolicies:
- containerName: {{ template "reloader-fullname" . }}
{{- with .Values.reloader.verticalPodAutoscaler.controlledResources }}
controlledResources:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.reloader.verticalPodAutoscaler.controlledValues }}
controlledValues: {{ .Values.reloader.verticalPodAutoscaler.controlledValues }}
{{- end }}
{{- if .Values.reloader.verticalPodAutoscaler.maxAllowed }}
maxAllowed:
{{ toYaml .Values.reloader.verticalPodAutoscaler.maxAllowed | nindent 8 }}
{{- end }}
{{- if .Values.reloader.verticalPodAutoscaler.minAllowed }}
minAllowed:
{{ toYaml .Values.reloader.verticalPodAutoscaler.minAllowed | nindent 8 }}
{{- end }}
targetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "reloader-fullname" . }}
{{- with .Values.reloader.verticalPodAutoscaler.updatePolicy }}
updatePolicy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
39 changes: 36 additions & 3 deletions deployments/kubernetes/chart/reloader/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ reloader:
securityContext:
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault

containerSecurityContext: {}
# capabilities:
Expand Down Expand Up @@ -87,10 +89,10 @@ reloader:
labels:
provider: stakater
group: com.stakater.platform
version: v1.0.69
version: v1.0.75
image:
name: ghcr.io/stakater/reloader
tag: v1.0.69
tag: v1.0.75
pullPolicy: IfNotPresent
# Support for extra environment variables.
env:
Expand Down Expand Up @@ -280,7 +282,38 @@ reloader:
# matchLabels:
# app.kubernetes.io/name: prometheus
to: []


# Enable vertical pod autoscaler
verticalPodAutoscaler:
enabled: false

# Recommender responsible for generating recommendation for the object.
# List should be empty (then the default recommender will generate the recommendation)
# or contain exactly one recommender.
# recommenders:
# - name: custom-recommender-performance

# List of resources that the vertical pod autoscaler can control. Defaults to cpu and memory
controlledResources: []
# Specifies which resource values should be controlled: RequestsOnly or RequestsAndLimits.
# controlledValues: RequestsAndLimits

# Define the max allowed resources for the pod
maxAllowed: {}
# cpu: 200m
# memory: 100Mi
# Define the min allowed resources for the pod
minAllowed: {}
# cpu: 200m
# memory: 100Mi

updatePolicy:
# Specifies minimal number of replicas which need to be alive for VPA Updater to attempt pod eviction
# minReplicas: 1
# Specifies whether recommended updates are applied when a Pod is started and whether recommended updates
# are applied during the life of a Pod. Possible values are "Off", "Initial", "Recreate", and "Auto".
updateMode: Auto

volumeMounts: []

volumes: []
Expand Down
10 changes: 0 additions & 10 deletions deployments/kubernetes/manifests/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
---
# Source: reloader/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1

kind: ClusterRole
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.69"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
name: reloader-reloader-role
rules:
- apiGroups:
Expand Down
10 changes: 0 additions & 10 deletions deployments/kubernetes/manifests/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
---
# Source: reloader/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1

kind: ClusterRoleBinding
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.69"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
name: reloader-reloader-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand Down
77 changes: 28 additions & 49 deletions deployments/kubernetes/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.69"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: v1.0.69
name: reloader-reloader
namespace: default
spec:
Expand All @@ -23,49 +11,40 @@ spec:
selector:
matchLabels:
app: reloader-reloader
release: "reloader"
template:
metadata:
labels:
app: reloader-reloader
chart: "reloader-1.0.69"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: v1.0.69
spec:
containers:
- image: "ghcr.io/stakater/reloader:v1.0.69"
imagePullPolicy: IfNotPresent
name: reloader-reloader

ports:
- name: http
containerPort: 9090
livenessProbe:
httpGet:
path: /live
port: http
timeoutSeconds: 5
failureThreshold: 5
periodSeconds: 10
successThreshold: 1
initialDelaySeconds: 10
readinessProbe:
httpGet:
path: /metrics
port: http
timeoutSeconds: 5
failureThreshold: 5
periodSeconds: 10
successThreshold: 1
initialDelaySeconds: 10

securityContext:
{}
securityContext:
- image: "ghcr.io/stakater/reloader:v1.0.75"
imagePullPolicy: IfNotPresent
name: reloader-reloader
ports:
- name: http
containerPort: 9090
livenessProbe:
httpGet:
path: /live
port: http
timeoutSeconds: 5
failureThreshold: 5
periodSeconds: 10
successThreshold: 1
initialDelaySeconds: 10
readinessProbe:
httpGet:
path: /metrics
port: http
timeoutSeconds: 5
failureThreshold: 5
periodSeconds: 10
successThreshold: 1
initialDelaySeconds: 10
securityContext: {}
securityContext:
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: reloader-reloader
9 changes: 0 additions & 9 deletions deployments/kubernetes/manifests/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
meta.helm.sh/release-namespace: "default"
meta.helm.sh/release-name: "reloader"
labels:
app: reloader-reloader
chart: "reloader-1.0.69"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
name: reloader-reloader
namespace: default
18 changes: 10 additions & 8 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.69"
chart: "reloader-1.0.75"
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.69"
chart: "reloader-1.0.75"
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.69"
chart: "reloader-1.0.75"
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.69"
chart: "reloader-1.0.75"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: v1.0.69
version: v1.0.75
name: reloader-reloader
namespace: default
spec:
Expand All @@ -135,16 +135,16 @@ spec:
metadata:
labels:
app: reloader-reloader
chart: "reloader-1.0.69"
chart: "reloader-1.0.75"
release: "reloader"
heritage: "Helm"
app.kubernetes.io/managed-by: "Helm"
group: com.stakater.platform
provider: stakater
version: v1.0.69
version: v1.0.75
spec:
containers:
- image: "ghcr.io/stakater/reloader:v1.0.69"
- image: "ghcr.io/stakater/reloader:v1.0.75"
imagePullPolicy: IfNotPresent
name: reloader-reloader

Expand Down Expand Up @@ -175,4 +175,6 @@ spec:
securityContext:
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
serviceAccountName: reloader-reloader
Binary file added yq
Binary file not shown.

0 comments on commit 1cae7a0

Please sign in to comment.