-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplified lookup service subpackage and overlay
- Loading branch information
1 parent
13161e0
commit 4e75876
Showing
7 changed files
with
52 additions
and
38 deletions.
There are no files selected for viewing
21 changes: 20 additions & 1 deletion
21
carvel-packages/installer/bundle/config/ytt/_ytt_lib/packages/educates/08-lookup.yaml
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 |
---|---|---|
@@ -1,7 +1,26 @@ | ||
#@ load("@ytt:data", "data") | ||
#@ load("@ytt:library", "library") | ||
#@ load("@ytt:template", "template") | ||
#@ load("/00-package.star", "image_reference", "image_pull_policy") | ||
|
||
#@ ingress_certificate = getattr(data.values.clusterIngress.tlsCertificate, "tls.crt") | ||
#@ ingress_private_key = getattr(data.values.clusterIngress.tlsCertificate, "tls.key") | ||
#@ image = image_reference("lookup-service") | ||
|
||
#@ if data.values.clusterIngress.tlsCertificateRef.name != None: | ||
#@ ingress_secret = data.values.clusterIngress.tlsCertificateRef.name | ||
#@ elif (ingress_certificate and ingress_private_key): | ||
#@ ingress_secret = "{}-tls".format(data.values.clusterIngress.domain) | ||
#@ end | ||
|
||
|
||
#@ def lookup_service_values(): | ||
tld: #@ "{}.{}".format(data.values.lookupService.ingressPrefix, data.values.clusterIngress.domain) | ||
certName: #@ ingress_secret | ||
image: #@ image | ||
imagePullPolicy: #@ image_pull_policy(image) | ||
#@ end | ||
|
||
#@ if data.values.lookupService.enabled: | ||
--- #@ template.replace(library.get("lookup-service").with_data_values(data.values, plain=True).eval()) | ||
--- #@ template.replace(library.get("lookup-service").with_data_values(lookup_service_values(), plain=True).eval()) | ||
#@ end |
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
22 changes: 4 additions & 18 deletions
22
...ytt/_ytt_lib/packages/educates/_ytt_lib/lookup-service/overlays.yaml/overlay-ingress.yaml
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 |
---|---|---|
@@ -1,29 +1,15 @@ | ||
#@ load("@ytt:overlay", "overlay") | ||
#@ load("@ytt:data", "data") | ||
|
||
#@ if (hasattr(data.values.clusterIngress, "clusterIssuer") and data.values.clusterIngress.clusterIssuer != None): | ||
#@ ingress_secret = "wildcard" | ||
#@ elif data.values.clusterIngress.tlsCertificateRef.name != None: | ||
#@ ingress_secret = data.values.clusterIngress.tlsCertificateRef.name | ||
#@ else: | ||
#@ ingress_secret = "{}-tls".format(data.values.clusterIngress.domain) | ||
#@ end | ||
|
||
#@overlay/match by=overlay.subset({"kind":"Ingress"}) | ||
--- | ||
#@ if/end hasattr(data.values.clusterIngress, "clusterIssuer") and data.values.clusterIngress.clusterIssuer != None: | ||
metadata: | ||
#@overlay/match missing_ok=True | ||
annotations: | ||
#@overlay/match missing_ok=True | ||
cert-manager.io/cluster-issuer: #@ data.values.clusterIngress.clusterIssuer | ||
spec: | ||
rules: | ||
#@overlay/match by=overlay.index(0) | ||
- host: #@ "{}.{}".format(data.values.lookupService.ingressPrefix, data.values.clusterIngress.domain) | ||
- host: #@ data.values.tld | ||
#@overlay/match missing_ok=True | ||
#@ if/end (hasattr(data.values.clusterIngress, "clusterIssuer") and data.values.clusterIngress.clusterIssuer != None) or (data.values.clusterIngress.tlsCertificateRef.name != None): | ||
#@ if/end data.values.certName != None: | ||
tls: | ||
- hosts: | ||
- #@ "{}.{}".format(data.values.lookupService.ingressPrefix, data.values.clusterIngress.domain) | ||
secretName: #@ ingress_secret | ||
- #@ data.values.tld | ||
secretName: #@ data.values.certName |
8 changes: 8 additions & 0 deletions
8
...ckages/installer/bundle/config/ytt/_ytt_lib/packages/educates/_ytt_lib/values-schema.yaml
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,8 @@ | ||
#@data/values-schema | ||
--- | ||
#! Ingress | ||
tld: "" | ||
certName: "" | ||
#! Images | ||
image: "" | ||
imagePullPolicy: "" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,8 +107,8 @@ clusterInfrastructure: | |
#@schema/example "[email protected]" | ||
#@schema/validation ("workloadIdentity for cert-manager is required for gcp based providers",lambda v: len(v) >= 1) | ||
cert-manager: "" | ||
#@schema/title "Additional CA Certificate" | ||
#@schema/desc "Additional CA Certificates to inject to the cluster. Currently only supported when provider is set to kind" | ||
#@schema/title "CA Certificate" | ||
#@schema/desc "CA Certificates to inject to the cluster. When provider is set to kind it'll configure cert-manager to generate certs. CA Issuers must be configured with a certificate (tls.crt) and private key (tls.key) stored in the Kubernetes secret" | ||
#@schema/nullable | ||
caCertificateRef: | ||
#@schema/validation min_len=1 | ||
|