-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add HTTPS port in generated containers by Kubernetes
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 because of the following Dekorate issue: dekorateio/dekorate#1119. Also, that the nodeport for Kind and Minikube resources will only be added for the http ports due to this Dekorate limitation: dekorateio/dekorate#1120. Both issues should be addressed in Dekorate and then fixed in a later pull requested. Fix #29999
- Loading branch information
Showing
31 changed files
with
299 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...nd/deployment/src/main/java/io/quarkus/kind/deployment/RemoveNodePortForNotHttpPorts.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.quarkus.kind.deployment; | ||
|
||
import io.dekorate.kind.decorator.ApplyPortToKindServiceDecorator; | ||
import io.dekorate.kubernetes.decorator.Decorator; | ||
import io.dekorate.kubernetes.decorator.NamedResourceDecorator; | ||
import io.fabric8.kubernetes.api.model.ObjectMeta; | ||
import io.fabric8.kubernetes.api.model.ServicePortFluent; | ||
|
||
public class RemoveNodePortForNotHttpPorts extends NamedResourceDecorator<ServicePortFluent> { | ||
public RemoveNodePortForNotHttpPorts(String name) { | ||
super(name); | ||
} | ||
|
||
@Override | ||
public void andThenVisit(ServicePortFluent servicePort, ObjectMeta objectMeta) { | ||
if (servicePort.hasNodePort() && !servicePort.getName().equals("http")) { | ||
servicePort.withNodePort(null); | ||
} | ||
} | ||
|
||
@Override | ||
public Class<? extends Decorator>[] after() { | ||
return new Class[] { ApplyPortToKindServiceDecorator.class }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
.../deployment/src/main/java/io/quarkus/kubernetes/deployment/ApplyIngressRuleDecorator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.quarkus.kubernetes.deployment; | ||
|
||
import java.util.Optional; | ||
|
||
import io.dekorate.kubernetes.config.IngressRule; | ||
import io.dekorate.kubernetes.config.Port; | ||
import io.dekorate.kubernetes.decorator.AddIngressRuleDecorator; | ||
|
||
/** | ||
* TODO: Workaround for https://github.com/dekorateio/dekorate/issues/1123 where all the ports are being configured as rules. | ||
*/ | ||
public class ApplyIngressRuleDecorator extends AddIngressRuleDecorator { | ||
public ApplyIngressRuleDecorator(String name, Optional<Port> defaultHostPort, IngressRule rule) { | ||
super(name, defaultHostPort, rule); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.