moehajj commented on issue #2205:
URL: https://github.com/apache/camel-k/issues/2205#issuecomment-819892111
Yes as @fshaikh-vgs shared, the following traits spin up a nodePort service.
```
--profile kubernetes \
-t service.enabled=true \
-t service.auto=false \
-t container.service-port=9000 \
-t container.port=9000 \
```
The service has the following specs:
```
spec:
clusterIP: 10.102.112.181
externalTrafficPolicy: Cluster
ports:
- name: http
nodePort: 30872
port: 9000
protocol: TCP
targetPort: http
selector:
camel.apache.org/integration: sample-grpc-camel-route
sessionAffinity: None
type: NodePort
```
However I believe I cannot access my grpc service (which is running inside
the pod at port 9000) because `targetPort` is set to `http` instead of 9000.
When I deploy a service manually instead of using camel-k, I am able to
access the grpc service fine. I do this using the following:
```
cat <<EOF | tee sample-grpc-service.yaml
apiVersion: v1
kind: Service
metadata:
name: sample-grpc
labels:
camel.apache.org/integration: sample-grpc-camel-route
spec:
ports:
- port: 9000
protocol: TCP
selector:
camel.apache.org/integration: sample-grpc-camel-route
EOF
kubectl apply -f sample-grpc-service.yaml
```
Is it possible to set the nodePort in the service generated by camel-k? I
cannot find any trait for this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]