Skip to content
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

Added success logging to the provisioner #666

Merged
merged 1 commit into from
Sep 11, 2021
Merged

Conversation

ellistarn
Copy link
Contributor

1. Issue, if available:
#656

2. Description of changes:

karpenter-controller-7cdf8884cf-psvb9 manager 2021-09-08T21:43:22.851Z	ERROR	controller.allocation.provisioner/default	Failed reconciliation, getting subnets, no subnets exist given constraints	{"commit": "eb5139e"}
karpenter-controller-7cdf8884cf-psvb9 manager 2021-09-08T21:43:22.852Z	INFO	controller.allocation.provisioner/default	Watching for pod events	{"commit": "eb5139e"}
karpenter-controller-7cdf8884cf-psvb9 manager 2021-09-08T21:43:32.853Z	INFO	controller.allocation.provisioner/default	Starting provisioning loop	{"commit": "eb5139e"}
karpenter-controller-7cdf8884cf-psvb9 manager 2021-09-08T21:43:32.853Z	INFO	controller.allocation.provisioner/default	Waiting to batch additional pods	{"commit": "eb5139e"}
karpenter-controller-7cdf8884cf-psvb9 manager 2021-09-08T21:43:33.870Z	INFO	controller.allocation.provisioner/default	Found 1 provisionable pods	{"commit": "eb5139e"}
karpenter-controller-7cdf8884cf-psvb9 manager 2021-09-08T21:43:33.894Z	INFO	controller.allocation.provisioner/default	Computed packing for 1 pod(s) with instance type option(s) [t3.micro t3a.micro t3.small c1.medium t3a.small t3.medium t3a.medium c5a.large c5ad.large c4.large c5d.large c3.large c5.large c5n.large m1.large m5.large m3.large m4.large m5d.large m5a.large]	{"commit": "eb5139e"}
karpenter-controller-7cdf8884cf-psvb9 manager 2021-09-08T21:43:33.894Z	ERROR	controller.allocation.provisioner/default	Failed reconciliation, getting subnets, no subnets exist given constraints	{"commit": "eb5139e"}
karpenter-controller-7cdf8884cf-psvb9 manager 2021-09-08T21:43:33.894Z	INFO	controller.allocation.provisioner/default	Watching for pod events	{"commit": "eb5139e"}

3. Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: link to issue
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@netlify
Copy link

netlify bot commented Sep 8, 2021

✔️ Deploy Preview for karpenter-docs-prod ready!

🔨 Explore the source changes: 5d8d27a

🔍 Inspect the deploy log: https://app.netlify.com/sites/karpenter-docs-prod/deploys/61392ed134d5300007b14941

😎 Browse the preview: https://deploy-preview-666--karpenter-docs-prod.netlify.app

ctx = logging.WithLogger(ctx, logging.FromContext(ctx).Named(fmt.Sprintf("allocation.provisioner/%s", req.Name)))
logging.FromContext(ctx).Infof("Starting provisioning loop")
defer func() {
logging.FromContext(ctx).Infof("Watching for pod events")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, I'm not sure I can figure out why this is in a defer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prints at the end of reconciliation. If the controller is hanging, the last log line will be "Watching for pod events". I could change this to something like "Waiting for pod events". The idea is to reassure users that karpenter is working even if its hanging.

Copy link
Contributor

@bwagner5 bwagner5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ellistarn ellistarn merged commit d467390 into aws:main Sep 11, 2021
@ellistarn ellistarn deleted the logging branch September 22, 2021 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants