Skip to content

Commit

Permalink
Vendor [email protected] and Upgrade go,k8s.io/* dependencies and…
Browse files Browse the repository at this point in the history
… `controller-runtime` (#213)

* Vendor `[email protected]`

* Rename generate script filename

* Adapt repo change for gomock

* Adapt changes for the managedresource builder

* Use gardener v1.77.2 for e2e tests

* Refactor imagevector package to conform to usage pattern in gardener/gardener

* Drop version tpl files

* Run `make generate`

* Delete util-templates

* Vendor `[email protected]`

* Drop symlink in charts

* -----------------Empty separator commit----------------

* Update go.mod to 1.21

* Vendor `[email protected]`

Upgrade `k8s.io/*` dependencies and `controller-runtime`

* Adapt changes to the Manager

* Adapt changes to NodeLocalDNS

* Run `make generate`

* Use `[email protected]` for e2e tests

* Embed remaining charts and drop copying charts to the container

* Use `autoscaling.k8s.io/v1` API for VPA

* Do not duplicate the configMap
  • Loading branch information
shafeeqes authored Oct 16, 2023
1 parent 00e3791 commit 625dfee
Show file tree
Hide file tree
Showing 1,318 changed files with 102,137 additions and 42,644 deletions.
2 changes: 2 additions & 0 deletions .ci/set_dependency_version
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

set -e

$(dirname $0)"/../vendor/github.com/gardener/gardener/hack/.ci/set_dependency_version
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
!docs/
!example/
!hack/
!imagevector/
!pkg/
!test/
!tools/
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ RUN make install EFFECTIVE_VERSION=$EFFECTIVE_VERSION
FROM gcr.io/distroless/static-debian11:nonroot AS gardener-extension-networking-cilium
WORKDIR /

COPY charts /charts
COPY --from=builder /go/bin/gardener-extension-networking-cilium /gardener-extension-networking-cilium
ENTRYPOINT ["/gardener-extension-networking-cilium"]

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ check: $(GOIMPORTS) $(GOLANGCI_LINT) $(HELM)

.PHONY: generate
generate: $(CONTROLLER_GEN) $(GEN_CRD_API_REFERENCE_DOCS) $(HELM) $(MOCKGEN) $(YQ)
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/generate.sh ./charts/... ./cmd/... ./pkg/...
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/generate-sequential.sh ./charts/... ./cmd/... ./pkg/...
$(MAKE) format

.PHONY: format
Expand Down
17 changes: 12 additions & 5 deletions charts/images.go → charts/charts.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
// Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -14,8 +14,15 @@

package charts

import _ "embed"
import (
"embed"
_ "embed"
)

// ImagesYAML contains the contents of the images.yaml file.
//go:embed images.yaml
var ImagesYAML string
// InternalChart embeds the internal charts in embed.FS
//
//go:embed internal
var InternalChart embed.FS

// InternalChartsPath is the path to the internal charts
const InternalChartsPath = "internal"
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- printf "%s:%s" .repository .tag }}
{{- end }}
{{- end }}

{{- define "deploymentversion" -}}
apps/v1
{{- end -}}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- printf "%s:%s" .repository .tag }}
{{- end }}
{{- end }}

{{- define "deploymentversion" -}}
apps/v1
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: {{ include "poddisruptionbudgetversion" . }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "name" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- printf "%s:%s" .repository .tag }}
{{- end }}
{{- end }}

{{- define "deploymentversion" -}}
apps/v1
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,3 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- printf "%s:%s" .Values.image.repository .Values.image.tag }}
{{- end }}
{{- end }}

{{- define "deploymentversion" -}}
apps/v1
{{- end -}}

{{- define "poddisruptionbudgetversion" -}}
policy/v1
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /gardener-extension-networking-cilium
- --leader-election-resource-lock={{ .Values.leaderElection.resourceLock }}
- --max-concurrent-reconciles={{ .Values.controller.concurrentSyncs }}
- --healthcheck-max-concurrent-reconciles={{ .Values.controller.healthcheck.concurrentSyncs }}
- --heartbeat-namespace={{ .Release.Namespace }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: {{ include "poddisruptionbudgetversion" . }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: gardener-extension-networking-cilium
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.vpa.enabled }}
apiVersion: "autoscaling.k8s.io/v1beta2"
apiVersion: "autoscaling.k8s.io/v1"
kind: VerticalPodAutoscaler
metadata:
name: gardener-extension-networking-cilium-vpa
Expand Down
3 changes: 0 additions & 3 deletions charts/gardener-extension-networking-cilium/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ controller:
renewIntervalSeconds: 30
ignoreOperationAnnotation: false

leaderElection:
resourceLock: leases

config:
clientConnection:
acceptContentTypes: application/json
Expand Down
1 change: 0 additions & 1 deletion charts/internal/cilium-monitoring/charts/util-templates

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: {{ include "rbacversion" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cilium
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: {{ include "rbacversion" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cilium
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions charts/internal/cilium/charts/agent/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: {{ include "daemonsetversion" . }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: cilium
Expand All @@ -16,7 +16,7 @@ spec:
template:
metadata:
annotations:
checksum/configmap-cilium: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/configmap-cilium: "{{ .Values.global.configMapHash }}"
{{- if and .Values.global.prometheus.enabled (not .Values.global.prometheus.serviceMonitor.enabled) }}
prometheus.io/port: "{{ .Values.global.prometheus.port }}"
prometheus.io/scrape: "true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: {{ include "rbacversion" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: hubble-relay
Expand All @@ -20,7 +20,7 @@ rules:
- list
- watch
---
apiVersion: {{ include "rbacversion" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: hubble-generate-certs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: {{ include "rbacversion" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: hubble-relay
Expand All @@ -14,7 +14,7 @@ subjects:
name: hubble-relay
namespace: {{ .Release.Namespace }}
---
apiVersion: {{ include "rbacversion" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: hubble-generate-certs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: {{ include "deploymentversion" .}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: {{ include "rbacversion" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: hubble-ui
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: {{ include "rbacversion" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: hubble-ui
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: {{ include "deploymentversion" .}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: {{ include "ingressversion" . }}
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: hubble-ui
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: {{ include "rbacversion" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cilium-operator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: {{ include "rbacversion" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cilium-operator
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: {{ include "deploymentversion" . }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: cilium-operator
Expand Down Expand Up @@ -27,7 +27,7 @@ spec:
template:
metadata:
annotations:
checksum/configmap-cilium: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/configmap-cilium: "{{ .Values.global.configMapHash }}"
{{- if and .Values.global.prometheus.enabled (not .Values.global.prometheus.serviceMonitor.enabled) }}
prometheus.io/port: {{ .Values.global.operatorPrometheus.port | quote }}
prometheus.io/scrape: "true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: {{ include "poddisruptionbudgetversion" . }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: cilium-operator
Expand Down
1 change: 0 additions & 1 deletion charts/internal/cilium/charts/utils-templates

This file was deleted.

2 changes: 0 additions & 2 deletions charts/internal/cilium/requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
dependencies:
- name: agent
condition: requirements.agent.enabled
- name: config
condition: requirements.config.enabled
- name: operator
condition: requirements.operator.enabled
- name: hubble-ui
Expand Down
6 changes: 2 additions & 4 deletions charts/internal/cilium/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ requirements:
agent:
enabled: true

# Include the cilium-config ConfigMap
config:
enabled: true

# Include the cilium-operator Deployment
operator:
enabled: true
Expand All @@ -17,6 +13,8 @@ requirements:

# global groups all configuration options that have effect on all sub-charts
global:
configMapHash: ""

egressGateway:
enabled: false

Expand Down
4 changes: 0 additions & 4 deletions charts/utils-templates/Chart.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions charts/utils-templates/README.md

This file was deleted.

Loading

0 comments on commit 625dfee

Please sign in to comment.