-
Notifications
You must be signed in to change notification settings - Fork 4
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
Coredns integration with K8s-charm #35
base: main
Are you sure you want to change the base?
Conversation
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.
Aight, here are some suggestions for the charm code. Looking at integration tests next
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've left some changes that will shrink this down a good bit. It's key to go learn about how pytest fixtures work. Not all my suggestions will be spot on -- but maybe they get close. Particularly on the model clean up
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.
Looking pretty smooth. I had one little nit about using a command rather than a charm action
tests/integration/conftest.py
Outdated
action = await k8s.run("k8s config") | ||
result = await action.wait() | ||
assert result.results["return-code"] == 0, "Failed to get kubeconfig with kubectl" | ||
|
||
kubeconfig_path = ops_test.tmp_path / "kubeconfig" | ||
kubeconfig_path.write_text(result.results["stdout"]) |
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.
can we use the action on the charm now? Please check my logic -- this might yield a json kubeconfig file too...
action = await k8s.run("k8s config") | |
result = await action.wait() | |
assert result.results["return-code"] == 0, "Failed to get kubeconfig with kubectl" | |
kubeconfig_path = ops_test.tmp_path / "kubeconfig" | |
kubeconfig_path.write_text(result.results["stdout"]) | |
action = await k8s.run_action("get-kubeconfig") | |
result = await action.wait() | |
assert result.results["return-code"] == 0, "Failed to get kubeconfig with kubectl" | |
kubeconfig_path = ops_test.tmp_path / "kubeconfig" | |
kubeconfig_path.write_text(result.results["kubeconfig"]) |
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.
Doesn't seem to work just like that. I can take another look at this in the follow-up ticket. I'd like to get what we have merged for now.
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.
Some inquires
tests/integration/conftest.py
Outdated
action = await k8s.run("k8s config") | ||
result = await action.wait() | ||
assert result.results["return-code"] == 0, "Failed to get kubeconfig with kubectl" | ||
kubeconfig_path = ops_test.tmp_path / "kubeconfig" | ||
kubeconfig_path.write_text(result.results["stdout"]) |
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.
so, i wish this used the juju action instead of running through the snap CLI in order to make use of the public address of the unit
action = await k8s.run("k8s config") | |
result = await action.wait() | |
assert result.results["return-code"] == 0, "Failed to get kubeconfig with kubectl" | |
kubeconfig_path = ops_test.tmp_path / "kubeconfig" | |
kubeconfig_path.write_text(result.results["stdout"]) | |
action = await k8s.run_action("get-kubeconfig") | |
result = await action.wait() | |
kubeconfig_path = ops_test.tmp_path / "kubeconfig" | |
kubeconfig_path.write_text(result.results["kubeconfig"]) |
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.
only request is that we use the charm action
e647145
to
9f1d8f7
Compare
Description
This PR adds the
coredns
integration to thek8s charm
.Handle Integration
dns-provider
relation between thek8s-charm
andcoredns
.Integration Tests
limitation
The test_dns function can only be validated once cluster config bits are propagated properly.