-
Notifications
You must be signed in to change notification settings - Fork 707
GKE to use nodePool instead of nodeConfig #323
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
base: cloud-foundation
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,27 @@ resources: | |
description: my awesome k8s cluster | ||
network: <FIXME:network_name> | ||
subnetwork: <FIXME:subnet_name> | ||
nodeConfig: | ||
oauthScopes: | ||
- https://www.googleapis.com/auth/compute | ||
- https://www.googleapis.com/auth/devstorage.read_only | ||
- https://www.googleapis.com/auth/logging.write | ||
- https://www.googleapis.com/auth/monitoring | ||
nodePools: | ||
- name: uniq1 | ||
initialNodeCount: 1 | ||
config: | ||
localSsdCount: 1 | ||
oauthScopes: | ||
- https://www.googleapis.com/auth/compute | ||
- https://www.googleapis.com/auth/devstorage.read_only | ||
- https://www.googleapis.com/auth/logging.write | ||
- https://www.googleapis.com/auth/monitoring | ||
taints: | ||
- key: mykey1 | ||
value: value1 | ||
effect: NO_SCHEDULE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Specifying https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ |
||
autoscaling: | ||
enabled: True | ||
minNodeCount: 1 | ||
maxNodeCount: 3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This configuration results in unschedulable pods for K8s management pods:
|
||
management: | ||
autoUpgrade: True | ||
autoRepair: True | ||
locations: | ||
- us-east1-c | ||
- us-east1-b |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,45 +15,70 @@ imports: | |
name: gke.py | ||
|
||
resources: | ||
- name: myk8sregional | ||
- name: myk8regprivate | ||
type: gke.py | ||
properties: | ||
clusterLocationType: Regional | ||
region: us-east1 | ||
cluster: | ||
name: myk8sregional | ||
description: my awesome k8s cluster | ||
name: k8v1private | ||
description: k8regional 2 pool | ||
network: <FIXME:network_name> | ||
subnetwork: <FIXME:subnet_name> | ||
intialNodeCount: 1 | ||
initialClusterVersion: 1.10.6-gke.3 | ||
nodeConfig: | ||
localSsdCount: 1 | ||
oauthScopes: | ||
- https://www.googleapis.com/auth/compute | ||
- https://www.googleapis.com/auth/devstorage.read_only | ||
- https://www.googleapis.com/auth/logging.write | ||
- https://www.googleapis.com/auth/monitoring | ||
taints: | ||
- key: mykey1 | ||
value: value1 | ||
effect: NO_SCHEDULE | ||
- key: mykey2 | ||
value: value2 | ||
effect: NO_EXECUTE | ||
subnetwork: <FIXME:subnet_name> | ||
initialClusterVersion: 1.10.6-gke.6 | ||
nodePools: | ||
- name: uniq1 | ||
initialNodeCount: 1 | ||
config: | ||
localSsdCount: 1 | ||
oauthScopes: | ||
- https://www.googleapis.com/auth/compute | ||
- https://www.googleapis.com/auth/devstorage.read_only | ||
- https://www.googleapis.com/auth/logging.write | ||
- https://www.googleapis.com/auth/monitoring | ||
taints: | ||
- key: mykey1 | ||
value: value1 | ||
effect: NO_SCHEDULE | ||
- key: mykey2 | ||
value: value2 | ||
effect: NO_EXECUTE | ||
autoscaling: | ||
enabled: True | ||
minNodeCount: 1 | ||
maxNodeCount: 3 | ||
management: | ||
autoUpgrade: True | ||
autoRepair: True | ||
- name: uniq2 | ||
initialNodeCount: 1 | ||
config: | ||
localSsdCount: 1 | ||
oauthScopes: | ||
- https://www.googleapis.com/auth/compute | ||
- https://www.googleapis.com/auth/devstorage.read_only | ||
- https://www.googleapis.com/auth/logging.write | ||
- https://www.googleapis.com/auth/monitoring | ||
taints: | ||
- key: mykey3 | ||
value: value3 | ||
effect: NO_SCHEDULE | ||
- key: mykey4 | ||
value: value4 | ||
effect: NO_EXECUTE | ||
autoscaling: | ||
enabled: True | ||
minNodeCount: 1 | ||
maxNodeCount: 2 | ||
management: | ||
autoUpgrade: True | ||
autoRepair: True | ||
locations: | ||
- us-east1-c | ||
- us-east1-b | ||
autoScaling: | ||
enabled: True | ||
minNodeCount: 1 | ||
maxNodeCount: 2 | ||
management: | ||
autoUpgrade: True | ||
autoRepair: True | ||
masterAuth: | ||
username: <FIXME:user_name> | ||
password: <FIXME:password> | ||
username: <FIXME:username> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we really be using basic auth here? It's considered a security weakness: https://cloud.google.com/kubernetes-engine/docs/concepts/security-overview Also, trailing backspace might cause confusion in YAML There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was provided as an example and in no means best practice. Also, basic auth is still the default behavior when creating via Gui. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the moment, the GUI cautions against using basic auth with the following message "Basic authentication is not recommended because it provides no confidentiality protection for transmitted credentials". Starting with version 1.12, clusters will have basic authentication and client certificate issuance disabled by default, even via GUI. |
||
password: <FIXME:password> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we really be using basic auth here? It's considered a security weakness: https://cloud.google.com/kubernetes-engine/docs/concepts/security-overview Also, trailing backspace might cause confusion in YAML |
||
loggingService: logging.googleapis.com | ||
monitoringService: monitoring.googleapis.com | ||
privateCluster: True | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,20 @@ resources: | |
description: my awesome k8s cluster | ||
network: <FIXME:network_name> | ||
subnetwork: <FIXME:subnet_name> | ||
nodeConfig: | ||
oauthScopes: | ||
- https://www.googleapis.com/auth/compute | ||
- https://www.googleapis.com/auth/devstorage.read_only | ||
- https://www.googleapis.com/auth/logging.write | ||
- https://www.googleapis.com/auth/monitoring | ||
nodePools: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Malformed YAML, extra-spaces. |
||
- name: uniq1 | ||
initialNodeCount: 1 | ||
config: | ||
localSsdCount: 1 | ||
oauthScopes: | ||
- https://www.googleapis.com/auth/compute | ||
- https://www.googleapis.com/auth/devstorage.read_only | ||
- https://www.googleapis.com/auth/logging.write | ||
- https://www.googleapis.com/auth/monitoring | ||
autoscaling: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are no 'taints' specified for the zonal cluster, but we specify them for global and global private. We should consider being consistent. |
||
enabled: True | ||
minNodeCount: 1 | ||
maxNodeCount: 2 | ||
management: | ||
autoUpgrade: True | ||
autoRepair: True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's best practice to add a line at EOF |
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.
No
initialClusterVersion
value like in other templatesThere 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.
this was because cluster version changes frequently and as an example, this will just default to the default version. the other could probably be changed though.
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.
It might be beneficial to have some consistency among the examples. If a user starts with the gke_regional.yaml example file, and does not know they need to add
initialClusterVersion
themselves (since it's not in the example for gke_regional.yaml), they will end up with a broken default version from gke.py.schema and the following error message:They will then have to figure out themselves which versions are working at the moment and add those to the example themselves, or they will need to go ahead and start modifying the default in gke.py.schema, which is the less elegant but more intuitive thing to do. Both of those seem not ideal.
Additionally, I'm curious why are we specifying
initialClusterVersion
in gke.py as a required parameter (and not an optional one) to begin with?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.
We shouldn't make
initialClusterVersion
a required parameter... I see this in the .py fileCompletely missed it first pass - but this essentially makes this field required.