tls: enable tls.ca setting in client/exporter config files#177
tls: enable tls.ca setting in client/exporter config files#177
Conversation
📝 WalkthroughWalkthroughAdds an optional base64-encoded PEM Changes
Sequence Diagram(s)sequenceDiagram
participant Operator as Operator (controller)
participant K8sAPI as Kubernetes API
participant CM as ConfigMap (jumpstarter-service-ca-cert)
participant Client as Python Client/Exporter
participant TLS as TLS stack
Operator->>K8sAPI: reconcileCAConfigMap(js) — ensure ConfigMap exists
K8sAPI-->>CM: create/update ca.crt (from Issuer.CABundle or CA secret)
Client->>K8sAPI: read ConfigMap jumpstarter-service-ca-cert
K8sAPI-->>Client: return ConfigMap (ca.crt or empty)
Client->>Client: base64-decode/encode ca.crt -> TLSConfigV1Alpha1(ca=...)
Client->>TLS: establish TLS connection using provided CA bundle
TLS->>TLS: verify server cert against CA bundle
TLS-->>Client: connection result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hmm, this isn't running some of the CI jobs, why? |
|
ah, this is not over the base branch main... |
| }, caSecret) | ||
| if err != nil { | ||
| // CA secret doesn't exist yet - this is expected during initial setup | ||
| // The ConfigMap will be updated once the CA certificate is ready |
There was a problem hiding this comment.
In the follow up PR we wait until this is really ready before creating the configmap to avoid the service from having a "blank" CA bundle injected. In this PR we still don't use it from jumpstarter-controller, only jmp admin, so it's not a problem really, but on the later patch we start using this from jumpstarter-controller and we can't populate empty so you will see this change.
There was a problem hiding this comment.
Thanks for clarifying this part!
|
hmm CI is not running because this was first on top of another branch, let me update last commit message to trigger it |
65220b3 to
aed490a
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@controller/deploy/operator/internal/controller/jumpstarter/certificates.go`:
- Around line 511-525: The current error handling around r.Client.Get when
reading the CA secret (caSecret, caSecretName) treats all errors as "not found"
and proceeds to create an empty CA ConfigMap; change this to differentiate
NotFound vs other errors by using apierrors.IsNotFound(err) (from
k8s.io/apimachinery/pkg/api/errors) — if apierrors.IsNotFound(err) keep the
existing log and continue, otherwise return the error (or requeue) from the
reconcile function so transient/API/RBAC failures are retried and not silently
masked; update imports to include apierrors if missing.
controller/deploy/operator/internal/controller/jumpstarter/certificates.go
Show resolved
Hide resolved
|
Thank you @bkhizgiy !! |
This PR adds the following elements:
There is a follow up PR that enables OIDC logins "easy-login" where the server provides the CA to the jmp login (as well as some extra details like: endpoint, namespace, etc.
Summary by CodeRabbit
New Features
Tests