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

[Plugin] Add canary pods and not ready pods commands #70

Merged
merged 1 commit into from
Dec 23, 2020

Conversation

ahmed-mez
Copy link
Contributor

@ahmed-mez ahmed-mez commented Dec 22, 2020

What does this PR do?

  • kubectl-eds pods <ExtendedDaemonSet name> --select=not-ready
  • kubectl-eds pods <ExtendedDaemonSet name> --select=canary
  • kubectl-eds canary pods <ExtendedDaemonSet name>

Motivation

  • Identify not ready pods easily
  • Identify canary pods easily

Additional Notes

  • kubectl-eds pods <ExtendedDaemonSet name> --select=canary
  • kubectl-eds canary pods <ExtendedDaemonSet name>
  POD                           READY  PHASE    REASON  UNREADY CONTAINERS  RESTARTS  NODE                                  NODE READY
  pause-containers-xxxxx-xxxxx  1/1    Running                              0         xxx-xxxxx-xxxxxxxx-xxxx-xxxxxxx-xxxx  true
  pause-containers-xxxxx-xxxxx  1/1    Running                              0         xxx-xxxxx-xxxxxxxx-xxxx-xxxxxxx-xxxx  true
  • kubectl-eds pods <ExtendedDaemonSet name> --select=not-ready
  POD                        READY  PHASE    REASON              NOT READY CONTAINERS              RESTARTS  NODE                            NODE READY
  datadog-agent-xxxxx-xxxxx  0/5    Running  ContainersNotReady  agent, process-agent,           901       ip-xx-xxx-xxx-xxx.xxx.internal  true
  datadog-agent-xxxxx-xxxxx  3/5    Running  ContainersNotReady  agent, process-agent            72        ip-xx-xxx-xxx-xx.xxx.internal   false
  datadog-agent-xxxxx-xxxxx  0/5    Pending                      agent, process-agent,           0         ip-xx-xxx-xxx-xx.xxx.internal   false
                                                                 security-agent, system-probe,
                                                                 trace-agent
  datadog-agent-xxxxx-xxxxx  0/0    Failed   OutOfmemory                                         0         ip-xx-xxx-xxx-xx.xxx.internal   true
  datadog-agent-xxxxx-xxxxx  0/0    Failed   Evicted                                             0         ip-xx-xxx-xxx-xxx.xxx.internal  true

Describe your test plan

Compare the command outputs to k get pods and k get nodes

@ahmed-mez ahmed-mez added enhancement New feature or request component/plugin labels Dec 22, 2020
@ahmed-mez ahmed-mez added this to the v0.5 milestone Dec 22, 2020
@ahmed-mez ahmed-mez requested a review from a team as a code owner December 22, 2020 16:38
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request contains a valid label.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request contains a valid label.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request contains a valid label.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request contains a valid label.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request contains a valid label.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request contains a valid label.

@ahmed-mez ahmed-mez changed the title [Plugin] Add canary list and unready commands [Plugin] Add canary list and notready commands Dec 22, 2020
@codecov-io
Copy link

codecov-io commented Dec 22, 2020

Codecov Report

Merging #70 (3d8d977) into master (efa4090) will increase coverage by 0.28%.
The diff coverage is 21.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #70      +/-   ##
==========================================
+ Coverage   31.55%   31.83%   +0.28%     
==========================================
  Files          37       41       +4     
  Lines        2830     2937     +107     
==========================================
+ Hits          893      935      +42     
- Misses       1851     1913      +62     
- Partials       86       89       +3     
Flag Coverage Δ
unittests 31.83% <21.12%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/plugin/common/client.go 0.00% <ø> (ø)
pkg/plugin/common/pods.go 0.00% <0.00%> (ø)
pkg/plugin/common/table.go 0.00% <0.00%> (ø)
pkg/plugin/common/utils.go 62.50% <62.50%> (ø)
...lers/extendeddaemonsetreplicaset/strategy/utils.go 51.18% <0.00%> (+14.64%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update efa4090...3d8d977. Read the comment docs.

@@ -107,14 +108,14 @@ func NewCmdUnpause(streams genericclioptions.IOStreams) *cobra.Command {
return cmd
}

// Complete sets all information required for processing the command
func (o *PauseOptions) Complete(cmd *cobra.Command, args []string) error {
Copy link
Collaborator

@clamoriniere clamoriniere Dec 23, 2020

Choose a reason for hiding this comment

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

we used Complete() Validate() Run() to be compatible with an Interface definition to ease testing and mocking

type Cmd interface {
  Complete(cmd *cobra.Command, args []string) error
  Validate() error 
  Run() error
}

but it is true that we didn't go this far to use implement it and use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, thanks for the context. Let's keep them private for now as they don't need to be public. It will be easy to switch back to public when we want to implement the interface

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request contains a valid label.

@ahmed-mez ahmed-mez changed the title [Plugin] Add canary list and notready commands [Plugin] Add canary pods and not ready pods commands Dec 23, 2020
Copy link
Contributor

@xornivore xornivore left a comment

Choose a reason for hiding this comment

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

Nice refactoring!

Copy link
Collaborator

@clamoriniere clamoriniere left a comment

Choose a reason for hiding this comment

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

💯

@clamoriniere clamoriniere merged commit 87217d6 into master Dec 23, 2020
@clamoriniere clamoriniere deleted the ahmed-mez/unready-pods-cmd branch December 23, 2020 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/plugin enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants