Files
cicdTest/deploy.yaml

207 lines
4.4 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: v1
kind: ServiceAccount
metadata:
name: account-a
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: account-b
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: account-b-test
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-a
# namespace: consul-project-1
annotations:
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
spec:
replicas: 1
selector:
matchLabels:
server: "http"
app: "project-1"
expose: "true"
template:
metadata:
labels:
server: "http"
app: "project-1"
expose: "true"
annotations:
"consul.hashicorp.com/connect-inject": "true"
spec:
containers:
- name: server-a
image: beppev/server-a:master-consul
imagePullPolicy: "Always"
ports:
- containerPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-b
# namespace: consul-project-1
annotations:
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
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"
annotations:
"consul.hashicorp.com/connect-inject": "true"
spec:
containers:
- name: server-b
image: beppev/server-b:master-consul
imagePullPolicy: "Always"
ports:
- containerPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-b-test
# namespace: consul-project-1
annotations:
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
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"
annotations:
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
spec:
containers:
- name: server-b-test
image: beppev/server-b:experimental-consul
imagePullPolicy: "Always"
ports:
- containerPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-d
# namespace: consul-project-1
annotations:
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
spec:
replicas: 1
selector:
matchLabels:
app: "project-1"
mirror: "true"
server: "http"
template:
metadata:
labels:
app: "project-1"
mirror: "true"
server: "http"
annotations:
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
spec:
containers:
- name: server-d
image: beppev/server-d-consul:master
ports:
- containerPort: 80
# ---
apiVersion: v1
kind: Service
metadata:
name: expose-service
# namespace: consul-project-1
annotations:
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
labels:
app: "project-1"
spec:
selector:
expose: "true"
ports:
- name: http
protocol: TCP
port: 80
targetPort: 80
nodePort: 30036
type: NodePort
# ---
# apiVersion: v1
# kind: Service
# metadata:
# name: server-check
# # namespace: consul-project-1
# annotations:
# "consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
# 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
# annotations:
# "consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
# labels:
# app: "project-1"
# spec:
# selector:
# mirror: "true"
# ports:
# - name: http
# protocol: TCP
# port: 6000
---
# kind: service-splitter
# name: server-check
# splits:
# - weight: 90
# service_subset: "v1"
# - weight: 10
# service_subset: "v2"