-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Author: lmercl <lubos.mercl@gmail.com> Date: Wed Nov 10 15:30:04 2021 +0000
- Loading branch information
Showing
5 changed files
with
27 additions
and
8 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# GCP Load Balancers for type=LoadBalacer of Kubernetes Services | ||
|
||
Google Cloud Platform can be used for creation of Kubernetes Service Load Balancer. | ||
|
||
This feature is able to deliver by adding parameters to kube-controller-manager and kubelet. You need specify: | ||
|
||
--cloud-provider=gce | ||
--cloud-config=/etc/kubernetes/cloud-config | ||
|
||
To get working it in kubespray, you need to add tag to GCE instances and specify it in kubespray group vars and also set cloud_provider to gce. So for example, in file group_vars/all/gcp.yml: | ||
|
||
cloud_provider: gce | ||
gce_node_tags: k8s-lb | ||
|
||
When you will setup it and create SVC in Kubernetes with type=LoadBalancer, cloud provider will create public IP and will set firewall. | ||
Note: Cloud provider run under VM service account, so this account needs to have correct permissions to be able to create all GCP resources. |
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
3 changes: 3 additions & 0 deletions
3
roles/kubernetes/node/templates/cloud-configs/gce-cloud-config.j2
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,3 @@ | ||
[global] | ||
node-tags = {{ gce_node_tags }} | ||
|
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