Skip to content

Commit

Permalink
Simplify domain config for local-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
roivaz committed May 2, 2024
1 parent 7b388e7 commit b7daf7b
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 113 deletions.
19 changes: 4 additions & 15 deletions config/local-setup/env-inputs/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,12 @@ data:
ENVOY_IMAGE: envoyproxy/envoy:v1.22.11

# DOMAIN CONFIGURATION
SYSTEM_ENDPOINT: https://multitenant-admin.system-172-27-27-105.nip.io
AUTOSSL_VERIFICATION_ENDPOINT: https://multitenant-admin.system-172-27-27-105.nip.io/swagger/spec.json
SYSTEM_EVENTS_URL: https://system-172-27-27-105.nip.io/master/events/import
SYSTEM_SUPERDOMAIN: system-172-27-27-105.nip.io
BACKEND_EXTERNAL_ENDPOINT: http://backend-172-27-27-100.nip.io
SYSTEM_ENDPOINT: multitenant-admin.system-172-27-27-105.nip.io
BACKEND_ENDPOINT: backend-172-27-27-100.nip.io
APICAST_STAGING_DOMAIN: staging-172-27-27-102.nip.io
APICAST_PRODUCTION_DOMAIN: production-172-27-27-101.nip.io
APICAST_CLOUD_HOSTED_REGISTRY_URL: http://apicast-staging-management:8090/policies
APICAST_SELF_MANAGED_REGISTRY_URL: http://policies.apicast.io/latest/policies.json

# DNS CONFIG
APICAST_STAGING_DNS: '*.staging-172-27-27-102.nip.io'
APICAST_PRODUCTION_DNS: '*.production-172-27-27-101.nip.io'
AUTOSSL_DNS: autossl-172-27-27-104.nip.io
BACKEND_DNS: backend-172-27-27-100.nip.io
ECHOAPI_DNS: echo-api-172-27-27-103.nip.io
SYSTEM_DNS: '*.system-172-27-27-105.nip.io'
AUTOSSL_ENDPOINT: autossl-172-27-27-104.nip.io
ECHOAPI_ENDPOINT: echo-api-172-27-27-103.nip.io

# CERTIFICATE CONFIG
CERT_MANAGER_ISSUER: selfsigned-cluster-issuer
4 changes: 2 additions & 2 deletions config/local-setup/workloads/apicast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
config:
configurationCache: 300
threescalePortalEndpoint: "http://mapping-service/config"
endpoint: {dns: [REPLACE]}
endpoint: {dns: ['*.REPLACE']}
hpa: {}
loadBalancer:
proxyProtocol: false
Expand Down Expand Up @@ -62,7 +62,7 @@ spec:
config:
configurationCache: 60
threescalePortalEndpoint: "http://mapping-service/config"
endpoint: {dns: [REPLACE]}
endpoint: {dns: ['*.REPLACE']}
hpa: {}
loadBalancer:
proxyProtocol: false
Expand Down
4 changes: 2 additions & 2 deletions config/local-setup/workloads/autossl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ spec:
contactEmail: 3scale-operations@redhat.com
domainWhitelist: []
logLevel: debug
proxyEndpoint: REPLACE
proxyEndpoint: https://REPLACE
redisHost: autossl-redis
verificationEndpoint: REPLACE
verificationEndpoint: https://REPLACE/swagger/spec.json
endpoint: {dns: [REPLACE]}
hpa: {}
pdb: {}
Expand Down
2 changes: 1 addition & 1 deletion config/local-setup/workloads/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
redisQueuesDSN: "redis://backend-redis:6379/1"
redisStorageDSN: "redis://backend-redis:6379/0"
systemEventsHookPassword: {}
systemEventsHookURL: {override: REPLACE }
systemEventsHookURL: {override: https://REPLACE/master/events/import }
listener:
config:
listenerWorkers: 1
Expand Down
2 changes: 1 addition & 1 deletion config/local-setup/workloads/mappingservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: mapping-service
spec:
config:
apiHost: REPLACE
apiHost: https://REPLACE
systemAdminToken: {fromSeed: {}}
image:
name: REPLACE
Expand Down
4 changes: 2 additions & 2 deletions config/local-setup/workloads/mt-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Certificate
metadata:
name: mt-ingress-cert
spec:
dnsNames: [REPLACE]
dnsNames: ['*.REPLACE']
issuerRef:
kind: ClusterIssuer
name: selfsigned-cluster-issuer
Expand Down Expand Up @@ -36,7 +36,7 @@ apiVersion: v1
kind: Service
metadata:
annotations:
external-dns.alpha.kubernetes.io/hostname: REPLACE
external-dns.alpha.kubernetes.io/hostname: '*.REPLACE'
service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled: "true"
service.beta.kubernetes.io/aws-load-balancer-connection-draining-timeout: "60"
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
Expand Down
143 changes: 56 additions & 87 deletions config/local-setup/workloads/replacements/domains.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
# APICAST
# CONFIGURE APICAST ENDPOINTS
- source:
kind: ConfigMap
name: config
fieldPath: data.APICAST_STAGING_DNS
fieldPath: data.APICAST_STAGING_DOMAIN
targets:
- select:
kind: Apicast
fieldPaths:
- spec.staging.endpoint.dns.0
options:
delimiter: "."
index: 1
- select:
kind: System
fieldPaths:
- spec.config.apicast.stagingDomain
- source:
kind: ConfigMap
name: config
fieldPath: data.APICAST_PRODUCTION_DNS
fieldPath: data.APICAST_PRODUCTION_DOMAIN
targets:
- select:
kind: Apicast
fieldPaths:
- spec.production.endpoint.dns.0
options:
delimiter: "."
index: 1
- select:
kind: System
fieldPaths:
- spec.config.apicast.productionDomain

# AUTOSSL
# CONFIGURE AUTOSSL ENDPOINT
- source:
kind: ConfigMap
name: config
Expand All @@ -28,142 +42,97 @@
kind: AutoSSL
fieldPaths:
- spec.config.proxyEndpoint
- source:
kind: ConfigMap
name: config
fieldPath: data.AUTOSSL_VERIFICATION_ENDPOINT
targets:
- select:
kind: AutoSSL
fieldPaths:
- spec.config.verificationEndpoint
options:
delimiter: "/"
index: 2
- source:
kind: ConfigMap
name: config
fieldPath: data.AUTOSSL_DNS
fieldPath: data.AUTOSSL_ENDPOINT
targets:
- select:
kind: AutoSSL
fieldPaths:
- spec.endpoint.dns.0

# BACKEND
# CONFIGURE ECHOAPI ENDPOINT
- source:
kind: ConfigMap
name: config
fieldPath: data.SYSTEM_EVENTS_URL
targets:
- select:
kind: Backend
fieldPaths:
- spec.config.systemEventsHookURL.override
- source:
kind: ConfigMap
name: config
fieldPath: data.BACKEND_DNS
targets:
- select:
kind: Backend
fieldPaths:
- spec.listener.endpoint.dns.0

# ECHOAPI
- source:
kind: ConfigMap
name: config
fieldPath: data.ECHOAPI_DNS
fieldPath: data.ECHOAPI_ENDPOINT
targets:
- select:
kind: EchoAPI
fieldPaths:
- spec.endpoint.dns.0

# MAPPINGSERVICE
# CONFIGURE BACKEND ENDPOINT
- source:
kind: ConfigMap
name: config
fieldPath: data.SYSTEM_ENDPOINT
fieldPath: data.BACKEND_ENDPOINT
targets:
- select:
kind: MappingService
fieldPaths:
- spec.config.apiHost

# SYSTEM
- source:
kind: ConfigMap
name: config
fieldPath: data.SYSTEM_SUPERDOMAIN
targets:
- select:
kind: System
kind: Backend
fieldPaths:
- spec.config.threescaleSuperdomain
- source:
kind: ConfigMap
name: config
fieldPath: data.BACKEND_EXTERNAL_ENDPOINT
targets:
- spec.listener.endpoint.dns.0
- select:
kind: System
fieldPaths:
- spec.config.backend.externalEndpoint
options:
delimiter: "/"
index: 2

# CONFIGURE SYSTEM ENDPOINT
- source:
kind: ConfigMap
name: config
fieldPath: data.APICAST_STAGING_DOMAIN
targets:
- select:
kind: System
fieldPaths:
- spec.config.apicast.stagingDomain
- source:
kind: ConfigMap
name: config
fieldPath: data.APICAST_PRODUCTION_DOMAIN
fieldPath: data.SYSTEM_ENDPOINT
targets:
- select:
kind: System
kind: Backend
fieldPaths:
- spec.config.apicast.productionDomain
- source:
kind: ConfigMap
name: config
fieldPath: data.APICAST_CLOUD_HOSTED_REGISTRY_URL
targets:
- spec.config.systemEventsHookURL.override
options:
delimiter: "/"
index: 2
- select:
kind: System
kind: MappingService
fieldPaths:
- spec.config.apicast.cloudHostedRegistryURL
- spec.config.apiHost
options:
delimiter: "/"
index: 2
- source:
kind: ConfigMap
name: config
fieldPath: data.APICAST_SELF_MANAGED_REGISTRY_URL
fieldPath: data.SYSTEM_ENDPOINT
options:
delimiter: "multitenant-admin."
index: 1
targets:
- select:
kind: System
fieldPaths:
- spec.config.apicast.selfManagedRegistryURL
- source:
kind: ConfigMap
name: config
fieldPath: data.SYSTEM_DNS
targets:
- spec.config.threescaleSuperdomain
- select:
kind: Service
name: mt-ingress
fieldPaths:
- metadata.annotations.[external-dns.alpha.kubernetes.io/hostname]
- source:
kind: ConfigMap
name: config
fieldPath: data.SYSTEM_DNS
targets:
options:
delimiter: "."
index: 1
- select:
kind: Certificate
name: mt-ingress-cert
fieldPaths:
- spec.dnsNames.0
options:
delimiter: "."
index: 1

# CERT-MANAGER
- source:
Expand All @@ -174,4 +143,4 @@
- select:
kind: Certificate
fieldPaths:
- spec.issuerRef.name
- spec.issuerRef.name
6 changes: 3 additions & 3 deletions config/local-setup/workloads/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
redis:
queuesDSN: "redis://system-redis:6379"
backend:
externalEndpoint: REPLACE
externalEndpoint: http://REPLACE
internalAPIPassword: {fromSeed: {}}
internalAPIUser: {fromSeed: {}}
internalEndpoint: "http://backend-listener-internal"
Expand Down Expand Up @@ -66,8 +66,8 @@ spec:
apicast:
stagingDomain: REPLACE
productionDomain: REPLACE
cloudHostedRegistryURL: REPLACE
selfManagedRegistryURL: REPLACE
cloudHostedRegistryURL: http://apicast-staging-management:8090/policies
selfManagedRegistryURL: https://policies.apicast.io/latest/policies.json
app:
hpa: {}
pdb: {}
Expand Down

0 comments on commit b7daf7b

Please sign in to comment.