Skip to content

Commit 8d0012b

Browse files
committed
feat: remove cert manager
this commit will likely break CI, but not exactly how, will address in later commit
1 parent aa06443 commit 8d0012b

34 files changed

Lines changed: 837 additions & 532 deletions

.github/workflows/agent-ci.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,14 @@ jobs:
9898
apt-get update && apt-get install -y make git jq
9999
cd agent
100100
# if this is a tag build, use the tag as the version, otherwise use the sha
101-
TAGS="-t ${REGISTRY@L}/${{env.IMAGE_NAME}}/agent:${{ github.sha }}"
101+
git fetch --all
102+
export GIT_SHA=$(git rev-parse --short ${{ github.sha }})
103+
TAGS="-t ${REGISTRY@L}/${{env.IMAGE_NAME}}/agent:${GIT_SHA}"
102104
case ${{ github.ref_type }} in
103105
branch)
104106
# The last tag + current git sha
105-
export AGENT_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")+${{ github.sha }}
107+
export AGENT_VERSION=$(git tag --list 'agent*' --sort=-v:refname | head -n 1 | cut -d/ -f2 || echo "0.0.0")+${GIT_SHA}
108+
TAGS="$TAGS -t ${REGISTRY@L}/${{env.IMAGE_NAME}}/agent:$(echo "${AGENT_VERSION}" | tr + -)"
106109
;;
107110
tag)
108111
# The version part of the tag

.github/workflows/operator-ci.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,14 @@ jobs:
131131
apt-get update && apt-get install -y make git jq
132132
cd operator
133133
# if this is a tag build, use the tag as the version, otherwise use the sha
134-
TAGS="-t ${REGISTRY@L}/${{env.IMAGE_NAME}}/operator:${{ github.sha }}"
134+
git fetch --all
135+
export GIT_SHA=$(git rev-parse --short ${{ github.sha }})
136+
TAGS="-t ${REGISTRY@L}/${{env.IMAGE_NAME}}/operator:${GIT_SHA}"
135137
case ${{ github.ref_type }} in
136138
branch)
137139
# The last tag + current git sha
138-
export OPERATOR_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")+${{ github.sha }}
140+
export OPERATOR_VERSION=$(git tag --list 'operator*' --sort=-v:refname | head -n 1 | cut -d/ -f2 || echo "0.0.0")+${GIT_SHA}
141+
TAGS="$TAGS -t ${REGISTRY@L}/${{env.IMAGE_NAME}}/operator:$(echo "${OPERATOR_VERSION}" | tr + -)"
139142
;;
140143
tag)
141144
# The version part of the tag
@@ -149,7 +152,7 @@ jobs:
149152
esac
150153
set -x
151154
docker buildx build \
152-
--build-arg GIT_SHA=$${{ github.sha }} \
155+
--build-arg GIT_SHA=${GIT_SHA} \
153156
--build-arg VERSION=${OPERATOR_VERSION} \
154157
--build-arg GO_VERSION=${GO_VERSION} \
155158
--push \

.vscode/launch.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"request": "launch",
1111
"mode": "debug",
1212
"program": "${workspaceRoot}/operator/cmd/main.go",
13+
"cwd": "${workspaceRoot}/operator",
1314
"buildFlags": "--ldflags '-X github.com/NVIDIA/skyhook/internal/version.GIT_SHA=foobars -X github.com/NVIDIA/skyhook/internal/version.VERSION=v0.5.0'",
1415
"env": {
1516
"ENABLE_WEBHOOKS": "false",

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ There are a few pre-built generalist packages available at [NVIDIA/skyhook-packa
5050
## Quick Start
5151

5252
### Install the operator
53-
1. Install cert-manager `kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.15.2/cert-manager.yaml`
5453
1. Create a secret for the operator to pull images `kubectl create secret generic node-init-secret --from-file=.dockerconfigjson=${HOME}/.config/containers/auth.json --type=kubernetes.io/dockerconfigjson -n skyhook`
5554
1. Install the operator `helm install skyhook ./chart --namespace skyhook`
5655

agent/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@ docker-setup:
5656
$(DOCKER_CMD) buildx create --platform linux/amd64,linux/arm64 --use builder
5757
$(DOCKER_CMD) run --privileged --rm tonistiigi/binfmt --install amd64,arm64
5858

59-
ACTUAL_TAGS=$(shell echo "-t $(REGISTRY)/$(AGENT_IMAGE):$(shell date +%y.%m.%d-%H%M%S)-$(COMMIT_SHORT_SHA) $(TAGS)" | tr A-Z a-z)
59+
GIT_SHA=$(shell git rev-parse --short HEAD)
60+
ACTUAL_TAGS=$(shell echo "-t $(REGISTRY)/$(AGENT_IMAGE):$(shell date +%y.%m.%d-%H%M%S)-$(GIT_SHA) $(TAGS)" | tr A-Z a-z)
6061
.PHONY: docker-build-only
6162
docker-build-only:
6263
@echo "Building skyhook-agent $(DOCKER_CMD) image with tags: $(ACTUAL_TAGS)"
63-
$(DOCKER_CMD) buildx build $(BUILD_ARGS) --build-arg AGENT_VERSION=$(AGENT_VERSION) --platform linux/amd64,linux/arm64 $(ACTUAL_TAGS) --metadata-file=metadata.json -f ../containers/agent.Dockerfile .
64+
$(DOCKER_CMD) buildx build $(BUILD_ARGS) --build-arg AGENT_VERSION=$(AGENT_VERSION) \
65+
--build-arg GIT_SHA=$(GIT_SHA) \
66+
--platform linux/amd64,linux/arm64 $(ACTUAL_TAGS) --metadata-file=metadata.json -f ../containers/agent.Dockerfile .
6467

6568
##@ Vendor
6669
.PHONY: vendor

chart/templates/deployment.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@ spec:
108108
{{- end }}
109109
securityContext: {{- toYaml .Values.controllerManager.manager.containerSecurityContext
110110
| nindent 10 }}
111-
volumeMounts:
112-
- mountPath: /tmp/k8s-webhook-server/serving-certs
113-
name: cert
114-
readOnly: true
115111
- args: {{- toYaml .Values.controllerManager.kubeRbacProxy.args | nindent 8 }}
116112
env:
117113
- name: KUBERNETES_CLUSTER_DOMAIN
@@ -132,11 +128,6 @@ spec:
132128
runAsNonRoot: true
133129
serviceAccountName: {{ include "chart.fullname" . }}-controller-manager
134130
terminationGracePeriodSeconds: 10
135-
volumes:
136-
- name: cert
137-
secret:
138-
defaultMode: 420
139-
secretName: webhook-server-cert
140131
{{ if ((.Values.controllerManager.podDisruptionBudget).minAvailable) }}
141132
{{ if ge .Values.controllerManager.podDisruptionBudget.minAvailable .Values.controllerManager.replicas }}
142133
{{- $_ := required "minAvailable to be less than replicas" .nil }}

chart/templates/manager-rbac.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ metadata:
55
labels:
66
{{- include "chart.labels" . | nindent 4 }}
77
rules:
8+
- apiGroups:
9+
- admissionregistration.k8s.io
10+
resources:
11+
- mutatingwebhookconfigurations
12+
- validatingwebhookconfigurations
13+
verbs:
14+
- create
15+
- delete
16+
- get
17+
- patch
18+
- update
819
- apiGroups:
920
- ""
1021
resources:
@@ -66,6 +77,16 @@ rules:
6677
- pods/status
6778
verbs:
6879
- get
80+
- apiGroups:
81+
- ""
82+
resources:
83+
- secrets
84+
verbs:
85+
- create
86+
- delete
87+
- get
88+
- patch
89+
- update
6990
- apiGroups:
7091
- skyhook.nvidia.com
7192
resources:

chart/templates/mutating-webhook-configuration.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

chart/templates/selfsigned-issuer.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

chart/templates/serving-cert.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)