deployment working so far
This commit is contained in:
parent
e5f9d3e3c8
commit
4119765a87
@ -32,7 +32,7 @@ RUN \
|
|||||||
EXPOSE 20169/udp
|
EXPOSE 20169/udp
|
||||||
USER nobody
|
USER nobody
|
||||||
|
|
||||||
CMD [ "/usr/local/bin/sink20169", "-v" ]
|
CMD [ "/usr/local/bin/sink20169", "-v", "-d" ]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,12 +1,34 @@
|
|||||||
|
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
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: sinkserver
|
name: sinkserver
|
||||||
|
namespace: mainscnt
|
||||||
labels:
|
labels:
|
||||||
app: sinkserver
|
app: sinkserver
|
||||||
spec:
|
spec:
|
||||||
replicas: 3
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: sinkserver
|
app: sinkserver
|
||||||
@ -15,11 +37,9 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: sinkserver
|
app: sinkserver
|
||||||
spec:
|
spec:
|
||||||
imagePullSecrets:
|
|
||||||
- name: hottis-registry-creds
|
|
||||||
containers:
|
containers:
|
||||||
- name: sinkserver
|
- name: sinkserver
|
||||||
image: registry.hottis.de/mainscnt/sinkserver:314b9a42
|
image: wollud1969/sinkserver:e5f9d3e3
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 20169
|
- containerPort: 20169
|
||||||
protocol: UDP
|
protocol: UDP
|
||||||
@ -39,6 +59,7 @@ apiVersion: v1
|
|||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: sinkserver
|
name: sinkserver
|
||||||
|
namespace: mainscnt
|
||||||
labels:
|
labels:
|
||||||
app: sinkserver
|
app: sinkserver
|
||||||
spec:
|
spec:
|
||||||
@ -49,6 +70,72 @@ spec:
|
|||||||
- protocol: UDP
|
- protocol: UDP
|
||||||
port: 20169
|
port: 20169
|
||||||
targetPort: 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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
4
deployment/namespace.yml
Normal file
4
deployment/namespace.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: mainscnt
|
30
schema/create.sql
Normal file
30
schema/create.sql
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
create sequence device_s;
|
||||||
|
|
||||||
|
CREATE TABLE device_t (
|
||||||
|
id integer DEFAULT nextval('device_s') NOT NULL,
|
||||||
|
deviceid character varying(64) NOT NULL,
|
||||||
|
sharedsecret character varying(31) NOT NULL,
|
||||||
|
location character varying(128) NOT NULL,
|
||||||
|
active boolean DEFAULT false NOT NULL,
|
||||||
|
contact character varying(128),
|
||||||
|
flaky boolean DEFAULT false NOT NULL,
|
||||||
|
CONSTRAINT device_t_sharedsecret_check CHECK ((char_length((sharedsecret)::text) = 31))
|
||||||
|
);
|
||||||
|
|
||||||
|
ALTER TABLE ONLY device_t
|
||||||
|
ADD CONSTRAINT device_t_deviceid_key UNIQUE (deviceid);
|
||||||
|
|
||||||
|
ALTER TABLE ONLY device_t
|
||||||
|
ADD CONSTRAINT device_t_pkey PRIMARY KEY (id);
|
||||||
|
|
||||||
|
CREATE TABLE mainsfrequency (
|
||||||
|
"time" timestamp without time zone NOT NULL,
|
||||||
|
host text,
|
||||||
|
location text,
|
||||||
|
freq double precision,
|
||||||
|
valid smallint DEFAULT 1 NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
select create_hypertable('mainsfrequency', 'time');
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user