Skip to content

Commit

Permalink
Add property for ingressClassName
Browse files Browse the repository at this point in the history
  • Loading branch information
Sgitario authored and iocanel committed Dec 16, 2022
1 parent 49f4eb4 commit 545e32a
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
*/
String host() default "";

/**
* The class of the Ingress. If the ingressClassName is omitted, a default Ingress class is used.
*
* @return The class of the Ingress.
*/
String ingressClassName() default "";

/**
* Controls whether the application should be exposed via Ingress
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void visit(KubernetesListBuilder list) {
.withLabels(allLabels)
.endMetadata()
.withNewSpec()
.withIngressClassName(Strings.defaultIfEmpty(config.getIngress().getIngressClassName(), null))
.addNewRule()
.withHost(config.getIngress().getHost())
.withNewHttp()
Expand Down
17 changes: 12 additions & 5 deletions assets/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ The document is structured as follows.
| dekorate.kubernetes.deployment-strategy | DeploymentStrategy | Specifies the deployment strategy. | None |
| dekorate.kubernetes.rolling-update | RollingUpdate | Specifies rolling update configuration. The configuration is applied when DeploymentStrategy == Rolling update, or when explicit configuration has been provided. In the later case RollingUpdate is assumed. | ( see RollingUpdate ) |
| dekorate.kubernetes.service-account | String | The service account. | |
| dekorate.kubernetes.ingress.expose | boolean | Controls whether the application should be exposed via Ingress | false |
| dekorate.kubernetes.ingress.host | String | The host under which the application is going to be exposed. | |
| dekorate.kubernetes.ingress.tls-secret-name | String | The name of the secret used to configure TLS. | |
| dekorate.kubernetes.ingress.tls-hosts | String[] | The list of hosts to be included in the TLS certificate. By default, it will use the application host. | |
| dekorate.kubernetes.ingress.rules | IngressRule[] | Controls the generated ingress rules to be exposed as part of the Ingress resource. | |
| dekorate.kubernetes.ports | Port[] | The application ports. | |
| dekorate.kubernetes.service-type | ServiceType | The type of service that will be generated for the application. | ClusterIP |
| dekorate.kubernetes.pvc-volumes | PersistentVolumeClaimVolume[] | PersistentVolumeClaim volumes to add to all containers. | |
Expand All @@ -94,6 +89,7 @@ The document is structured as follows.
| dekorate.kubernetes.request-resources | ResourceRequirements | The resources that the application container requires. | ( see ResourceRequirements ) |
| dekorate.kubernetes.limit-resources | ResourceRequirements | The resource limit for the application container. | ( see ResourceRequirements ) |
| dekorate.kubernetes.sidecars | Container[] | The sidecars. | |
| dekorate.kubernetes.ingress | Ingress | Configure the ingress resource. Only if the `expose` property is enabled. | (See Ingress) |
| dekorate.kubernetes.headless | boolean | Controls whether the generated {@link Service} will be headless. | false |
| dekorate.kubernetes.auto-deploy-enabled | boolean | Flag to trigger the registration of the deploy hook. It's generally preferable to use `-Ddekorate.deploy=true` instead of hardcoding this here. | false |
| dekorate.kubernetes.jobs | Job[] | The kubernetes jobs. | ( see Job ) |
Expand Down Expand Up @@ -124,6 +120,17 @@ The section below describes all the available subtypes.
| configmap | String | | |
| field | String | | |

#### Ingress

| Property | Type | Description | Default Value |
|--------------------|---------------|--------------------------------------------------------------------------------------|-----------------------|
| expose | boolean | Controls whether the application should be exposed via Ingress. | false |
| host | String | The host under which the application is going to be exposed. | |
| ingressClassName | String | The class of the Ingress. | |
| tlsSecretName | String | The name of the secret used to configure TLS | |
| tlsHosts | String[] | The list of hosts to be included in the TLS certificate | The application host |
| rules | IngressRule[] | Controls the generated ingress rules to be exposed as part of the Ingress resource. | |

#### IngressRule
| Property | Type | Description | Default Value |
|----------------------|----------|--------------------------------------------------------------------------------------------------------------------|---------------|
Expand Down
Loading

0 comments on commit 545e32a

Please sign in to comment.