Compare commits
47 Commits
cacb1c0254
...
0.1.19
Author | SHA1 | Date | |
---|---|---|---|
ed468791b5
|
|||
1da911fc13
|
|||
3fd8dfd95d
|
|||
4c2ebc64c5
|
|||
b7de1c880e
|
|||
7b527a9242
|
|||
608156280d
|
|||
9f960857f8
|
|||
1ff835deb7
|
|||
6ad8cc9d6b
|
|||
07e18601f2
|
|||
040964998d
|
|||
f6b0061f10
|
|||
150c498bfc
|
|||
29061f2bb2
|
|||
e441e3c932
|
|||
a7c087b489
|
|||
fc99d07737
|
|||
29b04e3a54
|
|||
02e78b0ad5
|
|||
e307e6d3e3
|
|||
9d8f4924ac
|
|||
356887629b
|
|||
5f5236b72e
|
|||
9e98df75cb
|
|||
355292d9fc
|
|||
11c304fbf0
|
|||
d92f5c932c
|
|||
aa4b79ee9a
|
|||
1a03ca7dfe
|
|||
847dfa0436
|
|||
dbc422e723
|
|||
50b356cac0
|
|||
1eaeeaf615
|
|||
ac3a602e26
|
|||
5959eaf1ef
|
|||
4c3c8fc71f
|
|||
0ef81f03f0
|
|||
0bd99c3fcc
|
|||
ef4209b09f
|
|||
9b6dc3c486
|
|||
3463d69782
|
|||
93adbb5173
|
|||
bcb6681440
|
|||
5d232f934f
|
|||
c79df400cb
|
|||
9fba8fd2e2
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,4 +8,6 @@ test
|
|||||||
.vscode
|
.vscode
|
||||||
.dccache
|
.dccache
|
||||||
sink/.dccache
|
sink/.dccache
|
||||||
|
*~
|
||||||
|
.*~
|
||||||
|
|
||||||
|
30
.woodpecker.yml
Normal file
30
.woodpecker.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
steps:
|
||||||
|
build:
|
||||||
|
image: plugins/kaniko
|
||||||
|
settings:
|
||||||
|
repo:
|
||||||
|
from_secret: image_name
|
||||||
|
registry:
|
||||||
|
from_secret: container_registry
|
||||||
|
tags: latest,${CI_COMMIT_SHA},${CI_COMMIT_TAG}
|
||||||
|
username:
|
||||||
|
from_secret: container_registry_username
|
||||||
|
password:
|
||||||
|
from_secret: container_registry_password
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
when:
|
||||||
|
- event: [push, tag]
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
image: portainer/kubectl-shell:latest
|
||||||
|
secrets:
|
||||||
|
- source: kube_config
|
||||||
|
target: KUBE_CONFIG_CONTENT
|
||||||
|
- source: image_name
|
||||||
|
target: IMAGE_NAME
|
||||||
|
commands:
|
||||||
|
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
|
||||||
|
- export KUBECONFIG=/tmp/kubeconfig
|
||||||
|
- cat $CI_WORKSPACE/deployment/deploy-yml.tmpl | sed -e 's,%IMAGE%,'$IMAGE_NAME':'$CI_COMMIT_TAG',' | kubectl apply -f -
|
||||||
|
when:
|
||||||
|
- event: tag
|
50
deployment/deploy-yml.tmpl
Normal file
50
deployment/deploy-yml.tmpl
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: sinkserver
|
||||||
|
namespace: mainscnt
|
||||||
|
labels:
|
||||||
|
app: sinkserver
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: sinkserver
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: sinkserver
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: sinkserver
|
||||||
|
image: %IMAGE%
|
||||||
|
ports:
|
||||||
|
- containerPort: 20169
|
||||||
|
protocol: UDP
|
||||||
|
env:
|
||||||
|
- name: PGHOST
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: sinkserver-config
|
||||||
|
key: dbhost
|
||||||
|
- name: PGPASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: sinkserver-secret
|
||||||
|
key: dbpass
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: sinkserver
|
||||||
|
namespace: mainscnt
|
||||||
|
labels:
|
||||||
|
app: sinkserver
|
||||||
|
spec:
|
||||||
|
type: LoadBalancer
|
||||||
|
selector:
|
||||||
|
app: sinkserver
|
||||||
|
ports:
|
||||||
|
- protocol: UDP
|
||||||
|
port: 20169
|
||||||
|
targetPort: 20169
|
@ -1,141 +0,0 @@
|
|||||||
apiVersion: networking.k8s.io/v1
|
|
||||||
kind: NetworkPolicy
|
|
||||||
metadata:
|
|
||||||
namespace: mainscnt
|
|
||||||
name: deny-all-but-dns
|
|
||||||
spec:
|
|
||||||
podSelector:
|
|
||||||
matchLabels: {}
|
|
||||||
policyTypes:
|
|
||||||
- Egress
|
|
||||||
- Ingress
|
|
||||||
egress:
|
|
||||||
- to:
|
|
||||||
- namespaceSelector:
|
|
||||||
matchLabels:
|
|
||||||
kubernetes.io/metadata.name: kube-system
|
|
||||||
ports:
|
|
||||||
- protocol: UDP
|
|
||||||
port: 53
|
|
||||||
- protocol: TCP
|
|
||||||
port: 53
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: sinkserver
|
|
||||||
namespace: mainscnt
|
|
||||||
labels:
|
|
||||||
app: sinkserver
|
|
||||||
spec:
|
|
||||||
replicas: 3
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: sinkserver
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: sinkserver
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: sinkserver
|
|
||||||
image: wollud1969/sinkserver:e5f9d3e3
|
|
||||||
ports:
|
|
||||||
- containerPort: 20169
|
|
||||||
protocol: UDP
|
|
||||||
env:
|
|
||||||
- name: PGHOST
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: sinkserver-config
|
|
||||||
key: dbhost
|
|
||||||
- name: PGPASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: sinkserver-secret
|
|
||||||
key: dbpass
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: sinkserver
|
|
||||||
namespace: mainscnt
|
|
||||||
labels:
|
|
||||||
app: sinkserver
|
|
||||||
spec:
|
|
||||||
type: LoadBalancer
|
|
||||||
selector:
|
|
||||||
app: sinkserver
|
|
||||||
ports:
|
|
||||||
- protocol: UDP
|
|
||||||
port: 20169
|
|
||||||
targetPort: 20169
|
|
||||||
---
|
|
||||||
apiVersion: networking.k8s.io/v1
|
|
||||||
kind: NetworkPolicy
|
|
||||||
metadata:
|
|
||||||
name: allow-database-sinkserver
|
|
||||||
namespace: database
|
|
||||||
spec:
|
|
||||||
podSelector:
|
|
||||||
matchLabels:
|
|
||||||
app: timescaledb
|
|
||||||
policyTypes:
|
|
||||||
- Ingress
|
|
||||||
ingress:
|
|
||||||
- from:
|
|
||||||
- podSelector:
|
|
||||||
matchLabels:
|
|
||||||
app: sinkserver
|
|
||||||
- namespaceSelector:
|
|
||||||
matchLabels:
|
|
||||||
kubernetes.io/metadata.name: mainscnt
|
|
||||||
ports:
|
|
||||||
- protocol: TCP
|
|
||||||
port: 5432
|
|
||||||
---
|
|
||||||
apiVersion: networking.k8s.io/v1
|
|
||||||
kind: NetworkPolicy
|
|
||||||
metadata:
|
|
||||||
name: allow-sinkserver-database
|
|
||||||
namespace: mainscnt
|
|
||||||
spec:
|
|
||||||
podSelector:
|
|
||||||
matchLabels:
|
|
||||||
app: sinkserver
|
|
||||||
policyTypes:
|
|
||||||
- Egress
|
|
||||||
egress:
|
|
||||||
- to:
|
|
||||||
- podSelector:
|
|
||||||
matchLabels:
|
|
||||||
app: timescaledb
|
|
||||||
- namespaceSelector:
|
|
||||||
matchLabels:
|
|
||||||
kubernetes.io/metadata.name: database
|
|
||||||
ports:
|
|
||||||
- protocol: TCP
|
|
||||||
port: 5432
|
|
||||||
---
|
|
||||||
apiVersion: networking.k8s.io/v1
|
|
||||||
kind: NetworkPolicy
|
|
||||||
metadata:
|
|
||||||
name: allow-sinkserver-ingress
|
|
||||||
namespace: mainscnt
|
|
||||||
spec:
|
|
||||||
podSelector:
|
|
||||||
matchLabels:
|
|
||||||
app: sinkserver
|
|
||||||
policyTypes:
|
|
||||||
- Ingress
|
|
||||||
ingress:
|
|
||||||
- from:
|
|
||||||
- ipBlock:
|
|
||||||
cidr: 0.0.0.0/0
|
|
||||||
ports:
|
|
||||||
- protocol: UDP
|
|
||||||
port: 20169
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: mainscnt
|
|
@ -33,3 +33,4 @@ The projects of the three current variants are at [RPi](https://home.hottis.de/g
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ void usage() {
|
|||||||
printf("https://home.hottis.de/gitlab/wolutator/mains-frequency-counter-rpi,\n");
|
printf("https://home.hottis.de/gitlab/wolutator/mains-frequency-counter-rpi,\n");
|
||||||
printf("https://github.com/wollud1969/sinkConvert1\n");
|
printf("https://github.com/wollud1969/sinkConvert1\n");
|
||||||
printf("Repo: https://home.hottis.de/gitlab/wolutator/sinkserver\n");
|
printf("Repo: https://home.hottis.de/gitlab/wolutator/sinkserver\n");
|
||||||
printf("Version: " VERSION "\n");
|
printf("Version: " VERSION " XXX\n");
|
||||||
printf("\nUsage\n");
|
printf("\nUsage\n");
|
||||||
printf(" -f FILENAME ...... Config file to be used\n");
|
printf(" -f FILENAME ...... Config file to be used\n");
|
||||||
printf(" -v ............... Verbose, writes all logging on stdout too\n");
|
printf(" -v ............... Verbose, writes all logging on stdout too\n");
|
||||||
|
Reference in New Issue
Block a user