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

Add Ingress feature configuration #176

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

HomayoonAlimohammadi
Copy link
Contributor

Overview

Add ingress feature config options

Rationale

Users should be able to configure ingress feature options on the charm.

Note to reviewers

Should be rebased and merged after #175

@HomayoonAlimohammadi HomayoonAlimohammadi requested a review from a team as a code owner November 19, 2024 16:55
@eaudetcobello eaudetcobello changed the base branch from main to KU-583/local-storage-config November 19, 2024 22:56
@bschimke95 bschimke95 force-pushed the KU-583/local-storage-config branch from 4059713 to 17d8a37 Compare November 20, 2024 09:19
@HomayoonAlimohammadi HomayoonAlimohammadi force-pushed the KU-2111/add-ingress-feature-configuration branch from 14d607f to 1d18a33 Compare November 20, 2024 14:16
@HomayoonAlimohammadi HomayoonAlimohammadi changed the base branch from KU-583/local-storage-config to KU-586/add-network-feature-configuration November 20, 2024 14:16
Copy link
Contributor

@addyess addyess left a comment

Choose a reason for hiding this comment

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

I'd like a bit more description on this for juju administrators to have context

Sets the name of the secret to be used for providing default encryption to
ingresses.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a kubernetes secret? Can we clarify it's not to be confused with a juju secret? Also, is there a namespace this secret should stay in? Is it always kube-system or something else?

Suggested change
Sets the name of the secret to be used for providing default encryption to
ingresses.
Sets the name of the kubernetes secret to be used for providing default encryption to
ingresses.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. I guess the namespace depends on the ingress being used.
For contour (in moonray impl) it's projectcontour-root: https://github.com/canonical/k8s-snap/blob/main/src/k8s/pkg/k8sd/features/contour/chart.go#L24-L29
For cilium (in default impl) it's kube-system: https://github.com/canonical/k8s-snap/blob/main/src/k8s/pkg/k8sd/features/cilium/ingress.go#L30-L38

Since I believe we're going with the default implementation which uses Cilium, it's best to say it is in the kube-system? Or maybe we can point them to a reference page about this.

Copy link
Contributor

Choose a reason for hiding this comment

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

yucky. that's sad

if this secret moves between implementations we shouldn't specify which namespace. We should be clear that's it is closely associated with the ingress implementation.

Who sets this secret by the way? Is the snap creating the secret (via the helm charm)? Why do I want to set this secret name? I'm sorry i have so many questions.

let's make sure the description here is generic enough to handle multiple implementations under the hood, but specific enough to let the juju admin know they need to administer something in the cluster.

if it's useless -- can we just drop the secret?

@bschimke95 do you have any feedback here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the discussion Adam! I removed that option in: 90498a3

@HomayoonAlimohammadi HomayoonAlimohammadi force-pushed the KU-586/add-network-feature-configuration branch from 5fb6f64 to 17b9576 Compare November 21, 2024 07:51
@HomayoonAlimohammadi HomayoonAlimohammadi force-pushed the KU-2111/add-ingress-feature-configuration branch from 1d18a33 to 38e4e23 Compare November 21, 2024 08:02
Base automatically changed from KU-586/add-network-feature-configuration to main November 21, 2024 23:20
@HomayoonAlimohammadi HomayoonAlimohammadi force-pushed the KU-2111/add-ingress-feature-configuration branch from 45ce421 to a9e8e5f Compare November 22, 2024 08:11
@HomayoonAlimohammadi HomayoonAlimohammadi force-pushed the KU-2111/add-ingress-feature-configuration branch from a9e8e5f to 90498a3 Compare November 22, 2024 15:33
@addyess addyess force-pushed the KU-2111/add-ingress-feature-configuration branch from 90498a3 to 7233a6d Compare November 22, 2024 16:06
Copy link
Contributor

@addyess addyess left a comment

Choose a reason for hiding this comment

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

LGTM

@addyess addyess force-pushed the KU-2111/add-ingress-feature-configuration branch from 44383e9 to 7e443ad Compare November 22, 2024 18:06
Copy link
Contributor

Test coverage for 840329d

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                              466    238    49%
src/cloud_integration.py                   80      3    96%
src/containerd.py                         140     16    89%
src/cos_integration.py                     33     12    64%
src/events/update_status.py                48     10    79%
src/inspector.py                           40      3    92%
src/kube_control.py                        39     31    21%
src/literals.py                             1      0   100%
src/protocols.py                           16      3    81%
src/reschedule.py                          77      4    95%
src/snap.py                               165     10    94%
src/token_distributor.py                  181    109    40%
src/upgrade.py                             31      1    97%
-----------------------------------------------------------
TOTAL                                    1587    469    70%
coverage-report: OK (1.19=setup[0.99]+cmd[0.20] seconds)
congratulations :) (1.24 seconds)

Static code analysis report

Run started:2024-11-22 18:58:33.098161

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 3422
  Total lines skipped (#nosec): 3
  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):

@addyess addyess merged commit 25370eb into main Nov 22, 2024
61 checks passed
@addyess addyess deleted the KU-2111/add-ingress-feature-configuration branch November 22, 2024 21:30
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.

2 participants