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

feat(config): add config properties for callback URL components #524

Merged
merged 3 commits into from
Nov 4, 2024

Conversation

ebaron
Copy link
Member

@ebaron ebaron commented Oct 28, 2024

This work is done to support the agent auto-configuration work in the operator. Specifically, this is needed to support generating wildcard certificates for the agent to use.

To test:

  1. Deploy Cryostat using the operator.
  2. Deploy the sample app w/ agent.
  3. Swap out the default container image with one built using this PR.
  4. Create a headless service:
    apiVersion: v1
    kind: Service
    metadata:
      name: headless
      namespace: cryostat-operator-system
    spec:
      clusterIP: None
      selector:
        app: quarkus-cryostat-agent
      type: ClusterIP
  5. Add a POD_NAME environment variable
    - name: POD_NAME
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.name
    
  6. Add these system properties to JAVA_OPTS_APPEND:
    -Dcryostat.agent.callback.scheme=http
    -Dcryostat.agent.callback.host-name=$(POD_NAME),$(POD_IP)[replace("."\,"-")]
    -Dcryostat.agent.callback.domain-name=headless.cryostat-operator-system.svc
    -Dcryostat.agent.callback.port=9977
    -Dio.cryostat.agent.shaded.org.slf4j.simpleLogger.defaultLogLevel=debug
    
  7. Observe a lines similar to:
    2024-11-04 18:41:56:456 +0000 [cryostat-agent-main] DEBUG io.cryostat.agent.ConfigModule - Attempting to resolve quarkus-cryostat-agent-5cd54bbb86-62zsv.headless.cryostat-operator-system.svc
    2024-11-04 18:41:56:546 +0000 [cryostat-agent-main] DEBUG io.cryostat.agent.ConfigModule - Attempting to resolve 10-128-0-67.headless.cryostat-operator-system.svc
    2024-11-04 18:41:56:550 +0000 [cryostat-agent-main] DEBUG io.cryostat.agent.ConfigModule - Resolved 10-128-0-67.headless.cryostat-operator-system.svc to 10.128.0.67
    2024-11-04 18:41:56:552 +0000 [cryostat-agent-main] DEBUG io.cryostat.agent.ConfigModule - Using http://10-128-0-67.headless.cryostat-operator-system.svc:9977 for callback URL
    

Fixes: #525

@github-actions github-actions bot added the needs-triage Needs thorough attention from code reviewers label Oct 28, 2024
@mergify mergify bot added the safe-to-test label Oct 28, 2024
@ebaron ebaron added feat New feature or request and removed needs-triage Needs thorough attention from code reviewers labels Oct 28, 2024
@ebaron ebaron marked this pull request as ready for review October 28, 2024 22:26
@ebaron ebaron requested review from andrewazores and a team October 28, 2024 22:26
README.md Outdated Show resolved Hide resolved
@ebaron ebaron changed the title feat(config): add config properties for callback on Kubernetes feat(config): add config properties for callback URL components Nov 4, 2024
@andrewazores
Copy link
Member

Everything else looks good, just the little note about the README above.

@ebaron ebaron merged commit 5667fe3 into cryostatio:main Nov 4, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request safe-to-test
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Story] Attempt to discover DNS name in Kubernetes
2 participants