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

Integrate with cloud-provider and test with AWS #162

Merged
merged 6 commits into from
Nov 19, 2024

Conversation

addyess
Copy link
Contributor

@addyess addyess commented Nov 9, 2024

Overview

Make use of charmed-kubernetes/interface-kube-control#2 to support integration of the k8s operator with aws

Details

  • support publishing the ca-cert of the k8s endpoint over the kube-control relation
  • support publishing the auth tokens over the kube-control relation via secrets
  • integration k8s and k8s-worker with gcp, azure, and aws cloud integrators
  • bootstraps with a unique cluster-name passed to the k8s-snap

Copy link
Contributor

@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.

license-eye has checked 107 files.

Valid Invalid Ignored Fixed
41 1 65 0
Click to see the invalid file list
  • charms/worker/k8s/src/cloud_integration.py
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

charms/worker/k8s/src/cloud_integration.py Outdated Show resolved Hide resolved
@addyess addyess force-pushed the KU-2000/use-v2-kubecontrol branch from acf7430 to 92566a6 Compare November 9, 2024 04:29
Comment on lines 500 to 503
self.kube_control.set_dns_port(53)

self.kube_control.set_default_cni("")
self.kube_control.set_image_registry("rocks.canonical.com")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: find better values for these

Copy link
Contributor

@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.

license-eye has checked 108 files.

Valid Invalid Ignored Fixed
43 1 64 0
Click to see the invalid file list
  • charms/worker/k8s/tests/unit/test_cloud_integration.py
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

charms/worker/k8s/tests/unit/test_cloud_integration.py Outdated Show resolved Hide resolved
@addyess addyess marked this pull request as ready for review November 15, 2024 23:36
@addyess addyess requested a review from a team as a code owner November 15, 2024 23:36
@addyess addyess force-pushed the KU-2000/use-v2-kubecontrol branch from 57b8d28 to fdc41e4 Compare November 16, 2024 04:16
Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

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

Great work @addyess
Added a couple of comments

charms/worker/k8s/src/charm.py Show resolved Hide resolved
charms/worker/k8s/src/cloud_integration.py Outdated Show resolved Hide resolved
charms/worker/k8s/src/kube_control.py Show resolved Hide resolved
charms/worker/k8s/src/kube_control.py Outdated Show resolved Hide resolved
Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

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

LGTM, great stuff!

@addyess addyess force-pushed the KU-2000/use-v2-kubecontrol branch from 4733368 to 144ae04 Compare November 19, 2024 15:13
Copy link
Contributor

Test coverage for 144ae04

coverage-report: install_deps /home/runner/work/k8s-operator/k8s-operator/charms/worker/k8s> python -I -m pip install 'coverage[toml]'
coverage-report: commands[0] /home/runner/work/k8s-operator/k8s-operator/charms/worker/k8s> coverage report
Name                                    Stmts   Miss  Cover
-----------------------------------------------------------
lib/charms/k8s/v0/k8sd_api_manager.py     270     29    89%
src/charm.py                              503    269    47%
src/cloud_integration.py                   80      3    96%
src/containerd.py                         140     16    89%
src/cos_integration.py                     33     12    64%
src/inspector.py                           40      3    92%
src/kube_control.py                        39     31    21%
src/literals.py                             1      0   100%
src/protocols.py                           12      2    83%
src/reschedule.py                          77      4    95%
src/snap.py                                79      3    96%
src/token_distributor.py                  174    103    41%
src/upgrade.py                             31      1    97%
-----------------------------------------------------------
TOTAL                                    1479    476    68%
coverage-report: OK (1.19=setup[1.00]+cmd[0.19] seconds)
congratulations :) (1.24 seconds)

Static code analysis report

Run started:2024-11-19 15:15:23.771289

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 3194
  Total lines skipped (#nosec): 13
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

Copy link
Member

@mateoflorido mateoflorido left a comment

Choose a reason for hiding this comment

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

LGTM. Couple of nits, but I'm +1

charms/worker/k8s/src/charm.py Show resolved Hide resolved
charms/worker/k8s/src/token_distributor.py Show resolved Hide resolved
@addyess addyess merged commit 7558411 into main Nov 19, 2024
50 checks passed
@addyess addyess deleted the KU-2000/use-v2-kubecontrol branch November 19, 2024 21:56
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.

4 participants