Skip to content

Commit

Permalink
added user,animal and ip replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybrueder committed Jun 28, 2021
1 parent bf51134 commit 8b27fa2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
8 changes: 4 additions & 4 deletions examples/12-factor-app-v2/k8s/traefik-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ metadata:
spec:
entryPoints:
- web
routes: # change k8s.cno-user-XX-i-01.commandemy.training to your host DNS
- match: Host(`k8s.cno-user-XX-i-01.commandemy.training`) && PathPrefix(`/`)
routes:
- match: Host(`k8s.cno-user-<ENV-USER-ID>-i-01.<ENV-ANIMAL>.commandemy.training`) && PathPrefix(`/`)
kind: Rule
services:
- name: api
Expand All @@ -24,8 +24,8 @@ spec:
- websecure
tls:
certResolver: myresolver
routes: # change k8s.cno-user-XX-i-01.commandemy.training to your host DNS
- match: Host(`k8s.cno-user-XX-i-01.commandemy.training`) && PathPrefix(`/`)
routes:
- match: Host(`k8s.cno-user-<ENV-USER-ID>-i-01.<ENV-ANIMAL>.commandemy.training`) && PathPrefix(`/`)
kind: Rule
services:
- name: api
Expand Down
10 changes: 5 additions & 5 deletions examples/12-factor-app-v2/k8s/traefik.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ metadata:
app: traefik
spec:
externalIPs:
- 10.0.0.242 # IP of your centos host (hostname -i)
- <ENV-IP> #10.0.0.242 IP of your centos host (hostname -i)
ports:
- protocol: TCP
name: web
Expand All @@ -184,7 +184,7 @@ spec:
name: websecure
port: 443
- protocol: TCP
name: metrics
name: metrics
port: 8082
selector:
app: traefik
Expand Down Expand Up @@ -234,7 +234,7 @@ spec:
### PROMETHEUS ###
#- --metrics.prometheus=true
#- --metrics.prometheus.entryPoint=metrics
#- --entryPoints.metrics.address=:8082
#- --entryPoints.metrics.address=:8082
#- --metrics.prometheus.buckets=0.100000, 0.300000, 1.200000, 5.000000
#- --metrics.prometheus.addEntryPointsLabels=true
#- --metrics.prometheus.addServicesLabels=true
Expand All @@ -245,7 +245,7 @@ spec:
#- --tracing.jaeger.samplingParam=1.0
#- --tracing.jaeger.localAgentHostPort=127.0.0.1:6831
#- --tracing.jaeger.propagation=jaeger
#- --tracing.jaeger.traceContextHeaderName=uber-trace-id
#- --tracing.jaeger.traceContextHeaderName=uber-trace-id

ports:
- name: web
Expand All @@ -255,4 +255,4 @@ spec:
- name: admin
containerPort: 8080
- name: metrics
containerPort: 8082
containerPort: 8082
10 changes: 10 additions & 0 deletions replace-variables.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

# Replace <ENV-USER-ID>
find 12* -type f -exec sed -i -e "s/<ENV-USER-ID>/$USER_ID/g" {} \;

# Replace <ENV-ANIMAL>
find 12* -type f -exec sed -i -e "s/<ENV-ANIMAL>/$ANIMAL/g" {} \;

# Replace <ENV-IP>
find 12* -type f -exec sed -i -e "s/<ENV-IP>/$HOST_IP/g" {} \;

0 comments on commit 8b27fa2

Please sign in to comment.