Skip to content

Commit

Permalink
Merge pull request #300 from 3scale-ops/feat/local-setup/tls
Browse files Browse the repository at this point in the history
Add TLS for all endpoints in local-setup
  • Loading branch information
3scale-robot authored May 22, 2024
2 parents 606ce77 + 2322ee4 commit 7b02dd1
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 2 deletions.
40 changes: 38 additions & 2 deletions config/local-setup/workloads/apicast.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: apicast-staging-wildcard-cert
spec:
dnsNames: ["*.REPLACE"]
issuerRef:
kind: ClusterIssuer
name: selfsigned-cluster-issuer
secretName: apicast-staging-wildcard-cert

---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: apicast-production-wildcard-cert
spec:
dnsNames: ["*.REPLACE"]
issuerRef:
kind: ClusterIssuer
name: selfsigned-cluster-issuer
secretName: apicast-production-wildcard-cert

---
apiVersion: saas.3scale.net/v1alpha1
kind: Apicast
metadata:
Expand All @@ -12,7 +36,7 @@ spec:
config:
configurationCache: 300
threescalePortalEndpoint: "http://mapping-service/config"
endpoint: {dns: ['*.REPLACE']}
endpoint: {dns: ["*.REPLACE"]}
hpa: {}
loadBalancer:
proxyProtocol: false
Expand All @@ -27,6 +51,12 @@ spec:
proxyProtocol: false
port: 38080
routeConfigName: router
https:
listenerHttp:
proxyProtocol: false
certificateSecretName: apicast-production-wildcard-cert
port: 38443
routeConfigName: router
router:
routeConfiguration:
virtualHosts:
Expand Down Expand Up @@ -62,7 +92,7 @@ spec:
config:
configurationCache: 60
threescalePortalEndpoint: "http://mapping-service/config"
endpoint: {dns: ['*.REPLACE']}
endpoint: {dns: ["*.REPLACE"]}
hpa: {}
loadBalancer:
proxyProtocol: false
Expand All @@ -77,6 +107,12 @@ spec:
proxyProtocol: false
port: 38080
routeConfigName: router
https:
listenerHttp:
proxyProtocol: false
certificateSecretName: apicast-staging-wildcard-cert
port: 38443
routeConfigName: router
mgmt_cluster:
cluster:
host: 127.0.0.1
Expand Down
17 changes: 17 additions & 0 deletions config/local-setup/workloads/backend.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: backend-cert
spec:
dnsNames: ["REPLACE"]
issuerRef:
kind: ClusterIssuer
name: selfsigned-cluster-issuer
secretName: backend-cert

---
apiVersion: saas.3scale.net/v1alpha1
kind: Backend
Expand Down Expand Up @@ -42,6 +53,12 @@ spec:
port: 38081
proxyProtocol: false
routeConfigName: router_internal
https:
listenerHttp:
proxyProtocol: false
certificateSecretName: backend-cert
port: 38443
routeConfigName: router_external
router_external:
routeConfiguration:
virtualHosts:
Expand Down
18 changes: 18 additions & 0 deletions config/local-setup/workloads/echoapi.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: echoapi-cert
spec:
dnsNames: ["REPLACE"]
issuerRef:
kind: ClusterIssuer
name: selfsigned-cluster-issuer
secretName: echoapi-cert

---
apiVersion: saas.3scale.net/v1alpha1
kind: EchoAPI
metadata:
Expand Down Expand Up @@ -33,6 +45,12 @@ spec:
proxyProtocol: false
port: 38080
routeConfigName: echo_api_route
https:
listenerHttp:
proxyProtocol: false
certificateSecretName: echoapi-cert
port: 38443
routeConfigName: echo_api_route
envoyImage: REPLACE
nodeID: echo-api
ports:
Expand Down
26 changes: 26 additions & 0 deletions config/local-setup/workloads/replacements/domains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
kind: System
fieldPaths:
- spec.config.apicast.stagingDomain
- select:
kind: Certificate
name: apicast-staging-wildcard-cert
fieldPaths:
- spec.dnsNames.0
options:
delimiter: "."
index: 1
- source:
kind: ConfigMap
name: config
Expand All @@ -31,6 +39,14 @@
kind: System
fieldPaths:
- spec.config.apicast.productionDomain
- select:
kind: Certificate
name: apicast-production-wildcard-cert
fieldPaths:
- spec.dnsNames.0
options:
delimiter: "."
index: 1

# CONFIGURE AUTOSSL ENDPOINT
- source:
Expand Down Expand Up @@ -66,6 +82,11 @@
kind: EchoAPI
fieldPaths:
- spec.endpoint.dns.0
- select:
kind: Certificate
name: echoapi-cert
fieldPaths:
- spec.dnsNames.0

# CONFIGURE BACKEND ENDPOINT
- source:
Expand All @@ -84,6 +105,11 @@
options:
delimiter: "/"
index: 2
- select:
kind: Certificate
name: backend-cert
fieldPaths:
- spec.dnsNames.0

# CONFIGURE SYSTEM ENDPOINT
- source:
Expand Down

0 comments on commit 7b02dd1

Please sign in to comment.