Skip to content

Commit

Permalink
Merge pull request #10 from soerenschneider/docker-openssl
Browse files Browse the repository at this point in the history
use docker openssl image instead of binary
  • Loading branch information
soerenschneider authored Dec 30, 2024
2 parents d7f6e4c + f81bfab commit 6e86365
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ TARGET_NAMESPACE ?= blue
KIND_CLUSTER_NAME ?= hmc-management-local


OPENSSL_DOCKER_IMAGE ?= alpine/openssl:3.3.2

TEMPLATES_DIR := templates
TEMPLATE_FOLDERS = $(patsubst $(TEMPLATES_DIR)/%,%,$(wildcard $(TEMPLATES_DIR)/*))
CHARTS_PACKAGE_DIR ?= $(LOCALBIN)/charts
Expand Down Expand Up @@ -419,13 +421,13 @@ certs/ca/ca.key:

certs/platform-engineer1/platform-engineer1.key:
mkdir -p certs/platform-engineer1
openssl genrsa -out certs/platform-engineer1/platform-engineer1.key 2048
docker run -v ./certs:/certs $(OPENSSL_DOCKER_IMAGE) genrsa -out /certs/platform-engineer1/platform-engineer1.key 2048

certs/platform-engineer1/platform-engineer1.csr: certs/platform-engineer1/platform-engineer1.key
openssl req -new -key certs/platform-engineer1/platform-engineer1.key -out certs/platform-engineer1/platform-engineer1.csr -subj '/CN=platform-engineer1/O=$(TARGET_NAMESPACE)'
docker run -v ./certs:/certs $(OPENSSL_DOCKER_IMAGE) req -new -key /certs/platform-engineer1/platform-engineer1.key -out /certs/platform-engineer1/platform-engineer1.csr -subj '/CN=platform-engineer1/O=$(TARGET_NAMESPACE)'

certs/platform-engineer1/platform-engineer1.crt: certs/platform-engineer1/platform-engineer1.csr certs/ca/ca.crt certs/ca/ca.key
openssl x509 -req -in certs/platform-engineer1/platform-engineer1.csr -CA certs/ca/ca.crt -CAkey certs/ca/ca.key -CAcreateserial -out certs/platform-engineer1/platform-engineer1.crt -days 360
docker run -v ./certs:/certs $(OPENSSL_DOCKER_IMAGE) x509 -req -in /certs/platform-engineer1/platform-engineer1.csr -CA /certs/ca/ca.crt -CAkey /certs/ca/ca.key -CAcreateserial -out /certs/platform-engineer1/platform-engineer1.crt -days 360

##@ Cleanup

Expand Down

0 comments on commit 6e86365

Please sign in to comment.