Skip to content

Remove CSR check from deploy-config #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
*.swp
.idea
amazon-eks-pod-identity-webhook
deploy/mutatingwebhook-ca-bundle.yaml
deploy/deployment.yaml
build
/certs/
Expand Down
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,30 +70,21 @@ cluster-up: deploy-config
cluster-down: delete-config

prep-config:
@echo 'Generating certs and deploying into active cluster...'
@echo 'Deploying into active cluster...'
cat deploy/deployment-base.yaml | sed -e "s|IMAGE|${IMAGE}|g" | tee deploy/deployment.yaml
cat deploy/mutatingwebhook.yaml | hack/webhook-patch-ca-bundle.sh > deploy/mutatingwebhook-ca-bundle.yaml

deploy-config: prep-config
@echo 'Applying configuration to active cluster...'
kubectl apply -f deploy/auth.yaml
kubectl apply -f deploy/deployment.yaml
kubectl apply -f deploy/service.yaml
kubectl apply -f deploy/mutatingwebhook-ca-bundle.yaml
until kubectl get csr -o \
jsonpath='{.items[?(@.spec.username=="system:serviceaccount:default:pod-identity-webhook")].metadata.name}' | \
grep -m 1 "csr-"; \
do echo "Waiting for CSR to be created" && sleep 1 ; \
done
kubectl certificate approve $$(kubectl get csr -o jsonpath='{.items[?(@.spec.username=="system:serviceaccount:default:pod-identity-webhook")].metadata.name}')

delete-config:
@echo 'Tearing down mutating controller and associated resources...'
kubectl delete -f deploy/mutatingwebhook-ca-bundle.yaml
kubectl delete -f deploy/service.yaml
kubectl delete -f deploy/deployment.yaml
kubectl delete -f deploy/auth.yaml
kubectl delete secret pod-identity-webhook
kubectl delete secret pod-identity-webhook-cert

clean::
rm -rf ./amazon-eks-pod-identity-webhook
Expand Down
19 changes: 0 additions & 19 deletions hack/webhook-patch-ca-bundle.sh

This file was deleted.