Skip to content

Commit

Permalink
fixed-up release candidate logic and added render test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcgrath207 committed Apr 2, 2024
1 parent b8b2573 commit 38541cd
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 10 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ helm-docs:
$(LOCALBIN)/helm-docs --template-files "${GITROOT}/chart/README.md.gotmpl"
cat "${GITROOT}/Header.md" "${GITROOT}/chart/README.md" > "${GITROOT}/README.md"

test-helm-render:
helm template ./chart -f ./chart/test-values.yaml 1> /dev/null

minikube_new:
./scripts/create-minikube.sh

Expand All @@ -53,10 +56,13 @@ deploy_local: init
deploy_observability:
ENV='observability' ./scripts/deploy.sh

deploy_e2e: init ginkgo crane minikube_new
deploy_test: init
ENV='test' ./scripts/deploy.sh

deploy_e2e: init test-helm-render ginkgo crane minikube_new
ENV='e2e' ./scripts/deploy.sh

deploy_e2e_dirty: init
deploy_e2e_dirty: init test-helm-render
ENV='e2e' ./scripts/deploy.sh

deploy_many_pods:
Expand Down
3 changes: 2 additions & 1 deletion chart/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
*.tmproj
.vscode/
README.md.gotmpl
*.tgz
*.tgz
test-values.yaml
69 changes: 69 additions & 0 deletions chart/test-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

image:
repository: ghcr.io/jmcgrath207/k8s-ephemeral-storage-metrics
tag: 1.6.2
imagePullPolicy: IfNotPresent

serviceMonitor:
relabelings:
- sourceLabels: [pod_name]
targetLabel: pod
- sourceLabels: [pod_namespace]
targetLabel: namespace
# drop labels pod_.*
- regex: "pod_(.*)"
action: labeldrop


# -- Set metrics you want to enable
metrics:
# -- Percentage of ephemeral storage used by a container in a pod
ephemeral_storage_container_limit_percentage: true
# -- Percentage of ephemeral storage used by a container's volume in a pod
ephemeral_storage_container_volume_limit_percentage: true
# -- Current ephemeral byte usage of pod
ephemeral_storage_pod_usage: true
# -- Available ephemeral storage for a node
ephemeral_storage_node_available: true
# -- Capacity of ephemeral storage for a node
ephemeral_storage_node_capacity: true
# -- Percentage of ephemeral storage used on a node
ephemeral_storage_node_percentage: true
# -- Create the ephemeral_storage_adjusted_polling_rate metrics to report Adjusted Poll Rate in milliseconds. Typically used for testing.
adjusted_polling_rate: false

log_level: info
# -- Set as Deployment for single controller to query all nodes or Daemonset
deploy_type: Deployment
# Note in testing, Kube API does not refresh faster than 10 seconds
# -- Polling node rate for exporter
interval: 15 # Seconds
# -- Max number of concurrent query requests to the kubernetes API.
max_node_concurrency: 10
prometheus:
enable: true
release: kube-prometheus-stack

# -- Enable Pprof
pprof: false


# -- For local development or testing that will deploy grow and shrink pods and debug service
dev:
enabled: false
shrink:
image: ghcr.io/jmcgrath207/k8s-ephemeral-storage-shrink-test:latest
imagePullPolicy: IfNotPresent
grow:
image: ghcr.io/jmcgrath207/k8s-ephemeral-storage-grow-test:latest
imagePullPolicy: IfNotPresent

podAnnotations: {}

nodeSelector: {}

affinity: {}

tolerations: []


16 changes: 12 additions & 4 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,18 @@ function main() {

common_set_values=$(echo ${common_set_values_arr[*]} | sed 's/, /,/g' | sed 's/ /,/g')

helm upgrade --install "${DEPLOYMENT_NAME}" ../chart \
--set "${common_set_values}" \
--create-namespace \
--namespace "${DEPLOYMENT_NAME}"
if [[ $ENV == "test" ]]; then
helm upgrade --install "${DEPLOYMENT_NAME}" ../chart \
-f ../chart/test-values.yaml \
--create-namespace \
--namespace "${DEPLOYMENT_NAME}"
else
# All other deployments
helm upgrade --install "${DEPLOYMENT_NAME}" ../chart \
--set "${common_set_values}" \
--create-namespace \
--namespace "${DEPLOYMENT_NAME}"
fi

# Patch deploy so minikube image upload works.
if [[ $ENV == "debug" ]]; then
Expand Down
10 changes: 7 additions & 3 deletions scripts/release-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ gh auth token | docker login ghcr.io --username jmcgrath207 --password-stdin
docker build -f Dockerfile -t ghcr.io/jmcgrath207/$package:$VERSION .
docker build -f Dockerfile -t ghcr.io/jmcgrath207/$package:latest .
docker push ghcr.io/jmcgrath207/$package:$VERSION
docker push ghcr.io/jmcgrath207/$package:latest

docker build -f DockerfileTestGrow -t ghcr.io/jmcgrath207/k8s-ephemeral-storage-grow-test:latest .
docker build -f DockerfileTestGrow -t ghcr.io/jmcgrath207/k8s-ephemeral-storage-grow-test:$VERSION .
docker push ghcr.io/jmcgrath207/k8s-ephemeral-storage-grow-test:$VERSION
docker push ghcr.io/jmcgrath207/k8s-ephemeral-storage-grow-test:latest

docker build -f DockerfileTestGrow -t ghcr.io/jmcgrath207/k8s-ephemeral-storage-shrink-test:latest .
docker build -f DockerfileTestGrow -t ghcr.io/jmcgrath207/k8s-ephemeral-storage-shrink-test:$VERSION .
docker push ghcr.io/jmcgrath207/k8s-ephemeral-storage-shrink-test:$VERSION
docker push ghcr.io/jmcgrath207/k8s-ephemeral-storage-shrink-test:latest

# Don't push the latest image tags if they are a release candidate
if ! [[ $ENV =~ "rc" ]]; then
docker push ghcr.io/jmcgrath207/$package:latest
docker push ghcr.io/jmcgrath207/k8s-ephemeral-storage-shrink-test:latest
docker push ghcr.io/jmcgrath207/k8s-ephemeral-storage-grow-test:latest
fi

0 comments on commit 38541cd

Please sign in to comment.