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

config: change default destination sync type to azure for azure #2306

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

viktor-f
Copy link
Contributor

Warning

This is a public repository, ensure not to disclose:

  • personal data beyond what is necessary for interacting with this pull request, nor
  • business confidential information, such as customer names.

What kind of PR is this?

Required: Mark one of the following that is applicable:

  • kind/feature
  • kind/improvement
  • kind/deprecation
  • kind/documentation
  • kind/clean-up
  • kind/bug
  • kind/other

Optional: Mark one or more of the following that are applicable:

Important

Breaking changes should be marked kind/admin-change or kind/dev-change depending on type
Critical security fixes should be marked with kind/security

  • kind/admin-change
  • kind/dev-change
  • kind/security
  • kind/adr

What does this PR do / why do we need this PR?

Changed the default objectStorage.sync.destinationType to azure, for azure clusters. Having this default to s3 caused issues with network policies / update-ips for clusters that are only using azure storage.

Information to reviewers

Init and migration script tested, but I have not re-tested using destinationType as azure.

Checklist

  • Proper commit message prefix on all commits
  • Change checks:
    • The change is transparent
    • The change is disruptive
    • The change requires no migration steps
    • The change requires migration steps
    • The change upgrades CRDs
    • The change updates the config and the schema
  • Documentation checks:
  • Metrics checks:
    • The metrics are still exposed and present in Grafana after the change
    • The metrics names didn't change (Grafana dashboards and Prometheus alerts are not affected)
    • The metrics names did change (Grafana dashboards and Prometheus alerts were fixed)
  • Logs checks:
    • The logs do not show any errors after the change
  • Pod Security Policy checks:
    • Any changed pod is covered by Pod Security Admission
    • Any changed pod is covered by Gatekeeper Pod Security Policies
    • The change does not cause any pods to be blocked by Pod Security Admission or Policies
  • Network Policy checks:
    • Any changed pod is covered by Network Policies
    • The change does not cause any dropped packets in the NetworkPolicy Dashboard
  • Audit checks:
    • The change does not cause any unnecessary Kubernetes audit events
    • The change requires changes to Kubernetes audit policy
  • Falco checks:
    • The change does not cause any alerts to be generated by Falco
  • Bug checks:
    • The bug fix is covered by regression tests

@viktor-f viktor-f added the kind/bug Something isn't working label Oct 14, 2024
@viktor-f viktor-f self-assigned this Oct 14, 2024
@viktor-f viktor-f added the azure label Oct 14, 2024

objectStorage:
sync:
## If Harbor or Thanos are using swift then we will automatically use swift for the sync, regardless of the value set for type.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this comment. I'm sure it is obvious once you know why but to someone that does not it's not clear what is going on here.

Does it mean that the value of objectStorage.sync.destinationType is completely ignored if .harbor.persistence.type=swift or .thanos.objectStorage.type=swift or that the sync of those specific buckets are ignoring the value of objectStorage.sync.destinationType? I assume the latter?

To me the object storage configuration throughout the project feels a bit complicated. It really shows in the complex "set-me-if" cases. I wonder if we could simplify it somehow? Worthy of an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is trying to say that the sync of those specific buckets are ignoring this value. You can check the logic here. I did just copy this line from the base config file, but I could perhaps try to rewrite it to be more clear.

I agree that it is complicated, but it is also supporting a lot of different possibilities. I'm not sure this is something we would spend time on soon, unless it was needed to support something else.

Copy link
Contributor

Choose a reason for hiding this comment

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

Time spent simplifying is time saved dealing with complexity in the future but I agree it's not high priority.

At least having tests for each of the config cases is something I'd like to se. I would be fine just seeing "config -> rendered result" and some "missing dependent config option / set-me-if-x" unit tests.

Comment on lines 17 to 25
if yq_check sc .objectStorage.sync.enabled true; then
if yq_null sc .objectStorage.sync.destinationType; then
log_info "objectStorage sync is enabled, will keep previous default destinationType: s3"
else
log_info "sync destinationType already has an override, skipping"
fi
else
log_info "object storage sync is not enabled, will use new default destinationType: azure"
fi
Copy link
Contributor

@simonklb simonklb Oct 14, 2024

Choose a reason for hiding this comment

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

Where is the migration actually taking place? Sorry if I'm just blind. 😄 To me it just looks like this figuring out how it's currently configured and logs it but doesn't modify anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I seem to have completely missed that 😅, got too stuck in making sure the logic worked. Will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants