Skip to content

feat(h2c): adds support for setting target port#1763

Open
tonytheleg wants to merge 1 commit intoRedHatInsights:masterfrom
tonytheleg:RHCLOUD-46698-feat-h2c-targetport
Open

feat(h2c): adds support for setting target port#1763
tonytheleg wants to merge 1 commit intoRedHatInsights:masterfrom
tonytheleg:RHCLOUD-46698-feat-h2c-targetport

Conversation

@tonytheleg
Copy link
Copy Markdown
Contributor

@tonytheleg tonytheleg commented Apr 13, 2026

Changes:

  • adds new h2cTargetPort to ClowdApp spec for private and public
  • updates service creation to use the h2cTargetPort if set
  • defaults to using h2cPort value in ClowdEnv if not set (current)
  • adds new test to validate h2cTargetPort setting functionality
  • updates h2c appProtocl to correct kubernetes-specific value

Why:
Related to #1414, Kessel leverages port 9000 for gRPC but by default, when enabling h2c in Clowder, the Kubernetes service mapping always matches the h2cPort to the target port in the service. Instead of trying to move Kessel Inventory to a new port which would require a lot of updates across multiple teams, we'd like to abstract that problem by being able to override the target port via our ClowdApp.

Validation (in minikube):

# tested using the provided examples with updating values
$ kc get env env-jumpstart -o json | jq -r '.spec.providers.web'
{
  "gatewayCert": {},
  "h2cPort": 9800,  <----
  "images": {},
  "mode": "operator",
  "port": 8000,
  "privatePort": 8080,
  "tls": {}
}

$ kc get app -n jumpstart hello -o json | jq -r '.spec.deployments[].webServices'
{
  "metrics": {},
  "private": {},
  "public": {
    "enabled": true,
    "h2cEnabled": true,
    "h2cTargetPort": 9000  <--- new setting, overrides target port in svc to 9000 instead of 9800
  }
}

$ kc get svc -n jumpstart hello-app -o json | jq -r '.spec.ports'
[
  {
    "appProtocol": "http",
    "name": "public",
    "port": 8000,
    "protocol": "TCP",
    "targetPort": 8000
  },
  {
    "appProtocol": "kubernetes.io/h2c",   <--- updated protocol
    "name": "h2c",
    "port": 9800,  <--- matches h2c env port
    "protocol": "TCP", 
    "targetPort": 9000   <--- desired overwritten port
  },
  {
    "appProtocol": "http",
    "name": "metrics",
    "port": 9000,
    "protocol": "TCP",
    "targetPort": 9000
  }
]


All Kuttl tests (including new one) pass locally except the following (probably missing dependencies for them in minikube?)
        --- FAIL: kuttl/harness/test-cyndi-strimzi (606.88s)
        --- FAIL: kuttl/harness/test-disabled (722.22s)
        --- FAIL: kuttl/harness/test-clowdapp-watcher-kafka-msk (624.39s)
        --- FAIL: kuttl/harness/test-kafka-strimzi-topic-deprecated-spec (617.75s)
        --- FAIL: kuttl/harness/test-kafka-strimzi-topic-basic (619.28s)
        --- FAIL: kuttl/harness/test-kafka-strimzi-topic-auth (619.39s)
        --- FAIL: kuttl/harness/test-kafka-strimzi-pvc (619.71s)

* adds new h2cTargetPort to ClowdApp spec for private and public
* updates service creation to use the h2cTargetPort if set
* defaults to using h2cPort value in ClowdEnv if not set (current)
* adds new test to validate h2cTargetPort setting functionality
* updates h2c appProtocl to correct kubernetes-specific value
@tonytheleg tonytheleg force-pushed the RHCLOUD-46698-feat-h2c-targetport branch from 986d0ea to de4f14d Compare April 13, 2026 20:12
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.

1 participant