-
Notifications
You must be signed in to change notification settings - Fork 19
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
Implement a new kubectl transport #60
Implement a new kubectl transport #60
Conversation
…ing in Kubernetes.
@greg-1-anderson Do you have any comments on how the yaml structure under kubectl in the site alias should be designed? It's currently super simple: foo:
paths:
drush-script: /vv/vendor/bin/drush
root: /vv/web
uri: drupal.example.com
kubectl:
tty: false
interactive: false
namespace: vv
resource: deploy/drupal-deployment
container: drupal I'm wondering whether we would ever put anything other than transport info under kubectl. But I doubt it. |
*/ | ||
public function wrap($args) | ||
{ | ||
# TODO: How/where do we complain if a required argument is not available? |
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.
@greg-1-anderson How/where do we complain if a required argument in is not available in the site alias? Is there a "standard" way (e.g. a specific custom exception that should be thrown) in this repo?
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.
Throwing an exception would be best; however, at the moment, this library does not provide any custom exception types. You could provide one, if you wanted, or maybe just use InvalidArgumentException. Maybe that's just similar enough to be confusing, though. Recommendations welcome.
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.
I would leave the TODO there, merge it, and make a new issue to address the need for custom exceptions. It needs to be designed well.
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.
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.
Looks good to me. Just decide what you want to do about parameter validation & I'll merge.
Did you see my comment above? Ready to merge? |
Sure, let's go ahead and put this in. Thanks. |
Thanks for the merge. I see this is working well for SSH, but not for rsync commands. Any idea why/why not? Do rsync commands use a different mechanism? I don't find anything related to rsync in this repo, other than strings in the tests. I'm trying to achieve something like this transparently: https://serverfault.com/a/887402/301389 |
Ideally we document this in README |
Overview
This pull request:
Summary
Implement a new kubectl transport for accessing Drupal instances running in Kubernetes.
Description
If you have this alias:
... you can do this:
... or any other drush command, and it will run via kubectl, like this:
kubectl --namespace=vv exec --tty=false --stdin=false deploy/drupal-deployment --container=drupal -- /vv/vendor/bin/drush status --uri=drupal.example.com --root=/vv/web