Skip to content

Commit

Permalink
chore: Drop conversion webhooks (#1598)
Browse files Browse the repository at this point in the history
  • Loading branch information
jigisha620 authored Aug 27, 2024
1 parent 38c2854 commit d7c8ccf
Show file tree
Hide file tree
Showing 26 changed files with 4 additions and 1,966 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ verify: ## Verify code. Includes codegen, docgen, dependencies, linting, formatt
hack/validation/status.sh
cp -r pkg/apis/crds kwok/charts
hack/kwok/requirements.sh
hack/kwok/conversion.sh
hack/dependabot.sh
@# Use perl instead of sed due to https://stackoverflow.com/questions/4247068/sed-command-with-i-option-failing-on-mac-but-works-on-linux
@# We need to do this "sed replace" until controller-tools fixes this parameterized types issue: https://github.com/kubernetes-sigs/controller-tools/issues/756
Expand Down
7 changes: 2 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/docker/docker v27.1.2+incompatible
github.com/go-logr/logr v1.4.2
github.com/imdario/mergo v0.3.16
github.com/klauspost/compress v1.17.9 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2
github.com/onsi/ginkgo/v2 v2.20.1
github.com/onsi/gomega v1.34.1
Expand All @@ -18,7 +19,7 @@ require (
github.com/samber/lo v1.47.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
golang.org/x/sync v0.8.0
golang.org/x/sync v0.8.0 // indirect
golang.org/x/text v0.17.0
golang.org/x/time v0.6.0
k8s.io/api v0.30.3
Expand All @@ -34,13 +35,10 @@ require (
sigs.k8s.io/controller-runtime v0.18.5
)

require github.com/klauspost/compress v1.17.9 // indirect

require (
contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect
contrib.go.opencensus.io/exporter/prometheus v0.4.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/blendle/zapdriver v1.3.1 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
Expand Down Expand Up @@ -83,7 +81,6 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/automaxprocs v1.4.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE=
github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
Expand Down Expand Up @@ -326,8 +324,6 @@ go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0=
go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
Expand Down
5 changes: 0 additions & 5 deletions hack/kwok/conversion.sh

This file was deleted.

2 changes: 0 additions & 2 deletions kwok/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,4 @@ For full Karpenter documentation please checkout [https://karpenter.sh](https://
| terminationGracePeriodSeconds | string | `nil` | Override the default termination grace period for the pod. |
| tolerations | list | `[{"key":"CriticalAddonsOnly","operator":"Exists"}]` | Tolerations to allow the pod to be scheduled to nodes with taints. |
| topologySpreadConstraints | list | `[{"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"ScheduleAnyway"}]` | Topology spread constraints to increase the controller resilience by distributing pods across the cluster zones. If an explicit label selector is not provided one will be created from the pod selector labels. |
| webhook.enabled | bool | `true` | Whether to enable the webhooks and webhook permissions. |
| webhook.port | int | `8443` | The container port to use for the webhook. |

11 changes: 0 additions & 11 deletions kwok/charts/crds/karpenter.sh_nodeclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -816,14 +816,3 @@ spec:
storage: false
subresources:
status: {}
conversion:
strategy: Webhook
webhook:
conversionReviewVersions:
- v1beta1
- v1
clientConfig:
service:
name: karpenter
namespace: kube-system
port: 8443
11 changes: 0 additions & 11 deletions kwok/charts/crds/karpenter.sh_nodepools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1063,14 +1063,3 @@ spec:
storage: false
subresources:
status: {}
conversion:
strategy: Webhook
webhook:
conversionReviewVersions:
- v1beta1
- v1
clientConfig:
service:
name: karpenter
namespace: kube-system
port: 8443
15 changes: 0 additions & 15 deletions kwok/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,6 @@ spec:
value: "1.19.0-0"
- name: KARPENTER_SERVICE
value: {{ include "karpenter.fullname" . }}
{{- if .Values.webhook.enabled }}
- name: WEBHOOK_PORT
value: "{{ .Values.webhook.port }}"
- name: DISABLE_WEBHOOK
value: "false"
{{- end }}
{{- if not .Values.webhook.enabled }}
- name: DISABLE_WEBHOOK
value: "true"
{{- end }}
{{- with .Values.logLevel }}
- name: LOG_LEVEL
value: "{{ . }}"
Expand Down Expand Up @@ -128,11 +118,6 @@ spec:
- name: http
containerPort: {{ .Values.controller.healthProbe.port }}
protocol: TCP
{{- if .Values.webhook.enabled }}
- name: https-webhook
containerPort: {{ .Values.webhook.port }}
protocol: TCP
{{- end }}
livenessProbe:
initialDelaySeconds: 30
timeoutSeconds: 30
Expand Down
13 changes: 0 additions & 13 deletions kwok/charts/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@ rules:
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch"]
{{- if .Values.webhook.enabled }}
- apiGroups: [""]
resources: ["configmaps", "secrets"]
verbs: ["get", "list", "watch"]
{{- end}}
# Write
{{- if .Values.webhook.enabled }}
- apiGroups: [""]
resources: ["secrets"]
verbs: ["update"]
resourceNames:
- "{{ include "karpenter.fullname" . }}-cert"
{{- end }}
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["patch", "update"]
Expand Down
14 changes: 0 additions & 14 deletions kwok/charts/templates/secret-webhook-cert.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions kwok/charts/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,5 @@ spec:
port: {{ .Values.controller.metrics.port }}
targetPort: http-metrics
protocol: TCP
{{- if .Values.webhook.enabled }}
- name: https-webhook
port: {{ .Values.webhook.port }}
targetPort: https-webhook
protocol: TCP
{{- end }}
selector:
{{- include "karpenter.selectorLabels" . | nindent 4 }}
5 changes: 0 additions & 5 deletions kwok/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ controller:
healthProbe:
# -- The container port to use for http health probe.
port: 8081
webhook:
# -- Whether to enable the webhooks and webhook permissions.
enabled: true
# -- The container port to use for the webhook.
port: 8443
# -- Global log level, defaults to 'info'
logLevel: info
# -- Global Settings to configure Karpenter
Expand Down
4 changes: 1 addition & 3 deletions kwok/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
kwok "sigs.k8s.io/karpenter/kwok/cloudprovider"
"sigs.k8s.io/karpenter/pkg/controllers"
"sigs.k8s.io/karpenter/pkg/operator"
"sigs.k8s.io/karpenter/pkg/webhooks"
)

func main() {
Expand All @@ -34,12 +33,11 @@ func main() {

cloudProvider := kwok.NewCloudProvider(ctx, op.GetClient(), instanceTypes)
op.
WithWebhooks(ctx, webhooks.NewWebhooks()...).
WithControllers(ctx, controllers.NewControllers(
op.Manager,
op.Clock,
op.GetClient(),
op.EventRecorder,
cloudProvider,
)...).Start(ctx, cloudProvider)
)...).Start(ctx)
}
178 changes: 0 additions & 178 deletions pkg/apis/v1/nodeclaim_conversion.go

This file was deleted.

Loading

0 comments on commit d7c8ccf

Please sign in to comment.