Files
cicdTest/deploy.yaml

159 lines
2.9 KiB
YAML

---
apiVersion: v1
kind: Namespace
metadata:
name: consul-project-1
annotations:
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-a
namespace: consul-project-1
spec:
replicas: 1
selector:
matchLabels:
server: "http"
app: "project-1"
expose: "true"
template:
metadata:
labels:
server: "http"
app: "project-1"
expose: "true"
spec:
containers:
- name: front-end
image: beppev/server-a:master
imagePullPolicy: "Always"
ports:
- containerPort: 5000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-b
namespace: consul-project-1
spec:
replicas: 1
selector:
matchLabels:
server: "http"
app: "project-1"
version: v1
backend: "true"
template:
metadata:
labels:
server: "http"
app: "project-1"
version: v1
backend: "true"
spec:
containers:
- name: front-end
image: beppev/server-b:master
imagePullPolicy: "Always"
ports:
- containerPort: 6000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-b-test
namespace: consul-project-1
spec:
replicas: 1
selector:
matchLabels:
server: "http"
app: "project-1"
version: v2
backend: "true"
template:
metadata:
labels:
server: "http"
app: "project-1"
version: v2
backend: "true"
spec:
containers:
- name: front-end
image: beppev/server-b:experimental
imagePullPolicy: "Always"
ports:
- containerPort: 6000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-d
namespace: consul-project-1
spec:
replicas: 1
selector:
matchLabels:
app: "project-1"
mirror: "true"
server: "http"
template:
metadata:
labels:
app: "project-1"
mirror: "true"
server: "http"
spec:
containers:
- name: front-end
image: beppev/server-d:master
ports:
- containerPort: 6000
---
apiVersion: v1
kind: Service
metadata:
name: expose-service
namespace: consul-project-1
labels:
app: "project-1"
spec:
selector:
expose: "true"
ports:
- name: http
protocol: TCP
port: 5000
---
apiVersion: v1
kind: Service
metadata:
name: backend-service
namespace: consul-project-1
labels:
app: "project-1"
spec:
selector:
backend: "true"
ports:
- name: http
protocol: TCP
port: 6000
---
apiVersion: v1
kind: Service
metadata:
name: mirror-service
namespace: consul-project-1
labels:
app: "project-1"
spec:
selector:
mirror: "true"
ports:
- name: http
protocol: TCP
port: 6000