Skip to content

Commit

Permalink
fix: env name update (#49)
Browse files Browse the repository at this point in the history
* fix: env-name replace script update

Signed-off-by: Martin Buchleitner <mbuchleitner@infralovers.com>

* fix: hostname update on whoami

Signed-off-by: Martin Buchleitner <mbuchleitner@infralovers.com>

---------

Signed-off-by: Martin Buchleitner <mbuchleitner@infralovers.com>
  • Loading branch information
mabunixda authored Mar 27, 2023
1 parent 67a6bec commit 7b1b997
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 21 deletions.
5 changes: 3 additions & 2 deletions examples/kubernetes/traefik/traefik-dashboard-service.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
apiVersion: v1
kind: Service
metadata:
name: traefik-dashboard
namespace: kube-system
labels:
app.kubernetes.io/instance: traefik-kube-system
app.kubernetes.io/instance: traefik
app.kubernetes.io/name: traefik-dashboard
spec:
type: ClusterIP
Expand All @@ -14,5 +15,5 @@ spec:
targetPort: traefik
protocol: TCP
selector:
app.kubernetes.io/instance: traefik
app.kubernetes.io/instance: traefik-kube-system
app.kubernetes.io/name: traefik
30 changes: 14 additions & 16 deletions examples/kubernetes/traefik/traefik-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: traefik-ingress
namespace: kube-system
spec:
rules:
- host: traefik.<ENV-NAME>-user-<ENV-USER-ID>-01.<ENV-ANIMAL>.commandemy.training
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: traefik-dashboard
port:
number: 9000
entryPoints:
- web
routes:
- match: Host(`traefik.<ENV-NAME>-user-<ENV-USER-ID>-01.<ENV-ANIMAL>.commandemy.training`) && PathPrefix('/dashboard')
kind: Rule
services:
- name: traefik-dashboard
port: 9000

---
apiVersion: networking.k8s.io/v1
kind: Ingress
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: traefik-metrics
namespace: kube-system
Expand All @@ -29,4 +27,4 @@ spec:
match: Host(`traefik.<ENV-NAME>-user-<ENV-USER-ID>-01.<ENV-ANIMAL>.commandemy.training`) && PathPrefix(`/metrics`)
services:
- name: prometheus@internal
kind: TraefikService
kind: TraefikService
3 changes: 2 additions & 1 deletion examples/kubernetes/traefik/traefik-metrics-service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: v1
kind: Service
metadata:
Expand All @@ -13,5 +14,5 @@ spec:
port: 9100
protocol: TCP
selector:
app.kubernetes.io/instance: traefik
app.kubernetes.io/instance: traefik-kube-system
app.kubernetes.io/name: traefik
4 changes: 2 additions & 2 deletions examples/whoami/whoami.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
tls:
certResolver: myresolver
routes:
- match: Host(`whoami.<ENV-NAME>-user-<ENV-USER-ID>.<ENV-ANIMAL>.commandemy.training`) && PathPrefix(`/`)
- match: Host(`whoami.<ENV-NAME>-user-<ENV-USER-ID>-01.<ENV-ANIMAL>.commandemy.training`) && PathPrefix(`/`)
kind: Rule
services:
- name: whoami
Expand All @@ -65,7 +65,7 @@ spec:
entryPoints:
- web
routes:
- match: Host(`whoami.<ENV-NAME>-user-<ENV-USER-ID>.<ENV-ANIMAL>.commandemy.training`) && PathPrefix(`/`)
- match: Host(`whoami.<ENV-NAME>-user-<ENV-USER-ID>-01.<ENV-ANIMAL>.commandemy.training`) && PathPrefix(`/`)
kind: Rule
services:
- name: whoami
Expand Down
3 changes: 3 additions & 0 deletions replace-variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ find examples* -type f -exec sed -i -e "s/<ENV-ANIMAL>/$ANIMAL/g" {} \;

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

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

0 comments on commit 7b1b997

Please sign in to comment.