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

Add HTTPS port in generated containers by Kubernetes #30302

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

Sgitario
Copy link
Contributor

@Sgitario Sgitario commented Jan 11, 2023

These changes will add an additional container port HTTPS in the generated manifests:

containers:
        - image: ...
          imagePullPolicy: IfNotPresent
          name: kubernetes-kind
          ports:
            - containerPort: 8080
              name: http
              protocol: TCP
            - containerPort: 8443
              name: https
              protocol: TCP

By default, the Ingress and Route resources will use the "http" port. However, as part of these changes, I've added a new property to select between "https" or "http", or any other that user might have added as part of the configuration. Example:

quarkus.kubernetes.ingress.target-port=https
quarkus.openshift.route.target-port=https

Finally, note that the https container won't be added for the Knative resources since there seems to be a limitation at Knative side where only one port can be used.

Fix #29999

@geoand
Copy link
Contributor

geoand commented Jan 11, 2023

I'll review this one closely tomorrow

@quarkus-bot

This comment has been minimized.

@geoand
Copy link
Contributor

geoand commented Jan 11, 2023

The test failure does seem related

@Sgitario
Copy link
Contributor Author

The test failure does seem related

Yep, it seems to be caused by a bug in Dekorate that I have just reported: dekorateio/dekorate#1123. What puzzles me is that the issue was random. Anyway, I already have a fix for Quarkus, so I will update this PR soon.

@Sgitario
Copy link
Contributor Author

PR updated

@quarkus-bot

This comment has been minimized.

@Sgitario
Copy link
Contributor Author

Spotted this new issue in Dekorate related to the Route port: dekorateio/dekorate#1124.
PR updated by adding another workaround.

@geoand
Copy link
Contributor

geoand commented Jan 12, 2023

Should we perhaps wait to get a Dekorate release?

@Sgitario
Copy link
Contributor Author

Should we perhaps wait to get a Dekorate release?

Taking into account that this is very usual, I would say better to work around the issues and when bumping Dekorate with the fixes, remove the workarounds. Otherwise, it would delay many features in Quarkus.

@geoand
Copy link
Contributor

geoand commented Jan 12, 2023

Otherwise, it would delay many features in Quarkus

What do you have in mind?

@Sgitario
Copy link
Contributor Author

Otherwise, it would delay many features in Quarkus

What do you have in mind?

No, I meant other changes in these Quarkus extensions. That this is what I used to do when I found blockers.

@geoand
Copy link
Contributor

geoand commented Jan 12, 2023

I would prefer we fix the issues in Dekorate first as this is a new feature so there is no real rush to get it in, but I won't object, as this is definitely useful work.

@Sgitario
Copy link
Contributor Author

I would prefer we fix the issues in Dekorate first as this is a new feature so there is no real rush to get it in, but I won't object, as this is definitely useful work.

I will be working on the issues in Dekorate. If we address them quickly, I'm also favored to wait for the next Dekorate release including these fixes and remove the workarounds from this pull request.

@geoand
Copy link
Contributor

geoand commented Jan 12, 2023

Thanks!

@quarkus-bot

This comment has been minimized.

Copy link
Contributor

@iocanel iocanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope that once we get a dekorat release out, we'll have less things to review.
So, I think that we should wait. After all the relevant PR are already merged on dekorate.

@Sgitario
Copy link
Contributor Author

Pull request that bumps Dekorate: #30351

@Sgitario
Copy link
Contributor Author

PR updated using the latest Dekorate release with the mentioned issues fixed.

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@Sgitario
Copy link
Contributor Author

Sgitario commented Jan 24, 2023

@iocanel any chance you can take a look into this, please?

@iocanel
Copy link
Contributor

iocanel commented Jan 24, 2023

Sure

Copy link
Contributor

@iocanel iocanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

I only have a minor naming concern on whether the property should be called target-port or target-port-name. In dekorate we went with the former, however I am having second thoughts, as in quarkus there are areas we are going to have one or the other (e.g. #30547).

@Sgitario
Copy link
Contributor Author

Sgitario commented Jan 24, 2023

Looks good to me.

I only have a minor naming concern on whether the property should be called target-port or target-port-name. In dekorate we went with the former, however I am having second thoughts, as in quarkus there are areas we are going to have one or the other (e.g. #30547).

I'm a bit reluctant of renaming the property to "target-port-name" because:

  • there is already an existing property for routes with the name "target-port"
  • in Dekorate, we decided to name it "target-port"

In case we want to also support port numbers, we can always add a new property "target-port-number" in a separated pull request (this should be done first in Dekorate, and also for routes).

@Sgitario Sgitario requested a review from iocanel January 26, 2023 06:25
@Sgitario
Copy link
Contributor Author

ping @iocanel

@iocanel
Copy link
Contributor

iocanel commented Jan 26, 2023

  • there is already an existing property for routes with the name "target-port"
    touche

Most importantly, it seems that in the kubernetes context target-port most of the times refers to name while port refers to
number. Something, that I think you also mentioned in one of your comments (but can't find it now).

Copy link
Contributor

@iocanel iocanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

These changes will add an additional container port HTTPS in the generated manifests:

```yaml
containers:
        - image: ...
          imagePullPolicy: IfNotPresent
          name: kubernetes-kind
          ports:
            - containerPort: 8080
              name: http
              protocol: TCP
            - containerPort: 8443
              name: https
              protocol: TCP
```

By default, the Ingress and Route resources will use the "http" port. However, as part of these changes, I've added a new property to select between "https" or "http", or any other that user might have added as part of the configuration. Example:

```
quarkus.kubernetes.ingress.target-port=https
quarkus.openshift.route.target-port=https
```

Finally, note that the https container won't be added for the Knative resources since there seems to be a limitation at Knative side.

Fix quarkusio#29999
asd
@github-actions
Copy link

github-actions bot commented Jan 26, 2023

🙈 The PR is closed and the preview is expired.

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 26, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@Sgitario Sgitario merged commit a02a81a into quarkusio:main Jan 26, 2023
@Sgitario Sgitario deleted the 29999 branch January 26, 2023 13:22
@quarkus-bot quarkus-bot bot added this to the 2.17 - main milestone Jan 26, 2023
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kubernetes Extension Should be Aware of Standard TLS Properties
3 participants