Skip to content

Commit 6f36ec8

Browse files
working
1 parent f43cf29 commit 6f36ec8

File tree

5 files changed

+54
-2
lines changed

5 files changed

+54
-2
lines changed

infra/k8s-cluster/deployK8sManifests.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ foreach ($manifestFile in $manifestFiles) {
5858
# replace #{host}# with the value of the environment variable HOST
5959
$manifestFileContent = $manifestFileContent -replace "#\{host\}#", $HOSTURL
6060
# create a new file with the same name but without the .template extension
61-
$newManifestFile = $manifestFile.FullName -replace ".template", ""
61+
$newEnvironmentSuffix = $environmentSuffix -replace "-", "."
62+
$newManifestFile = $manifestFile.FullName -replace ".template", $newEnvironmentSuffix
6263
Write-Output "Writing processed manifest file $newManifestFile"
6364
Set-Content -Path $newManifestFile -Value $manifestFileContent
6465
# apply the manifest file
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: pygoat-app
5+
labels:
6+
app: pygoat-app
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: pygoat-app
12+
template:
13+
metadata:
14+
labels:
15+
app: pygoat-app
16+
spec:
17+
containers:
18+
- image: devopsshield/devsecops-pygoat:latest
19+
name: pygoat-app
20+
ports:
21+
- containerPort: 8000
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: pygoat-ingress
5+
spec:
6+
ingressClassName: nginx
7+
rules:
8+
- host: pygoat-test.cad4devops.com
9+
http:
10+
paths:
11+
- backend:
12+
service:
13+
name: pygoat-svc
14+
port:
15+
number: 80
16+
path: /
17+
pathType: Prefix

infra/k8s-cluster/manifests/k8s-ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
spec:
66
ingressClassName: nginx
77
rules:
8-
- host: pygoat-test.cad4devops.com
8+
- host: pygoat.cad4devops.com
99
http:
1010
paths:
1111
- backend:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: pygoat-svc
5+
labels:
6+
app: pygoat-svc
7+
spec:
8+
type: LoadBalancer # ClusterIP
9+
selector:
10+
app: pygoat-app
11+
ports:
12+
- port: 80
13+
targetPort: 8000

0 commit comments

Comments
 (0)