Skip to content

Commit 0eef32f

Browse files
committed
feat: remove cert manager
1 parent aa06443 commit 0eef32f

40 files changed

+1498
-496
lines changed

.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: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
uses: actions/setup-go@v5
7979
with:
8080
go-version: 1.23
81+
cache-dependency-path: operator/go.sum
8182
- name: Log in to the Container registry
8283
uses: docker/login-action@v3
8384
with:
@@ -90,6 +91,28 @@ jobs:
9091
with:
9192
version: v0.26.0
9293
install_only: true
94+
- name: Restore cached Binaries
95+
id: cached-binaries
96+
uses: actions/cache/restore@v4
97+
with:
98+
key: ${{ runner.os }}-${{ runner.arch }}-bin-${{ hashFiles('operator/deps.mk') }}
99+
path: |
100+
${{ github.workspace }}/operator/bin
101+
~/.cache/go-build
102+
- name: Install dependencies
103+
if: steps.cached-binaries.outputs.cache-hit != 'true'
104+
run: |
105+
cd operator
106+
make install-deps
107+
- name: Save cached Binaries
108+
id: save-cached-binaries
109+
if: steps.cached-binaries.outputs.cache-hit != 'true'
110+
uses: actions/cache/save@v4
111+
with:
112+
key: ${{ runner.os }}-${{ runner.arch }}-bin-${{ hashFiles('operator/deps.mk') }}
113+
path: |
114+
${{ github.workspace }}/operator/bin
115+
~/.cache/go-build
93116
- name: end-to-end-tests
94117
run: |
95118
cd operator
@@ -131,11 +154,14 @@ jobs:
131154
apt-get update && apt-get install -y make git jq
132155
cd operator
133156
# 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 }}"
157+
git fetch --all
158+
export GIT_SHA=$(git rev-parse --short ${{ github.sha }})
159+
TAGS="-t ${REGISTRY@L}/${{env.IMAGE_NAME}}/operator:${GIT_SHA}"
135160
case ${{ github.ref_type }} in
136161
branch)
137162
# The last tag + current git sha
138-
export OPERATOR_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")+${{ github.sha }}
163+
export OPERATOR_VERSION=$(git tag --list 'operator*' --sort=-v:refname | head -n 1 | cut -d/ -f2 || echo "0.0.0")+${GIT_SHA}
164+
TAGS="$TAGS -t ${REGISTRY@L}/${{env.IMAGE_NAME}}/operator:$(echo "${OPERATOR_VERSION}" | tr + -)"
139165
;;
140166
tag)
141167
# The version part of the tag
@@ -149,7 +175,7 @@ jobs:
149175
esac
150176
set -x
151177
docker buildx build \
152-
--build-arg GIT_SHA=$${{ github.sha }} \
178+
--build-arg GIT_SHA=${GIT_SHA} \
153179
--build-arg VERSION=${OPERATOR_VERSION} \
154180
--build-arg GO_VERSION=${GO_VERSION} \
155181
--push \

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.cursorignore
22
.pytest_cache
3-
.idea
3+
.idea
4+
**/err.txt

.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: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ 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+
- list
18+
- patch
19+
- update
20+
- watch
821
- apiGroups:
922
- ""
1023
resources:
@@ -66,6 +79,18 @@ rules:
6679
- pods/status
6780
verbs:
6881
- get
82+
- apiGroups:
83+
- ""
84+
resources:
85+
- secrets
86+
verbs:
87+
- create
88+
- delete
89+
- get
90+
- list
91+
- patch
92+
- update
93+
- watch
6994
- apiGroups:
7095
- skyhook.nvidia.com
7196
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.

0 commit comments

Comments
 (0)