Commit Graph

56 Commits

Author SHA1 Message Date
Bharath Vedartham 5c9b688984 validate_cluster: Create node to instance group mapping to get pod instance group
In the ValidationError struct, there is a field to identify the instance group to
which the ValidationError is associated with.

For pod related ValidationErrors, it is not straightforward to identify the
instance group to which the pod is associated with.

To acheive this, we create a node to instance group mapping in ValidateNodes.
This node to instance group mapping is used in collectPodFailures to identify the
pod instance group by using the pod's hostIp field.

We don't associate system-cluster-critical pods to instance groups as those pod
failures are cluster wide
2020-11-15 11:06:03 +05:30
Kubernetes Prow Robot 01b17be97e
Merge pull request #10221 from eddycharly/fix-validation
Fix cluster validation dependency on local kubeconfig
2020-11-14 14:17:03 -08:00
Charles-Edouard Brétéché 116af0c74b pass host only instead of the whole config 2020-11-12 08:37:51 +01:00
Charles-Edouard Brétéché 709e1b6cbd Fix cluster validation dependency on local kubeconfig 2020-11-11 21:11:54 +01:00
John Gardiner Myers c2434a2e08 Remove components from cluster validation 2020-11-10 23:36:46 -08:00
Bharath Vedartham 49f2a0e10a validate_cluster: Add InstanceGroup field to ValidationError struct
The InstanceGroup field in ValidationError struct is an optional field meant
to indicate the InstanceGroup which has reported that failure. This field either
holds a pointer to the instance group which caused the validation error or can be
nil which indicates that we were unable to determine the instance group to which
this failure should be attributed to.

This field is mainly used to identify whether a failure is worth waiting for
when validating a particular instance group.
2020-10-31 19:16:42 +05:30
John Gardiner Myers ca241a5193 Don't require PriorityClassName to pass missing-static-pod checks 2020-10-13 22:42:11 -07:00
Ole Markus With 0ec71686b9 Refactor cloudinstancegroupmember in a more independent cloud instance representation
Apply suggestions from code review

Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
2020-08-30 21:37:03 +02:00
Peter Rifel 4d9f0128a3
Upgrade to klog2
This splits up the kubernetes 1.19 PR to make it easier to keep up to date until we get it sorted out.
2020-08-16 20:56:48 -05:00
John Gardiner Myers a760080f01 Prefer the GA label for node zone 2020-06-14 16:35:57 -07:00
Kubernetes Prow Robot a454f0ff83
Merge pull request #9118 from johngmyers/validate-missing-asg
Return cluster validation failure if ASG missing
2020-05-13 14:36:23 -07:00
John Gardiner Myers 154833e652 Fail cluster validation if too few nodes for ig's target size 2020-05-12 22:28:26 -07:00
John Gardiner Myers 23d48f01d6 Return cluster validation failure if ASG missing 2020-05-11 21:19:02 -07:00
John Gardiner Myers 06376302e4 Don't test static pods on non-ready nodes 2020-05-02 22:09:53 -07:00
John Gardiner Myers c524290f9e Test more static pods during cluster validation 2020-05-02 22:09:53 -07:00
Justin Santa Barbara 31bb16d4d1 Add context.Context to most signatures
The client-go signature for most methods adds a context.Context
object, and also makes Options mandatory.  Feed through a
context.Context through many of our methods (but use context.TODO to
stop it getting totally out of hand!)
2020-04-11 14:44:17 -04:00
Kubernetes Prow Robot a210ec9649
Merge pull request #8446 from johngmyers/validate-priority
Use PriorityClassName instead of namespace in cluster validation
2020-03-11 10:09:37 -07:00
John Gardiner Myers 1b7c5139e0 Merge branch 'master' into surge 2020-03-03 17:53:18 -08:00
John Gardiner Myers a99ef7c8d2 Handle Unknown pod phase in cluster validation 2020-02-25 21:04:40 -08:00
John Gardiner Myers c557289c4b Use PriorityClassName instead of namespace in cluster validation 2020-02-25 21:04:37 -08:00
John Gardiner Myers 8148f2da69 Fail cluster validation if a master missing kube-controller-manager 2020-02-20 21:50:11 -08:00
John Gardiner Myers be12d88cc3 Detached instances don't count against instancegroup minimums 2020-01-27 20:15:11 -08:00
John Gardiner Myers 80dc001b23 Determine node role from instancegroup spec 2019-12-18 21:47:16 -08:00
John Gardiner Myers bd4e1277ae Pass the cloud object to validator from caller 2019-11-13 22:19:55 -08:00
John Gardiner Myers 55f4fcb419 Extract the list of instance groups earlier in validation 2019-11-13 22:08:52 -08:00
John Gardiner Myers 63e0c5e726 Add tests for cluster validation during rolling update 2019-11-04 16:26:39 -08:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04:00
Justin SB 3e33ac7682
Change code from glog to klog
We don't call klog.InitFlags yet, because that will cause a flag
redefinition error until we get everyone to stop using glog.  That
will happen when we update to k8s 1.13.
2019-05-06 12:54:51 -04:00
Derek Lemon -T (delemon - AEROTEK INC at Cisco) 4f0169bb79 codegen 2019-01-16 09:30:40 -07:00
Justin Santa Barbara 83f40e0334 Fix missed error check in hasPlaceHolderIP 2018-12-25 10:53:50 -05:00
Justin Santa Barbara f49aba4147
Consider pending pods to be a validation failure
Also log the names of the non-ready containers.
2018-12-20 10:08:40 -05:00
Justin SB a96a58ac78
Include name of unhealthy component in validation error
Rolling-update just prints the message, and indeed I think the message
should be self-contained.
2018-11-27 09:53:40 -05:00
Raffaele Di Fazio d477e96c38 Added initial implementation of ACM cert for Kubernetes API ELB 2018-07-06 09:29:54 +02:00
Brad Kim 967f1e86c6 Fix for validating kubeconfig's hosts
URL's Host field is "host" or "host:port". (see https://golang.org/pkg/net/url/#URL )
"host:port" can't be used as net.LookupHost's parameter.
I recommend using URL.Hostname() instead of URL.Host.
2018-05-03 11:48:51 +09:00
Haoyun f8e4c3e33e
typo fix
typo fix
2018-04-03 10:48:02 +08:00
Justin Santa Barbara 875942ae64 Validation: don't expect bastion nodes to join
Fix #4761
2018-03-24 13:59:29 -04:00
Justin Santa Barbara 63e51337c0 Validation: treat as error if insufficient nodes
We switch to use the rolling update logic, which gives us nodes by
InstanceGroup.
2018-03-20 23:28:27 -04:00
Justin Santa Barbara 02d9819785 Move DNS validation into validation 2018-03-20 19:56:36 -04:00
k8s-ci-robot 717eb4f6c5
Merge pull request #4734 from justinsb/int_validation_fix_3
Validation: Take a cluster object, not just the name
2018-03-20 13:25:02 -07:00
Justin Santa Barbara 1b0f5a4101 Validation: clean up unused node status functions 2018-03-20 01:16:48 -04:00
Justin Santa Barbara 55e3a5f212 Validation: Take a cluster object, not just the name 2018-03-20 01:12:07 -04:00
chrislovecnm 7cb9384d70 kops validate clsuter can output YAML or JSON
Adding the capbility for kops validate cluster command to output YAML or JSON.
The validate.ValidationCluster struct is used as body of the JSON or
YAML document.
2017-12-19 23:07:55 -07:00
Ian Hoegen 9ea5008da4 Make node counts and master counts autoscale friendly 2017-12-12 08:42:28 -08:00
chrislovecnm c7ef856f92 Improving UX for kops validate cluster
Before the `kops validate cluster` attempts to connect to the K8s API
endpoint, the code now checks to see if the API DNS Entry is the kops
placeholder IP Address 203.0.113.123.  It prints a message to the user
and err's.  There is a new init func in validate cluster that disables
CGO based DNS for Darwin OS.  Darwin does two things with kops
validates; it caches the IP address, and it does not return the
placeholder IP address.  We cannot use CGO base DNS with kops validate.
2017-11-16 15:12:51 -07:00
Justin Santa Barbara 3478031533 API types changed package 2017-10-01 14:03:56 -04:00
Ted Hahn 46d885d39b Change validation to be happy with more than minimum nodes. 2017-04-18 18:50:19 -07:00
Justin Santa Barbara 6556eeda69 Fix node role defaulting
This otherwise breaks validation.
2017-03-31 01:49:48 -04:00
Justin Santa Barbara bc7743f726 Merge pull request #2160 from ryane/validate-completed-job-fix-2137
validate cluster considers pods with PodPhase Succeeded as valid
2017-03-29 11:44:59 -04:00
Justin Santa Barbara 4006741a5d Update for new taints / labels names 2017-03-27 23:13:39 -04:00
ryane 0f75b22c82
validate cluster considers pods with PodPhase Succeeded as valid
fixes #2137
2017-03-21 08:05:35 -04:00