initial installation of traccar
This commit is contained in:
parent
c40a25b703
commit
b769124701
|
@ -0,0 +1,24 @@
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: traccar
|
||||||
|
namespace: argocd
|
||||||
|
finalizers:
|
||||||
|
- resources-finalizer.argocd.argoproj.io
|
||||||
|
spec:
|
||||||
|
destination:
|
||||||
|
namespace: traccar
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
project: apps
|
||||||
|
source:
|
||||||
|
path: traccar
|
||||||
|
repoURL: https://git.tbrnt.ch/tobru/gitops-tbrnt.git
|
||||||
|
targetRevision: HEAD
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: traccar
|
|
@ -0,0 +1,46 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: traccar
|
||||||
|
name: traccar
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: traccar
|
||||||
|
strategy: {}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: traccar
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: docker.io/traccar/traccar:4.12-alpine
|
||||||
|
name: traccar
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- containerPort: 8082
|
||||||
|
protocol: TCP
|
||||||
|
name: http
|
||||||
|
- containerPort: 5027
|
||||||
|
protocol: TCP
|
||||||
|
name: teltonika
|
||||||
|
- containerPort: 5055
|
||||||
|
protocol: TCP
|
||||||
|
name: traccar
|
||||||
|
- containerPort: 5144
|
||||||
|
protocol: TCP
|
||||||
|
name: owntracks
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /opt/traccar/conf/traccar.xml
|
||||||
|
subPath: traccar.xml
|
||||||
|
- name: logs
|
||||||
|
mountPath: /opt/traccar/logs
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: traccar-config
|
||||||
|
- name: logs
|
||||||
|
emptyDir: {}
|
|
@ -0,0 +1,63 @@
|
||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: traccar
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||||
|
ingress.kubernetes.io/ssl-redirect: "true"
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: traccar.tbrnt.ch
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: traccar
|
||||||
|
port:
|
||||||
|
number: 8082
|
||||||
|
- host: osmand.traccar.tbrnt.ch
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: traccar
|
||||||
|
port:
|
||||||
|
number: 5055
|
||||||
|
- host: teltonika.traccar.tbrnt.ch
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: traccar
|
||||||
|
port:
|
||||||
|
number: 5027
|
||||||
|
- host: owntracks.traccar.tbrnt.ch
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: traccar
|
||||||
|
port:
|
||||||
|
number: 5144
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- traccar.tbrnt.ch
|
||||||
|
secretName: traccar-tbrnt-ch
|
||||||
|
- hosts:
|
||||||
|
- osmand.traccar.tbrnt.ch
|
||||||
|
secretName: osmand-traccar-tbrnt-ch
|
||||||
|
- hosts:
|
||||||
|
- teltonika.traccar.tbrnt.ch
|
||||||
|
secretName: teltonika-traccar-tbrnt-ch
|
||||||
|
- hosts:
|
||||||
|
- owntracks.traccar.tbrnt.ch
|
||||||
|
secretName: owntracks-traccar-tbrnt-ch
|
|
@ -0,0 +1,56 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: mariadb
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mariadb
|
||||||
|
serviceName: mariadb
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mariadb
|
||||||
|
spec:
|
||||||
|
terminationGracePeriodSeconds: 10
|
||||||
|
containers:
|
||||||
|
- name: mariadb
|
||||||
|
image: docker.io/mariadb:10.5
|
||||||
|
env:
|
||||||
|
- name: MYSQL_ROOT_PASSWORD
|
||||||
|
value: xJ2YdqrbPXla
|
||||||
|
- name: MYSQL_DATABASE
|
||||||
|
value: traccar
|
||||||
|
- name: MYSQL_USER
|
||||||
|
value: traccar
|
||||||
|
- name: MYSQL_PASSWORD
|
||||||
|
value: J0ICsL5JTPLt
|
||||||
|
ports:
|
||||||
|
- containerPort: 3306
|
||||||
|
name: mariadb
|
||||||
|
volumeMounts:
|
||||||
|
- name: mariadb
|
||||||
|
mountPath: /var/lib/mysql
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: mariadb
|
||||||
|
spec:
|
||||||
|
accessModes: [ "ReadWriteOnce" ]
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 5Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mariadb
|
||||||
|
labels:
|
||||||
|
app: mariadb
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 3306
|
||||||
|
name: mariadb
|
||||||
|
clusterIP: None
|
||||||
|
selector:
|
||||||
|
app: mariadb
|
|
@ -0,0 +1,27 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: traccar
|
||||||
|
name: traccar
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: teltonika
|
||||||
|
port: 5027
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 5027
|
||||||
|
- name: traccar
|
||||||
|
port: 5055
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 5055
|
||||||
|
- name: owntracks
|
||||||
|
port: 5144
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 5144
|
||||||
|
- name: http
|
||||||
|
port: 8082
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 8082
|
||||||
|
selector:
|
||||||
|
app: traccar
|
||||||
|
type: ClusterIP
|
|
@ -0,0 +1,20 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: traccar-config
|
||||||
|
data:
|
||||||
|
traccar.xml: |
|
||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
|
||||||
|
<properties>
|
||||||
|
<entry key='config.default'>./conf/default.xml</entry>
|
||||||
|
<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
|
||||||
|
<entry key='database.url'>jdbc:mysql://mariadb:3306/traccar?serverTimezone=UTC&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
|
||||||
|
<entry key='database.user'>traccar</entry>
|
||||||
|
<entry key='database.password'>J0ICsL5JTPLt</entry>
|
||||||
|
<entry key='server.statistics'>http://localhost</entry>
|
||||||
|
<entry key='geocoder.enable'>true</entry>
|
||||||
|
<entry key='geocoder.type'>nominatim</entry>
|
||||||
|
<entry key='geocoder.url'>https://nominatim.openstreetmap.org/reverse</entry>
|
||||||
|
</properties>
|
||||||
|
|
Reference in New Issue