Skip to content

Commit

Permalink
set up root CA during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
conradludgate committed Jan 21, 2025
1 parent f04e56f commit e9121eb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ kind-setup: kind kubectl ## Create local cluster by kind tool and prepared confi
$(KIND) create cluster --name $(CLUSTER_NAME) --config kind/config.yaml
$(KUBECTL) --context kind-$(CLUSTER_NAME) apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml
$(KUBECTL) --context kind-$(CLUSTER_NAME) -n cert-manager rollout status deployment cert-manager
$(KUBECTL) --context kind-$(CLUSTER_NAME) apply -f k3d/certs.yaml
$(KUBECTL) --context kind-$(CLUSTER_NAME) apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
$(KUBECTL) --context kind-$(CLUSTER_NAME) patch -n kube-system deployment metrics-server --type=json -p '[{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--kubelet-insecure-tls"}]'
$(KUBECTL) --context kind-$(CLUSTER_NAME) -n kube-system rollout status deployment metrics-server
Expand All @@ -458,6 +459,7 @@ k3d-setup: k3d kubectl ## Create local cluster by k3d tool and prepared config
$(KUBECTL) --context k3d-$(CLUSTER_NAME) -n kube-system rollout status deployment cilium-operator
$(KUBECTL) --context k3d-$(CLUSTER_NAME) apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml
$(KUBECTL) --context k3d-$(CLUSTER_NAME) -n cert-manager rollout status deployment cert-manager
$(KUBECTL) --context k3d-$(CLUSTER_NAME) apply -f k3d/certs.yaml

.PHONY: k3d-destroy
k3d-destroy: k3d ## Destroy local k3d cluster
Expand Down
31 changes: 31 additions & 0 deletions k3d/certs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: selfsigned-issuer
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: neon-compute-ca
namespace: cert-manager
spec:
isCA: true
commonName: neon-compute-ca
secretName: root-secret
privateKey:
algorithm: ECDSA
size: 256
issuerRef:
name: selfsigned-issuer
kind: ClusterIssuer
group: cert-manager.io
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: neon-ca-issuer
spec:
ca:
secretName: root-secret

0 comments on commit e9121eb

Please sign in to comment.