Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Add a simple Kubernetes custom controller/resource example. #55

Merged
merged 1 commit into from
Oct 13, 2017

Conversation

mattmoor
Copy link
Contributor

@mattmoor mattmoor commented Oct 11, 2017

This has a handful of components:

  • a "TODO" Custom Resource Definition (CRD),
  • a "TODO" example instance, and
  • a Custom Controller that watches for "TODOs" not marked "done" and completes them with a comment.

This also adds a little e2e test that:

  • Creates the CRD/Controller and starter TODO
  • Checks the note on the TODO
  • Updates the Controller (waits) and then the TODO (waits)
  • Checks the note on the TODO has changed appropriately
  • Repeat edit/check
  • Teardown

Fixes: #30

@mattmoor mattmoor requested a review from dlorenc October 11, 2017 18:43
@mattmoor
Copy link
Contributor Author

The OSX issue looks the same as this

@mattmoor
Copy link
Contributor Author

Ok, I expect this is RFAL

@mattmoor mattmoor force-pushed the controller branch 2 times, most recently from 69142a8 to 4262fbb Compare October 13, 2017 19:32
ports:
- containerPort: 50051
env:
- name: MY_NAMESPACE
Copy link

Choose a reason for hiding this comment

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

You can also get this from /var/run/secrets/kubernetes.io/serviceaccount/namespace and avoid using the downward API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

neat, but I'd rather avoid reading a file :-/

kind: Todo
# # shortNames allow shorter string to match your resource on the CLI
# shortNames:
# - todo
Copy link

Choose a reason for hiding this comment

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

nit: newline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

bazel run examples/todocontroller/example-todo.describe
bazel run examples/todocontroller/${LANGUAGE}:controller-deployment.describe

bazel build examples/todocontroller/example-todo.delete
Copy link

Choose a reason for hiding this comment

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

Why not bazel run everything in here, instead of bazel building then executing?

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 want coverage of separate build/run working :)

This has a handful of components:
 - a "TODO" Custom Resource Definition (CRD),
 - a "TODO" example instance, and
 - a Custom Controller that watches for "TODOs" not marked "done" and completes them with a comment.

This also adds a little e2e test that:
 - Creates the CRD/Controller and starter TODO
 - Checks the note on the TODO
 - Updates the Controller (waits) and then the TODO (waits)
 - Checks the note on the TODO has changed appropriately
 - Repeat edit/check
 - Teardown
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants