-
Notifications
You must be signed in to change notification settings - Fork 85
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
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
charts/internal/seed-controlplane/charts/ingress-gce/Chart.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
111 changes: 111 additions & 0 deletions
111
charts/internal/seed-controlplane/charts/ingress-gce/templates/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
5 changes: 5 additions & 0 deletions
5
charts/internal/seed-controlplane/charts/ingress-gce/templates/service-account.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: glbc | ||
namespace: {{ .Release.Namespace }} |
21 changes: 21 additions & 0 deletions
21
charts/internal/seed-controlplane/charts/ingress-gce/templates/vpa.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
18 changes: 18 additions & 0 deletions
18
charts/internal/seed-controlplane/charts/ingress-gce/values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ cloud-controller-manager: | |
enabled: true | ||
csi-driver-controller: | ||
enabled: true | ||
ingress-gce: | ||
enabled: true | ||
4 changes: 4 additions & 0 deletions
4
charts/internal/shoot-system-components/charts/default-http-backend/Chart.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
64 changes: 64 additions & 0 deletions
64
...l/shoot-system-components/charts/default-http-backend/templates/default-http-backend.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
86 changes: 86 additions & 0 deletions
86
charts/internal/shoot-system-components/charts/default-http-backend/templates/rbac.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
7 changes: 7 additions & 0 deletions
7
charts/internal/shoot-system-components/charts/default-http-backend/values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ cloud-controller-manager: | |
enabled: true | ||
csi-driver-node: | ||
enabled: true | ||
default-http-backend: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.