diff --git a/yaml/k8s-lighthouse-service.yaml b/yaml/k8s-lighthouse-service.yaml new file mode 100644 index 0000000..c2ae07f --- /dev/null +++ b/yaml/k8s-lighthouse-service.yaml @@ -0,0 +1,50 @@ +apiVersion: v1 +kind: Service +metadata: + name: lighthouse + labels: + app: lighthouse +spec: + clusterIP: None + ports: + - port: 4053 + selector: + app: lighthouse +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: lighthouse + labels: + app: lighthouse +spec: + serviceName: lighthouse + replicas: 3 + selector: + matchLabels: + app: lighthouse + template: + metadata: + labels: + app: lighthouse + spec: + terminationGracePeriodSeconds: 35 + containers: + - name: lighthouse + image: webcrawler.lighthouse:0.2.0 + env: + - name: ACTORSYSTEM + value: webcrawler + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: CLUSTER_SEEDS + value: akka.tcp://webcrawler@lighthouse-0.lighthouse:4053,akka.tcp://webcrawler@lighthouse-1.lighthouse:4053,akka.tcp://webcrawler@lighthouse-2.lighthouse:4053 + command: [ "/bin/sh", "-c", "CLUSTER_IP=${POD_NAME}.lighthouse dotnet Lighthouse.dll"] + livenessProbe: + tcpSocket: + port: 4053 + ports: + - containerPort: 4053 + protocol: TCP \ No newline at end of file