-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dynamically secure RouteGroups using Kubernetes TLS Secrets (#2814)
* Add TLS spec to RouteGroup CRD * Add RouteGroup implementation and tests for securing TLS using secrets Signed-off-by: Ricardo Herrera <[email protected]>
- Loading branch information
Showing
42 changed files
with
805 additions
and
174 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
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
1 change: 1 addition & 0 deletions
1
dataclients/kubernetes/testdata/ingressV1/tls/tls-host-mismatch.kube
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 @@ | ||
kubernetes-enable-tls: true |
2 changes: 2 additions & 0 deletions
2
dataclients/kubernetes/testdata/ingressV1/tls/tls-host-mismatch.log
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,2 @@ | ||
level=info msg="Hosts in TLS and Ingress don't match: tls hosts: \[example.org bar.org\], ingress hosts: \[example.org\]" kind=Ingress name=myapp-ingress ns=default | ||
level=info msg="adding certificate to registry - example.org" |
69 changes: 69 additions & 0 deletions
69
dataclients/kubernetes/testdata/ingressV1/tls/tls-host-mismatch.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,69 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: myapp-deployment | ||
name: myapp-service | ||
spec: | ||
clusterIP: 10.3.190.1 | ||
ports: | ||
- name: this-is-my-service-port-name | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: my-port | ||
selector: | ||
app: myapp | ||
type: ClusterIP | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
labels: | ||
app: myapp | ||
name: myapp-ingress | ||
namespace: default | ||
spec: | ||
tls: | ||
- secretName: myapp-secret | ||
hosts: | ||
- example.org | ||
- bar.org | ||
rules: | ||
- host: example.org | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: myapp-service | ||
port: | ||
number: 8080 | ||
pathType: ImplementationSpecific | ||
--- | ||
apiVersion: v1 | ||
kind: Endpoints | ||
metadata: | ||
labels: | ||
app: myapp-deployment | ||
name: myapp-service | ||
subsets: | ||
- addresses: | ||
- ip: 10.3.0.3 | ||
targetRef: | ||
kind: Pod | ||
name: myapp-deployment-6786bf95fd-fnqnq | ||
ports: | ||
- name: this-is-my-service-port-name | ||
port: 80 | ||
protocol: TCP | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: myapp-secret | ||
namespace: default | ||
type: kubernetes.io/tls | ||
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w3U3NjVk45djhaSXZGc0hmUWI3bVM1QnZ6dWhTb1gKaDlBT3VYUjdxVTlscW10bUZnMkFod1VET3FHQzViSStEU3dKTWV2MFBQekIrNFJOY0xyUVpLN3pvRkFSc3hQUApEbmQxTlFLQ0FRQXlJM0xCOUQxUlg1NkhEYmI4WTZobk1wM2xTTmU3aWxpNy8zMjNCczB2QTZ6R0hod2o4ajlnCjVHcEJSd2ZXdCszUkRvZlQrL1h3K1MxTmdUTVJxWkw3M3V3VjdIWnhaTkE4NU5TUDk2bG5EbmpXN3NzTFhtY0wKRFRNQy83UVBaOU1xYmt4SXNDV0wwaml2bSs0a0UrSStqWXlHdkx0a2hlU1NHOU5pOGM1SzlwdjF1Z3ZVOUpwSAo0QlRSblhCd2JOUnVMZ3JpcHJwZjJKS2dYQmlPWEFTZUVmbzMvSTRETjZISWxwUFdoRDkwb0MyaWhvU3JrL2lVCmFMSnVCUmhncDJBelFYMWlBMDcxczNJR3ZlUERnN1RYd2Y4ZDM2bFhnVWNTTEJ0N2FmVzNoOGordEVCZ1FQTEwKVk9seXgzYzVNdVpaZDhHWXBKNGUwUDFJYWJzN2ZwZEEKLS0tLS1FTkQgUFJJVkFURSBLRVktLS0tLQo= |
24 changes: 0 additions & 24 deletions
24
dataclients/kubernetes/testdata/ingressV1/tls/tls-invalid-secret.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
24 changes: 0 additions & 24 deletions
24
dataclients/kubernetes/testdata/ingressV1/tls/tls-invalid-tls.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
Oops, something went wrong.