From 8b27fa2f2e8746730dd88516124df13973cc6518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ju=CC=88rgen=20Bru=CC=88der?= Date: Mon, 28 Jun 2021 11:07:16 +0200 Subject: [PATCH] added user,animal and ip replacement --- examples/12-factor-app-v2/k8s/traefik-ingress.yaml | 8 ++++---- examples/12-factor-app-v2/k8s/traefik.yaml | 10 +++++----- replace-variables.sh | 10 ++++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 replace-variables.sh diff --git a/examples/12-factor-app-v2/k8s/traefik-ingress.yaml b/examples/12-factor-app-v2/k8s/traefik-ingress.yaml index 0971107..b44b97e 100644 --- a/examples/12-factor-app-v2/k8s/traefik-ingress.yaml +++ b/examples/12-factor-app-v2/k8s/traefik-ingress.yaml @@ -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--i-01..commandemy.training`) && PathPrefix(`/`) kind: Rule services: - name: api @@ -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--i-01..commandemy.training`) && PathPrefix(`/`) kind: Rule services: - name: api diff --git a/examples/12-factor-app-v2/k8s/traefik.yaml b/examples/12-factor-app-v2/k8s/traefik.yaml index 2f62785..017304a 100644 --- a/examples/12-factor-app-v2/k8s/traefik.yaml +++ b/examples/12-factor-app-v2/k8s/traefik.yaml @@ -172,7 +172,7 @@ metadata: app: traefik spec: externalIPs: - - 10.0.0.242 # IP of your centos host (hostname -i) + - #10.0.0.242 IP of your centos host (hostname -i) ports: - protocol: TCP name: web @@ -184,7 +184,7 @@ spec: name: websecure port: 443 - protocol: TCP - name: metrics + name: metrics port: 8082 selector: app: traefik @@ -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 @@ -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 @@ -255,4 +255,4 @@ spec: - name: admin containerPort: 8080 - name: metrics - containerPort: 8082 + containerPort: 8082 diff --git a/replace-variables.sh b/replace-variables.sh new file mode 100644 index 0000000..88adb93 --- /dev/null +++ b/replace-variables.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Replace +find 12* -type f -exec sed -i -e "s//$USER_ID/g" {} \; + +# Replace +find 12* -type f -exec sed -i -e "s//$ANIMAL/g" {} \; + +# Replace +find 12* -type f -exec sed -i -e "s//$HOST_IP/g" {} \;