-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f189190
commit 5195fbc
Showing
6 changed files
with
128 additions
and
77 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
14 changes: 14 additions & 0 deletions
14
...ts/e2e/cmd/runner/testdata/one-namespace-one-ingress/ssl-e2e-redirect/README.md
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,14 @@ | ||
To add the root certificate to app gateway, use | ||
|
||
``` | ||
az network application-gateway root-cert create -n test --cert-file test.crt --gateway-name <gateway> --resource-group <resgp> | ||
``` | ||
|
||
To generate a new self-signed certificate: | ||
``` | ||
openssl ecparam -out test.key -name prime256v1 -genkey | ||
openssl req -new -sha256 -key test.key -out test.csr -subj "/CN=test" | ||
openssl x509 -req -sha256 -days 365 -in test.csr -signkey test.key -out test.cer | ||
``` | ||
|
||
If you are using a different certificate, don't forget to update the tls secret in the app.yaml. |
94 changes: 94 additions & 0 deletions
94
scripts/e2e/cmd/runner/testdata/one-namespace-one-ingress/ssl-e2e-redirect/app.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,94 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: nginx-cm | ||
data: | ||
default.conf: |- | ||
server { | ||
listen 80 default_server; | ||
listen 443 ssl; | ||
root /usr/share/nginx/html; | ||
index index.html; | ||
ssl_certificate /etc/nginx/ssl/tls.crt; | ||
ssl_certificate_key /etc/nginx/ssl/tls.key; | ||
location / { | ||
try_files $uri $uri/ =404; | ||
} | ||
} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: ssl-redirect-deployment | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: ssl-redirect | ||
replicas: 2 | ||
template: | ||
metadata: | ||
labels: | ||
app: ssl-redirect | ||
spec: | ||
containers: | ||
- name: nginx | ||
imagePullPolicy: Always | ||
image: nginx:latest | ||
ports: | ||
- containerPort: 443 | ||
volumeMounts: | ||
- mountPath: /etc/nginx/ssl | ||
name: secret-volume | ||
- mountPath: /etc/nginx/conf.d | ||
name: configmap-volume | ||
volumes: | ||
- name: secret-volume | ||
secret: | ||
secretName: testsecret-tls | ||
- name: configmap-volume | ||
configMap: | ||
name: nginx-cm | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: ssl-redirect-service | ||
spec: | ||
selector: | ||
app: ssl-redirect | ||
ports: | ||
- protocol: TCP | ||
port: 443 | ||
targetPort: 443 | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: ssl-redirect-ingress | ||
annotations: | ||
kubernetes.io/ingress.class: azure/application-gateway | ||
appgw.ingress.kubernetes.io/ssl-redirect: "true" | ||
appgw.ingress.kubernetes.io/backend-hostname: "test" | ||
appgw.ingress.kubernetes.io/appgw-trusted-root-certificate: "test" | ||
spec: | ||
tls: | ||
- secretName: testsecret-tls | ||
backend: | ||
serviceName: ssl-redirect-service | ||
servicePort: 443 | ||
rules: | ||
- http: | ||
paths: | ||
- path: /index.html | ||
backend: | ||
serviceName: ssl-redirect-service | ||
servicePort: 443 | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: testsecret-tls | ||
type: kubernetes.io/tls | ||
data: | ||
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJEVENCdEFJSkFLWTlOYkJMVjlJTE1Bb0dDQ3FHU000OUJBTUNNQTh4RFRBTEJnTlZCQU1NQkhSbGMzUXcKSGhjTk1qQXdOVEU0TWpFeU1UUXpXaGNOTWpFd05URTRNakV5TVRReldqQVBNUTB3Q3dZRFZRUUREQVIwWlhOMApNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUU2eHlzV0lhZUFkenYveXdUNTl5NDNreXppUGViCmMvaEpLOCt1Nm9uMmtOYjJpZ2tuTDZndU9PYWxsamQxOVB1dTYwYmh4aEpobGJpcHpBcWZCcFYzYnpBS0JnZ3EKaGtqT1BRUURBZ05JQURCRkFpRUFzbGNmNjNId0hxUDZoMHJTdjg3TXlBRVVoWmRoUlNZdm5sMGQyazRxZGtZQwpJRG1qNWdDcFAzTldmZWRVZHh6bTlsOEtxRUl2c1VxL1hXYWxUODhTWitWQQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg== | ||
tls.key: LS0tLS1CRUdJTiBFQyBQQVJBTUVURVJTLS0tLS0KQmdncWhrak9QUU1CQnc9PQotLS0tLUVORCBFQyBQQVJBTUVURVJTLS0tLS0KLS0tLS1CRUdJTiBFQyBQUklWQVRFIEtFWS0tLS0tCk1IY0NBUUVFSUdQeE1qSytnOEd1dWhlMW1PQUZHY1V3V09xdHZRbjZCTHBQZVJGUTZUNHhvQW9HQ0NxR1NNNDkKQXdFSG9VUURRZ0FFNnh5c1dJYWVBZHp2L3l3VDU5eTQza3l6aVBlYmMvaEpLOCt1Nm9uMmtOYjJpZ2tuTDZndQpPT2FsbGpkMTlQdXU2MGJoeGhKaGxiaXB6QXFmQnBWM2J3PT0KLS0tLS1FTkQgRUMgUFJJVkFURSBLRVktLS0tLQo= |
8 changes: 8 additions & 0 deletions
8
scripts/e2e/cmd/runner/testdata/one-namespace-one-ingress/ssl-e2e-redirect/test.crt
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 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIBDTCBtAIJAKY9NbBLV9ILMAoGCCqGSM49BAMCMA8xDTALBgNVBAMMBHRlc3Qw | ||
HhcNMjAwNTE4MjEyMTQzWhcNMjEwNTE4MjEyMTQzWjAPMQ0wCwYDVQQDDAR0ZXN0 | ||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE6xysWIaeAdzv/ywT59y43kyziPeb | ||
c/hJK8+u6on2kNb2igknL6guOOalljd19Puu60bhxhJhlbipzAqfBpV3bzAKBggq | ||
hkjOPQQDAgNIADBFAiEAslcf63HwHqP6h0rSv87MyAEUhZdhRSYvnl0d2k4qdkYC | ||
IDmj5gCpP3NWfedUdxzm9l8KqEIvsUq/XWalT88SZ+VA | ||
-----END CERTIFICATE----- |
71 changes: 0 additions & 71 deletions
71
scripts/e2e/cmd/runner/testdata/one-namespace-one-ingress/ssl-redirect/app.yaml
This file was deleted.
Oops, something went wrong.