Skip to content

Commit

Permalink
Merge pull request #49 from ropable/master
Browse files Browse the repository at this point in the history
Update project dependency versions, update Kustomize resource definitions
  • Loading branch information
ropable authored Jun 11, 2024
2 parents 1371b19 + ffca076 commit 31fb9fb
Show file tree
Hide file tree
Showing 12 changed files with 306 additions and 81 deletions.
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: local
hooks:
- id: trufflehog
name: TruffleHog
description: Detect secrets in your data.
entry: bash -c 'trufflehog git file://. --since-commit HEAD --only-verified --fail --no-update'
# For running trufflehog in docker, use the following entry instead:
# entry: bash -c 'docker run --rm -v "$(pwd):/workdir" -i --rm trufflesecurity/trufflehog:latest git file:///workdir --since-commit HEAD --only-verified --fail'
language: system
stages: ["commit", "push"]
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
# Prepare the base environment.
FROM python:3.10.13-slim as builder_base_healthcheck
FROM python:3.11.8-slim as builder_base_healthcheck
MAINTAINER [email protected]
LABEL org.opencontainers.image.source https://github.com/dbca-wa/healthcheck

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,16 @@ To build a new Docker image from the `Dockerfile`:
To run a Docker container locally, publishing container port 8080 to a local port:

docker container run --rm --publish 8080:8080 --env-file .env ghcr.io/dbca-wa/healthcheck

# Pre-commit hooks

This project includes the following pre-commit hooks:

- TruffleHog (credential scanning): https://github.com/marketplace/actions/trufflehog-oss

Pre-commit hooks may have additional system dependencies to run. Optionally
install pre-commit hooks locally like so:

poetry run pre-commit install

Reference: https://pre-commit.com/
1 change: 0 additions & 1 deletion kustomize/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: Deployment
metadata:
name: healthcheck-deployment
spec:
replicas: 2
strategy:
type: RollingUpdate
template:
Expand Down
17 changes: 17 additions & 0 deletions kustomize/base/deployment_hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: healthcheck-deployment-hpa
spec:
minReplicas: 1
maxReplicas: 3
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
metrics:
- resource:
name: cpu
target:
type: Utilization
averageUtilization: 500
type: Resource
7 changes: 5 additions & 2 deletions kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- deployment.yaml
- deployment_hpa.yaml
- service.yaml
7 changes: 7 additions & 0 deletions kustomize/overlays/prod/deployment_hpa_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: healthcheck-deployment-hpa
spec:
scaleTargetRef:
name: healthcheck-deployment-prod
3 changes: 2 additions & 1 deletion kustomize/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ labels:
variant: prod
patches:
- path: deployment_patch.yaml
- path: deployment_hpa_patch.yaml
- path: service_patch.yaml
images:
- name: ghcr.io/dbca-wa/healthcheck
newTag: 1.1.17
newTag: 1.1.18
7 changes: 7 additions & 0 deletions kustomize/overlays/uat/deployment_hpa_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: healthcheck-deployment-hpa
spec:
scaleTargetRef:
name: healthcheck-deployment-uat
1 change: 1 addition & 0 deletions kustomize/overlays/uat/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ labels:
variant: uat
patches:
- path: deployment_patch.yaml
- path: deployment_hpa_patch.yaml
- path: service_patch.yaml
Loading

0 comments on commit 31fb9fb

Please sign in to comment.