-
Notifications
You must be signed in to change notification settings - Fork 10
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 sync-cluster-config command #231
Conversation
d256041
to
4dff2eb
Compare
|
||
// NB: It's unclear why this endpoint is being hit. It's preserved | ||
// as a historical artifact. | ||
if err := client.RestartService(ctx, "schema-registry"); err != nil { |
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 don't remember why this restart is needed. The PR which introduced this change have 0 context. I can only guess now that cluster which is upgraded to from no SASL to cluster with SASL enabled might have problem with Schema Registry. It would be good to create follow up to create test case for such upgrade and remove this schema registry restart.
https://redpandadata.atlassian.net/wiki/spaces/CORE/pages/326500353/Schema+Registry+Restart
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'll file an issue to circle back on this one and leave it in place for now unless you have any major objections?
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.
No objection I tried to provide context to the best of my ability.
4dff2eb
to
f3424df
Compare
https://buildkite.com/redpanda/redpanda-operator/builds/2603#_ Test containers was waiting for pulling Redpanda container and apparently it failed :(
|
}, | ||
} | ||
|
||
cmd.Flags().StringVar(&bootstrapYAMLPath, "bootstrap-yaml", "", "") |
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.
Not a blocker.
As far as I know the default place where Redpanda is looking for .bootstrap.yaml
file is /etc/redpanda/
path.
src/go/k8s/go.mod
Outdated
github.com/testcontainers/testcontainers-go v0.33.0 | ||
github.com/testcontainers/testcontainers-go/modules/redpanda v0.33.0 |
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.
Something broke with go dependency update. #231 (comment)
Could you downgrade some of the dependency to see if that helps?
I wonder if CI have some problems and my hack would work? redpanda-operator/src/go/k8s/internal/controller/redpanda/topic_controller_test.go Lines 63 to 66 in 7ac4262
|
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.
LGTM
I'm not sure why CI is failing. Maybe new version of testcontainer introduced a bug.
f3424df
to
0d4c9a0
Compare
388e2b4
to
ca8f15e
Compare
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 generally like the movement to go code, though it makes me wonder why this hook exists in the first place.
Additionally, thoughts about the library upgrades.
src/go/k8s/go.mod
Outdated
k8s.io/api v0.30.3 | ||
k8s.io/apiextensions-apiserver v0.30.1 | ||
k8s.io/apimachinery v0.30.3 | ||
k8s.io/client-go v0.30.3 | ||
k8s.io/component-helpers v0.29.5 | ||
k8s.io/kubectl v0.29.5 | ||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 | ||
pgregory.net/rapid v1.1.0 | ||
sigs.k8s.io/controller-runtime v0.17.2 | ||
sigs.k8s.io/controller-runtime v0.18.5 |
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.
Not entirely sure on all of these changes, but I know that a bunch of Kubernetes stuff along with controller-runtime
are highly sensitive to minor version changes in the underlying libraries. Just looking above it looks like we also have kubectl
and component-helpers
at v0.29.5... I'm not sure if that'll cause odd problems or not.
I think that the helm-charts
repo also has a controller-runtime
dependency? Might version mismatches there cause problems here?
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 yet to experience any issues from version mismatches that don't appear at either compile time or very early on in startup / init()
code. Have you seen runtime issues before?
I think that the helm-charts repo also has a controller-runtime dependency? Might version mismatches there cause problems here?
It does but it uses very little of the API(s) exposed. I'm fairly certain that it's just the client.Client
and some configuration helpers. I don't imagine any issues occurring?
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.
Synced all the k8s.io/*
deps with the exception of k8s.io/utils
which doesn't really have any published versions.
logger.Info(fmt.Sprintf("$%s not set. Skipping license setting...", licenseEnvvar)) | ||
} else { | ||
logger.Info(fmt.Sprintf("$%s set. Setting license...", licenseEnvvar)) | ||
if err := client.SetLicense(cmd.Context(), strings.NewReader(license)); err != nil { |
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.
Random question, but do we know why we're setting the license like this? Is it because wherever the license is being dumped doesn't get re-read by the cluster nodes? Would it make sense to put something like this in the config watching sidecar instead?
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.
AFAIK the license has to be set like this. I don't believe there's anywhere it actually gets read from.
// NB: It's unclear why this endpoint is being hit. It's preserved | ||
// as a historical artifact. | ||
// See also: https://github.com/redpanda-data/redpanda-operator/issues/232 | ||
if err := client.RestartService(ctx, "schema-registry"); err != nil { |
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.
Same thought with this -- if it's something that just fires after a configuration component changes and is meant to avoid an issue where we aren't re-reading configuration off disk, can't we just add this to the config watcher?
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.
It's suspected that this is due to a cluster level configuration change which isn't something that's read from disk. I guess technically we could watch the bootstrap file but that's only read once at cluster initialization time.
ca8f15e
to
b91bacd
Compare
This commit adds the `sync-cluster-config` command which is designed to replace the bash scripts in the helm chart's post-__ hooks. Rather than re-inventing the wheel and loading up the admin API configuration, we re-use RPK's config loading as the redpanda.yaml and environment variables are known to be valid.
b91bacd
to
187a795
Compare
This commit adds the
sync-cluster-config
command which is designed to replace the bash scripts in the helm chart's post-__ hooks.Rather than re-inventing the wheel and loading up the admin API configuration, we re-use RPK's config loading as the redpanda.yaml and environment variables are known to be valid.