Skip to content
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

WIP Ingress-gce helm chart #852

Closed
wants to merge 4 commits into from
Closed
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ EFFECTIVE_VERSION := $(VERSION)-$(shell git rev-parse HEAD)
LD_FLAGS := "-w $(shell bash $(GARDENER_HACK_DIR)/get-build-ld-flags.sh k8s.io/component-base $(REPO_ROOT)/VERSION $(EXTENSION_PREFIX))"
LEADER_ELECTION := false
IGNORE_OPERATION_ANNOTATION := true
PLATFORM := linux/amd64
PLATFORM := linux/amd64
TEST_RECONCILER := tf

WEBHOOK_CONFIG_PORT := 8443
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: Helm chart for ingress-gce
name: ingress-gce
version: 0.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ingress-gce
namespace: {{ .Release.Namespace }}
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
labels:
app: kubernetes
role: glbc
spec:
revisionHistoryLimit: 0
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: kubernetes
role: glbc
template:
metadata:
{{- if .Values.podAnnotations }}
annotations:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
labels:
app: kubernetes
role: glbc
gardener.cloud/role: controlplane
networking.gardener.cloud/to-dns: allowed
networking.gardener.cloud/to-public-networks: allowed
networking.resources.gardener.cloud/to-kube-apiserver-tcp-443: allowed
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }}
{{- end }}
spec:
automountServiceAccountToken: false
serviceAccountName: glbc
containers:
- name: glbc
image: {{ index .Values.images "ingress-gce" }}
command:
- /glbc
- --config-file-path=/etc/kubernetes/cloudprovider/cloudprovider.conf
- --healthz-port=8086
- --logtostderr
- --sync-period=600s
- --default-backend-service=kube-system/default-http-backend
- --running-in-cluster=false
- --run-l4-netlb-controller=true
- --enable-l4ilb-dual-stack=true
- --enable-l4netlb-dual-stack=true
# services of Type:LoadBalancer with Internal annotation `cloud.google.com/l4-rbs: enabled`
# will be processed by this controller
- --run-l4-controller=true
- --kubeconfig=/var/run/secrets/gardener.cloud/shoot/generic-kubeconfig/kubeconfig
- --leader-elect=true
- --v=2
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /srv/cloudprovider/serviceaccount.json
livenessProbe:
httpGet:
path: /healthz
port: 8086
scheme: HTTP
initialDelaySeconds: 30
# healthz reaches out to GCE
periodSeconds: 30
timeoutSeconds: 15
successThreshold: 1
failureThreshold: 5
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
{{- with .Values.resources }}
resources:
{{ toYaml . | indent 12 }}
{{- end }}
volumeMounts:
- name: cloud-provider-config
mountPath: /etc/kubernetes/cloudprovider
- name: cloudprovider
mountPath: /srv/cloudprovider
- name: kubeconfig
mountPath: /var/run/secrets/gardener.cloud/shoot/generic-kubeconfig
readOnly: true
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30
volumes:
- name: cloud-provider-config
configMap:
name: cloud-provider-config
- name: cloudprovider
secret:
secretName: cloudprovider
- name: kubeconfig
projected:
defaultMode: 420
sources:
- secret:
items:
- key: kubeconfig
path: kubeconfig
name: {{ .Values.global.genericTokenKubeconfigSecretName }}
optional: false
- secret:
items:
- key: token
path: token
name: shoot-access-cloud-controller-manager
optional: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: glbc
namespace: {{ .Release.Namespace }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: ingress-gce
namespace: {{ .Release.Namespace }}
spec:
targetRef:
apiVersion: {{ include "deploymentversion" . }}
kind: Deployment
name: ingress-gce
updatePolicy:
updateMode: Auto
resourcePolicy:
containerPolicies:
- containerName: glbc
minAllowed:
memory: {{ .Values.resources.requests.memory }}
maxAllowed:
cpu: {{ .Values.vpa.resourcePolicy.maxAllowed.cpu }}
memory: {{ .Values.vpa.resourcePolicy.maxAllowed.memory }}
controlledValues: RequestsOnly
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
replicas: 1

images:
ingress-gce: image-repository:image-tag

resources:
requests:
cpu: 100m
memory: 75Mi

vpa:
resourcePolicy:
maxAllowed:
cpu: 1
memory: 2G

podAnnotations: {}
podLabels: {}
4 changes: 4 additions & 0 deletions charts/internal/seed-controlplane/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ dependencies:
repository: http://localhost:10191
version: 0.1.0
condition: csi-driver-controller.enabled
- name: ingress-gce
repository: http://localhost:10191
version: 0.1.0
condition: ingress-gce.enabled
2 changes: 2 additions & 0 deletions charts/internal/seed-controlplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ cloud-controller-manager:
enabled: true
csi-driver-controller:
enabled: true
ingress-gce:
enabled: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I saw during testing/playing around with this controller, I'd rather not have it enabled by default. In my opinion that should be an option, unless there are cases where it needs to be deployed.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: Helm chart for default-http-backend
name: default-http-backend
version: 0.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: l7-default-backend
namespace: {{ .Release.Namespace }}
labels:
k8s-app: glbc
kubernetes.io/name: "GLBC"
app: kubernetes
role: ingress-gce
spec:
replicas: 1
selector:
matchLabels:
k8s-app: glbc
template:
metadata:
labels:
k8s-app: glbc
name: glbc
spec:
containers:
- name: default-http-backend
# Any image is permissible as long as:
# 1. It serves a 404 page at /
# 2. It serves 200 on a /healthz endpoint
image: {{ index .Values.images "default-http-backend" }}
livenessProbe:
httpGet:
path: /healthy
port: 8080
scheme: HTTP
initialDelaySeconds: 30
timeoutSeconds: 5
ports:
- containerPort: 8080
resources:
limits:
cpu: 10m
memory: 20Mi
requests:
cpu: 10m
memory: 20Mi
---
apiVersion: v1
kind: Service
metadata:
# This must match the --default-backend-service argument of the l7 lb
# controller and is required because GCE mandates a default backend.
name: default-http-backend
namespace: {{ .Release.Namespace }}
labels:
k8s-app: glbc
kubernetes.io/name: "GLBCDefaultBackend"
spec:
# The default backend must be of type NodePort.
type: NodePort
ports:
- port: 80
targetPort: 8080
protocol: TCP
name: http
selector:
k8s-app: glbc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: glbc
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: system:controller:glbc
namespace: {{ .Release.Namespace }}
labels:
addonmanager.kubernetes.io/mode: Reconcile
rules:
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list", "watch", "update", "create", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: system:controller:glbc
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: system:controller:glbc
subjects:
- kind: ServiceAccount
name: glbc
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: system:controller:glbc
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get"]
- apiGroups: [""]
resources: ["events"]
verbs: ["get", "list", "watch", "update", "create", "patch"]
- apiGroups: [""]
resources: ["endpoints", "services", "pods", "nodes", "namespaces"]
verbs: ["get", "list", "watch"]
# TODO: switch to patch services/status
# https://github.com/kubernetes/ingress-gce/blob/4918eb2f0f484f09ac9e5a975907a9b16ed2b344/pkg/neg/controller.go#L339-L342
# https://github.com/kubernetes/ingress-gce/blob/4918eb2f0f484f09ac9e5a975907a9b16ed2b344/pkg/neg/controller.go#L359-L361
- apiGroups: [""]
resources: ["services", "pods"]
verbs: ["update", "patch"]
- apiGroups: ["networking.istio.io"]
resources: ["destinationrules"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["extensions", "networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["extensions", "networking.k8s.io"]
resources: ["ingresses"]
verbs: ["update"]
- apiGroups: ["extensions", "networking.k8s.io"]
resources: ["ingresses/status"]
verbs: ["update"]
# GLBC ensures that the `cloud.google.com/backendconfigs` CRD exists in a desired state:
# https://github.com/kubernetes/ingress-gce/blob/4918eb2f0f484f09ac9e5a975907a9b16ed2b344/cmd/glbc/main.go#L93
# TODO(rramkumar1): https://github.com/kubernetes/ingress-gce/issues/744
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["get", "list", "watch", "update", "create", "patch"]
- apiGroups: ["cloud.google.com"]
resources: ["backendconfigs"]
verbs: ["get", "list", "watch", "update", "create", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: system:controller:glbc
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:controller:glbc
subjects:
- kind: ServiceAccount
name: glbc
namespace: {{ .Release.Namespace }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
replicas: 1

images:
default-http-backend: image-repository:image-tag

podAnnotations: {}
podLabels: {}
4 changes: 4 additions & 0 deletions charts/internal/shoot-system-components/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ dependencies:
repository: http://locwalhost:10191
version: 0.1.0
condition: csi-driver-node.enabled
- name: default-http-backend
repository: http://localhost:10191
version: 0.1.0
condition: default-http-backend.enabled
2 changes: 2 additions & 0 deletions charts/internal/shoot-system-components/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ cloud-controller-manager:
enabled: true
csi-driver-node:
enabled: true
default-http-backend:
enabled: true
26 changes: 26 additions & 0 deletions imagevector/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,29 @@ images:
confidentiality_requirement: 'low'
integrity_requirement: 'high'
availability_requirement: 'low'
- name: ingress-gce
sourceRepository: github.com/kubernetes/ingress-gce
repository: ghcr.io/gardener/ingress-gce
tag: "v1.30.5"
labels:
- name: 'gardener.cloud/cve-categorisation'
value:
network_exposure: 'private'
authentication_enforced: false
user_interaction: 'end-user'
confidentiality_requirement: 'low'
integrity_requirement: 'high'
availability_requirement: 'low'
- name: default-http-backend
sourceRepository: github.com/kubernetes/ingress-gce
repository: europe-docker.pkg.dev/gardener-project/releases/gardener/ingress-default-backend
tag: "0.20.0"
labels:
- name: 'gardener.cloud/cve-categorisation'
value:
network_exposure: 'protected'
authentication_enforced: false
user_interaction: 'end-user'
confidentiality_requirement: 'low'
integrity_requirement: 'high'
availability_requirement: 'low'
Loading
Loading