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

TT-13451 Add missing config arg to support operator v0.18.0 #349

Closed

Conversation

lboynton
Copy link

@lboynton lboynton commented Oct 28, 2024

Description

Without this, the liveness and readiness probes fail and you end up in a CrashLoopBackoff

Related Issue

Motivation and Context

Test Coverage For This Change

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring or add test (improvements in base code or adds test coverage to functionality)
  • Documentation updates or improvements.

Checklist

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). If PRing from your fork, don't come from your master!
  • Make sure you are making a pull request against our master branch (left side). Also, it would be best if you started your change off our latest master.
  • My change requires a change to the documentation.
    • I have manually updated the README(s)/documentation accordingly.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Without this, the liveness and readiness probes fail and you end up in a CrashLoopBackoff
@lboynton lboynton requested a review from a team as a code owner October 28, 2024 15:58
@lboynton lboynton requested review from olamilekan000 and removed request for a team October 28, 2024 15:58
@caroltyk caroltyk changed the title Add missing config arg TT-13451 Add missing config arg Oct 31, 2024
@buraksekili
Copy link
Member

@lboynton thanks for raising this!

With the release of v1.0.0, we've enhanced the capabilities of the Tyk Operator. However, the Operator currently does not accept the --config flag as an argument, so the solution proposed in the PR will not work for v1.0.0.

Additionally, the Tyk Operator uses default values defined in the ControllerManagerConfiguration here:

controller_manager_config.yaml: |
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
kind: ControllerManagerConfig
health:
healthProbeBindAddress: :{{ .Values.healthProbePort }}
metrics:
bindAddress: 127.0.0.1:{{ .Values.metricsPort }}
webhook:
port: {{ .Values.webhookPort }}
leaderElection:
leaderElect: true
resourceName: 91ad8c6e.tyk.io

Therefore, providing incorrect Manager configuration may not cause a problem unless Operator misses some configs.

Could you please share any logs or findings with me for further investigation?

In the meantime, the following arguments can be added:

      - args:
        - --leader-elect
        - --health-probe-bind-address=:8081
        - --metrics-bind-address=:8080
        command:
        - /manager

These args for specific to Tyk Operator v1.0.0. In the meantime, the team internally works on this to make this process smoother.

@lboynton
Copy link
Author

Thanks @buraksekili, this makes more sense. I was attempting to use v0.18.0 of the operator initially to make the upgrade smoother. So possibly it's only an issue with that version.

@buraksekili
Copy link
Member

Oh I see - this happened during the upgrade, thanks for the input!
I'll also update the team accordingly. please let me know and feel free to tag me for any inquiries.

@lboynton
Copy link
Author

Thanks. I initially tried v1.0.0 with a valid license key passed to global.license.operator, but got the following error in the operator logs:

{"level":"error","ts":"2024-10-31T13:29:46Z","logger":"license","msg":"failed to validate license","error":"kindly specify a valid license key.","stacktrace":"github.com/TykTechnologies/tyk-operator/pkg/environment.(*License).validateKey\n\t/workspace/pkg/environment/license.go:50\ngithub.com/TykTechnologies/tyk-operator/pkg/environment.(*License).StartPeriodicValidation\n\t/workspace/pkg/environment/license.go:84"}

Still trying to work out if I'm passing it in wrong or if it's not being passed through correctly.

@buraksekili
Copy link
Member

Hmm, I see. In the meantime, could you please try setting the TYK_OPERATOR_LICENSEKEY environment variable explicitly for the Operator Manager pod, if passing the license directly is acceptable in your k8s environment?

@lboynton lboynton changed the title TT-13451 Add missing config arg TT-13451 Add missing config arg to support operator v0.18.0 Oct 31, 2024
@lboynton
Copy link
Author

Hmm, I see. In the meantime, could you please try setting the TYK_OPERATOR_LICENSEKEY environment variable explicitly for the Operator Manager pod, if passing the license directly is acceptable in your k8s environment?

Thanks this works. It also looks like you can edit the tyk-operator-conf secret and add TYK_OPERATOR_LICENSEKEY as a key. Perhaps I should raise a separate bug to say that the tyk-oss chart doesn't set the license key?

@buraksekili
Copy link
Member

glad it worked! thanks for your collaboration.

Feel free to create a ticket. I'll also consider our discussion for planning and further investigation.
Thanks once again for your time and collaboration 🙏

@buraksekili
Copy link
Member

Thanks for your time @lboynton , i am closing this PR as of now and the team will work on the issue to update operator deployment manifest based on the new args. Thanks again for raising this!

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