mirror of
https://github.com/bvanroll/cicdTest.git
synced 2025-08-29 20:12:43 +00:00
tis af fam, dees was wel de minst plezante om te doen
This commit is contained in:
13
check-dns.yaml
Normal file
13
check-dns.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: dns
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: dns
|
||||||
|
image: anubhavmishra/tiny-tools
|
||||||
|
command: ["dig", "consul.service.consul"]
|
||||||
|
restartPolicy: Never
|
||||||
|
backoffLimit: 4
|
10
consul-dns-fix.yaml
Normal file
10
consul-dns-fix.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
addonmanager.kubernetes.io/mode: EnsureExists
|
||||||
|
name: kube-dns
|
||||||
|
namespace: kube-system
|
||||||
|
data:
|
||||||
|
stubDomains: |
|
||||||
|
{"consul": ["10.103.17.72"]}
|
3
consul/server-b-default
Normal file
3
consul/server-b-default
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Kind = "service-defaults"
|
||||||
|
Name = "server-b"
|
||||||
|
Protocol = "http"
|
3
consul/server-b-test-deault
Normal file
3
consul/server-b-test-deault
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Kind = "service-defaults"
|
||||||
|
Name = "server-b-test"
|
||||||
|
Protocol = "http"
|
3
consul/server-check-default.hcl
Normal file
3
consul/server-check-default.hcl
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Kind = "service-defaults"
|
||||||
|
Name = "server-check"
|
||||||
|
Protocol = "http"
|
@@ -2,5 +2,6 @@
|
|||||||
{
|
{
|
||||||
"service": {
|
"service": {
|
||||||
"name": "server-check"
|
"name": "server-check"
|
||||||
|
"protocol": "http"
|
||||||
}
|
}
|
||||||
}
|
}
|
75
deploy.yaml
75
deploy.yaml
@@ -6,6 +6,21 @@
|
|||||||
# annotations:
|
# annotations:
|
||||||
# "consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
|
# "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
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -30,11 +45,11 @@ spec:
|
|||||||
"consul.hashicorp.com/connect-inject": "true"
|
"consul.hashicorp.com/connect-inject": "true"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: front-end
|
- name: server-a
|
||||||
image: beppev/server-a-consul:master
|
image: beppev/server-a:master-consul
|
||||||
imagePullPolicy: "Always"
|
imagePullPolicy: "Always"
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 5000
|
- containerPort: 80
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@@ -62,11 +77,11 @@ spec:
|
|||||||
"consul.hashicorp.com/connect-inject": "true"
|
"consul.hashicorp.com/connect-inject": "true"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: front-end
|
- name: server-b
|
||||||
image: beppev/server-b-consul:master
|
image: beppev/server-b:master-consul
|
||||||
imagePullPolicy: "Always"
|
imagePullPolicy: "Always"
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 6000
|
- containerPort: 80
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@@ -94,11 +109,11 @@ spec:
|
|||||||
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
|
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: front-end
|
- name: server-b-test
|
||||||
image: beppev/server-b-consul:experimental
|
image: beppev/server-b:experimental-consul
|
||||||
imagePullPolicy: "Always"
|
imagePullPolicy: "Always"
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 6000
|
- containerPort: 80
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@@ -124,30 +139,30 @@ spec:
|
|||||||
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
|
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: front-end
|
- name: server-d
|
||||||
image: beppev/server-d-consul:master
|
image: beppev/server-d-consul:master
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 6000
|
- containerPort: 80
|
||||||
# ---
|
# ---
|
||||||
# apiVersion: v1
|
apiVersion: v1
|
||||||
# kind: Service
|
kind: Service
|
||||||
# metadata:
|
metadata:
|
||||||
# name: expose-service
|
name: expose-service
|
||||||
# # namespace: consul-project-1
|
# namespace: consul-project-1
|
||||||
# annotations:
|
annotations:
|
||||||
# "consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
|
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
|
||||||
# labels:
|
labels:
|
||||||
# app: "project-1"
|
app: "project-1"
|
||||||
# spec:
|
spec:
|
||||||
# selector:
|
selector:
|
||||||
# expose: "true"
|
expose: "true"
|
||||||
# ports:
|
ports:
|
||||||
# - name: http
|
- name: http
|
||||||
# protocol: TCP
|
protocol: TCP
|
||||||
# port: 5000
|
port: 80
|
||||||
# targetPort: 5000
|
targetPort: 80
|
||||||
# nodePort: 30036
|
nodePort: 30036
|
||||||
# type: NodePort
|
type: NodePort
|
||||||
# ---
|
# ---
|
||||||
# apiVersion: v1
|
# apiVersion: v1
|
||||||
# kind: Service
|
# kind: Service
|
||||||
|
@@ -18,8 +18,6 @@ client:
|
|||||||
|
|
||||||
# Use only one Consul server for local development
|
# Use only one Consul server for local development
|
||||||
server:
|
server:
|
||||||
service:
|
|
||||||
type: 'NodePort'
|
|
||||||
replicas: 1
|
replicas: 1
|
||||||
bootstrapExpect: 1
|
bootstrapExpect: 1
|
||||||
disruptionBudget:
|
disruptionBudget:
|
||||||
|
@@ -3,7 +3,7 @@ import requests
|
|||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
URL = "http://server-check:6000"
|
URL = "http://server-check.service.consul"
|
||||||
|
|
||||||
@app.errorhandler(404)
|
@app.errorhandler(404)
|
||||||
def page_not_found(error):
|
def page_not_found(error):
|
||||||
@@ -35,4 +35,4 @@ def findServer(name, port):
|
|||||||
return requests.get("http://"+name+":"+port)
|
return requests.get("http://"+name+":"+port)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True, host="0.0.0.0", port=5000)
|
app.run(debug=True, host="0.0.0.0", port=80)
|
||||||
|
@@ -4,7 +4,7 @@ copy . /app
|
|||||||
workdir /app
|
workdir /app
|
||||||
|
|
||||||
run pip install -r requirements.txt
|
run pip install -r requirements.txt
|
||||||
expose 5000
|
expose 80
|
||||||
entrypoint [ "python" ]
|
entrypoint [ "python" ]
|
||||||
|
|
||||||
cmd [ "app.py" ]
|
cmd [ "app.py" ]
|
@@ -6,12 +6,19 @@ app = Flask(__name__)
|
|||||||
@app.route('/')
|
@app.route('/')
|
||||||
def doRequest():
|
def doRequest():
|
||||||
data = {
|
data = {
|
||||||
"serverName": "serverB",
|
"serverName": "server-b",
|
||||||
"version": "master",
|
"version": "master",
|
||||||
"success": "true"
|
"success": "true"
|
||||||
}
|
}
|
||||||
return jsonify(data)
|
return jsonify(data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/', defaults={'path': ''})
|
||||||
|
@app.route('/<path:path>')
|
||||||
|
def doRequest(path):
|
||||||
|
return path + "\nserver-b"
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True, host="0.0.0.0", port=6000)
|
app.run(debug=True, host="0.0.0.0", port=80)
|
||||||
|
@@ -4,7 +4,7 @@ copy . /app
|
|||||||
workdir /app
|
workdir /app
|
||||||
|
|
||||||
run pip install -r requirements.txt
|
run pip install -r requirements.txt
|
||||||
expose 6000
|
expose 80
|
||||||
entrypoint [ "python" ]
|
entrypoint [ "python" ]
|
||||||
|
|
||||||
cmd [ "app.py" ]
|
cmd [ "app.py" ]
|
@@ -6,11 +6,19 @@ app = Flask(__name__)
|
|||||||
@app.route('/')
|
@app.route('/')
|
||||||
def doRequest():
|
def doRequest():
|
||||||
data = {
|
data = {
|
||||||
"serverName": "serverC",
|
"serverName": "server-c",
|
||||||
|
"version": "master",
|
||||||
"success": "true"
|
"success": "true"
|
||||||
}
|
}
|
||||||
return jsonify(data)
|
return jsonify(data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/', defaults={'path': ''})
|
||||||
|
@app.route('/<path:path>')
|
||||||
|
def doRequest(path):
|
||||||
|
return path + "\nserver-c"
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True, host="0.0.0.0", port=6000)
|
app.run(debug=True, host="0.0.0.0", port=80)
|
||||||
|
@@ -4,7 +4,7 @@ copy . /app
|
|||||||
workdir /app
|
workdir /app
|
||||||
|
|
||||||
run pip install -r requirements.txt
|
run pip install -r requirements.txt
|
||||||
expose 6000
|
expose 80
|
||||||
entrypoint [ "python" ]
|
entrypoint [ "python" ]
|
||||||
|
|
||||||
cmd [ "app.py" ]
|
cmd [ "app.py" ]
|
@@ -21,4 +21,4 @@ def get():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True, host="0.0.0.0", port=6000)
|
app.run(debug=True, host="0.0.0.0", port=80)
|
||||||
|
@@ -4,7 +4,7 @@ copy . /app
|
|||||||
workdir /app
|
workdir /app
|
||||||
|
|
||||||
run pip install -r requirements.txt
|
run pip install -r requirements.txt
|
||||||
expose 7000
|
expose 80
|
||||||
entrypoint [ "python" ]
|
entrypoint [ "python" ]
|
||||||
|
|
||||||
cmd [ "app.py" ]
|
cmd [ "app.py" ]
|
Reference in New Issue
Block a user