Skip to content

Instantly share code, notes, and snippets.

View jonashackt's full-sized avatar
:octocat:
TDD & CI for IaC FTW!

Jonas Hecht jonashackt

:octocat:
TDD & CI for IaC FTW!
View GitHub Profile
@jonashackt
jonashackt / install-kind-helm-kubectl.sh
Created June 29, 2022 13:43
Prerequisites for Crossplane
brew install kind helm kubectl
@jonashackt
jonashackt / Chart.yaml
Created June 29, 2022 13:41
Helm chart to enable version management by Renovate
apiVersion: v2
type: application
name: crossplane
version: 0.0.0 # unused
appVersion: 0.0.0 # unused
dependencies:
- name: crossplane
repository: https://charts.crossplane.io/stable
version: 1.8.1
@jonashackt
jonashackt / docker-images.sh
Created June 10, 2022 06:54
docker images
$ docker images | grep vsc
vsc-microservice-ui-nuxt-js-fc70bec7c72be6f886987af8b1c42d94-features latest edd6d935f397 17 hours ago 1.44GB
vsc-microservice-ui-nuxt-js-fc70bec7c72be6f886987af8b1c42d94 latest 6f80ad49fca6 6 weeks ago 1.23GB
@jonashackt
jonashackt / devcontainer.json
Created June 10, 2022 06:49
devcontainer.json part
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000],
@jonashackt
jonashackt / Dockerfile
Created June 10, 2022 06:48
Dockerfile
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/typescript-node/.devcontainer/base.Dockerfile
# [Choice] Node.js version: 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye
ARG VARIANT="16-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
@jonashackt
jonashackt / devcontainer.json
Created June 10, 2022 06:47
devcontainer.json
{
"name": "Node.js & TypeScript",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 18, 16, 14.
"args": {
"VARIANT": "16-bullseye"
}
},
"extensions": [
@jonashackt
jonashackt / gitops.md
Created January 20, 2022 14:31
GitOps cheat sheet
@jonashackt
jonashackt / docker-healthcheck-java.md
Last active May 5, 2021 15:46
Creating our own Java-based Docker Healthcheck without curl

Paketo.io / CloudNativeBuildPack created Container image doesn't have curl installed - and this is for good reasons (see https://stackoverflow.com/a/65393843/4964553 & https://blog.sixeyed.com/docker-healthchecks-why-not-to-use-curl-or-iwr/).

So we need another aproach... As suggested we should use the container inherited language (here: Java/JDK) to write our own healthcheck.

Creating our own Java-based Healthcheck without curl

So let's look at this great article https://mflash.dev/blog/2021/03/01/java-based-health-check-for-docker/ , where Naiyer explains how to write a simple healthcheck based on Java 11+

Here's my adoption leveraging an argument to provide a specific port. Just look into HealthCheck.java:

@jonashackt
jonashackt / paketo-cloud-native-buildpacks-cheat-sheet.sh
Last active December 21, 2020 13:42
Cheat sheet for Cloud Native Buildpacks / Paketo building Spring Boot apps
# Samples:
https://github.com/buildpacks/samples
# We can override the default ENTRYPOINT in a CNB build container
see https://buildpacks.io/docs/app-developer-guide/run-an-app/#user-provided-shell-process
So we need to know the default launch process of a CNB build Spring Boot container - and then add the needed installation command