-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support NodePort and LoadBalancer services
* Added a component on the host cluster which watches for NodePort and LoadBalancer services, and dynamically manages a host cluster service with matching ports * Updated e2e tests to use single-stage dockerfile and makefile for reduce build times * Added tests for loadbalancer to k3s test case
- Loading branch information
Showing
14 changed files
with
979 additions
and
124 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,94 @@ | ||
{{- if .Values.loadBalancer.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "kink.lb-manager.fullname" . }} | ||
labels: | ||
{{- include "kink.load-balancer.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.loadBalancer.manager.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "kink.lb-manager.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.loadBalancer.manager.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "kink.lb-manager.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "kink.lb-manager.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.loadBalancer.manager.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: init | ||
securityContext: | ||
{{- toYaml .Values.loadBalancer.manager.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
{{- with .Values.extraEnv }} | ||
{{- . | toYaml | nindent 10 }} | ||
{{- end }} | ||
{{- with .Values.loadBalancer.manager.extraEnv }} | ||
{{- . | toYaml | nindent 10 }} | ||
{{- end }} | ||
command: | ||
- kink | ||
- lb-manager | ||
args: | ||
- --release-config-mount=/etc/kink/release | ||
- --namespace={{ .Release.Namespace }} | ||
- --leader-election-id=$(POD_NAME) | ||
- --guest-kubeconfig=/etc/kink/kubeconfig | ||
resources: | ||
{{- toYaml .Values.loadBalancer.manager.resources | nindent 12 }} | ||
volumeMounts: | ||
- name: release | ||
mountPath: /etc/kink/release | ||
- name: kubeconfig | ||
mountPath: /etc/kink/kubeconfig | ||
subPath: config | ||
{{- with .Values.extraVolumeMounts }} | ||
{{- . | toYaml | nindent 10 }} | ||
{{- end }} | ||
{{- with .Values.loadBalancer.manager.extraVolumeMounts }} | ||
{{- . | toYaml | nindent 10 }} | ||
{{- end }} | ||
|
||
{{- with .Values.loadBalancer.manager.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.loadBalancer.manager.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.loadBalancer.manager.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: release | ||
configMap: | ||
name: {{ include "kink.fullname" . }} | ||
- name: kubeconfig | ||
secret: | ||
secretName: {{ include "kink.kubeconfig.fullname" . }} | ||
{{- with .Values.extraVolumes }} | ||
{{- . | toYaml | nindent 6 }} | ||
{{- end }} | ||
{{- with .Values.worker.extraVolumes }} | ||
{{- . | toYaml | nindent 6 }} | ||
{{- end }} | ||
{{- end }} |
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,39 @@ | ||
{{- if and .Values.loadBalancer.enabled .Values.loadBalancer.manager.rbac.create }} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: {{ include "kink.lb-manager.fullname" . }} | ||
labels: | ||
{{ include "kink.lb-manager.labels" . | nindent 4 }} | ||
rules: | ||
- apiGroups: [''] | ||
resources: ['services'] | ||
verbs: [get,watch,update,patch,delete] | ||
resourceNames: ['{{ include "kink.load-balancer.fullname" . }}'] | ||
- apiGroups: [''] | ||
resources: ['services'] | ||
verbs: [create] | ||
- apiGroups: [coordination.k8s.io] | ||
resources: ['leases'] | ||
verbs: ['*'] | ||
resourceNames: ['{{ include "kink.lb-manager.fullname" . }}'] | ||
- apiGroups: [coordination.k8s.io] | ||
resources: ['leases'] | ||
verbs: ['create'] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ include "kink.lb-manager.fullname" . }} | ||
labels: | ||
{{ include "kink.lb-manager.labels" . | nindent 4 }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: {{ include "kink.lb-manager.fullname" . }} | ||
subjects: | ||
- apiGroup: "" | ||
kind: ServiceAccount | ||
name: {{ include "kink.lb-manager.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespce }} | ||
{{- end }} |
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,12 @@ | ||
{{- if and .Values.loadBalancer.enabled .Values.loadBalancer.manager.serviceAccount.create -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "kink.lb-manager.serviceAccountName" . }} | ||
labels: | ||
{{- include "kink.load-balancer.labels" . | nindent 4 }} | ||
{{- with .Values.loadBalancer.manager.serviceAccount.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} |
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
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
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
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