Kubernetes integration
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: api
|
||||
namespace: stadtmg
|
||||
labels:
|
||||
io.kompose.service: detection_api
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
io.kompose.service: detection_api
|
||||
replicas: 1
|
||||
strategy: {}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: detection_api
|
||||
spec:
|
||||
containers:
|
||||
- name: api
|
||||
image: masasana.azurecr.io/stadt_mg_detection_api
|
||||
resources: {}
|
||||
restartPolicy: Always
|
||||
imagePullSecrets:
|
||||
- name: acr-secret
|
||||
@@ -0,0 +1,25 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-staging"
|
||||
name: api
|
||||
namespace: stadtmg
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- drohne.masasana.ai
|
||||
secretName: stadtmg-drohne-key
|
||||
rules:
|
||||
- host: drohne.masasana.ai
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: api-service
|
||||
port:
|
||||
number: 80
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: api-service
|
||||
namespace: stadtmg
|
||||
labels:
|
||||
io.kompose.service: detection_api
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
io.kompose.service: detection_api
|
||||
ports:
|
||||
- protocol: TCP
|
||||
name: http
|
||||
port: 80
|
||||
targetPort: 8080
|
||||
@@ -0,0 +1,23 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: bodenerkennung
|
||||
name: bodenerkennung
|
||||
namespace: stadtmg
|
||||
spec:
|
||||
ttlSecondsAfterFinished: 100
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: bodenerkennung
|
||||
image: masasana.azurecr.io/stadt_mg_bodenerkennung:1.1.1
|
||||
imagePullPolicy: Always
|
||||
command:
|
||||
- python
|
||||
- predict.py
|
||||
args:
|
||||
- --output_dir=mongo://mongo
|
||||
imagePullSecrets:
|
||||
- name: acr-secret
|
||||
restartPolicy: Never
|
||||
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mongo-pv-claim
|
||||
namespace: stadtmg
|
||||
labels:
|
||||
app: mongo
|
||||
spec:
|
||||
storageClassName: microk8s-hostpath
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
@@ -0,0 +1,31 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: mongo
|
||||
name: mongo
|
||||
namespace: stadtmg
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
io.kompose.service: mongo
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: mongo
|
||||
spec:
|
||||
containers:
|
||||
- image: mongo:5.0.3
|
||||
name: mongo
|
||||
resources: {}
|
||||
volumeMounts:
|
||||
- mountPath: /data/db
|
||||
name: mongo-data
|
||||
restartPolicy: Always
|
||||
volumes:
|
||||
- name: mongo-data
|
||||
persistentVolumeClaim:
|
||||
claimName: mongo-pv-claim
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mongo
|
||||
namespace: stadtmg
|
||||
labels:
|
||||
io.kompose.service: mongo
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
io.kompose.service: mongo
|
||||
ports:
|
||||
- protocol: TCP
|
||||
name: http
|
||||
port: 27017
|
||||
targetPort: 27017
|
||||
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: stadtmg
|
||||
namespace: stadtmg
|
||||
labels:
|
||||
app.kubernetes.io/name: stadtmg
|
||||
app.kubernetes.io/instance: stadtmg
|
||||
annotations:
|
||||
linkerd.io/inject: enabled
|
||||
@@ -0,0 +1,31 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: bodenerkennung
|
||||
name: bodenerkennung
|
||||
namespace: stadtmg
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
io.kompose.service: bodenerkennung
|
||||
strategy: { }
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
io.kompose.service: bodenerkennung
|
||||
spec:
|
||||
containers:
|
||||
- image: masasana.azurecr.io/stadt_mg_bodenerkennung:1.1.1
|
||||
name: bodenerkennung
|
||||
resources: { }
|
||||
args: [ "--output_dir mongo://mongo" , "--image_id testimage" , "--category_json m" ]
|
||||
env:
|
||||
- name: POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
imagePullSecrets:
|
||||
- name: acr-secret
|
||||
restartPolicy: Always
|
||||
@@ -0,0 +1,13 @@
|
||||
kind: RoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: job-creator
|
||||
namespace: stadtmg
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: stadtmg
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: job-creator
|
||||
@@ -0,0 +1,15 @@
|
||||
kind: Role
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: job-creator
|
||||
rules:
|
||||
- apiGroups:
|
||||
- "batch"
|
||||
resources:
|
||||
- jobs
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- create
|
||||
- delete
|
||||
Reference in New Issue
Block a user