forked from loklak/loklak_server
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related loklak#1224: Add YAMLs for master deployment
- Loading branch information
1 parent
ff2d1ed
commit 63d3dee
Showing
11 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Main deployment for API server | ||
apiVersion: apps/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: server | ||
namespace: web | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: server | ||
spec: | ||
nodeSelector: | ||
server: primary | ||
containers: | ||
- name: server | ||
image: loklak/loklak_server:latest-kubernetes-master | ||
ports: | ||
- containerPort: 80 | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: /api/status.json | ||
port: 80 | ||
initialDelaySeconds: 60 | ||
timeoutSeconds: 10 | ||
periodSeconds: 360 | ||
volumeMounts: | ||
- name: dump | ||
mountPath: /loklak_server/data | ||
volumes: | ||
- name: dump | ||
persistentVolumeClaim: | ||
claimName: dump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: dump | ||
namespace: web | ||
spec: | ||
capacity: | ||
storage: 100Gi | ||
accessModes: | ||
- ReadWriteOnce | ||
persistentVolumeReclaimPolicy: Retain | ||
storageClassName: slow | ||
gcePersistentDisk: | ||
pdName: "data-dump-disk" | ||
fsType: "ext4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: dump | ||
namespace: web | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 100Gi | ||
storageClassName: slow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Expose port 80 using load balancer | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: server | ||
namespace: web | ||
spec: | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 80 | ||
selector: | ||
app: server | ||
type: LoadBalancer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
kind: StorageClass | ||
apiVersion: storage.k8s.io/v1 | ||
metadata: | ||
name: slow | ||
namespace: web | ||
provisioner: kubernetes.io/gce-pd | ||
parameters: | ||
type: pd-standard | ||
zone: us-central1-a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: server | ||
namespace: web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: elasticsearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
apiVersion: apps/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: es | ||
namespace: elasticsearch | ||
labels: | ||
component: elasticsearch | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
component: elasticsearch | ||
spec: | ||
serviceAccount: elasticsearch | ||
containers: | ||
- name: es | ||
livenessProbe: | ||
httpGet: | ||
path: /_cluster/health | ||
port: 9200 | ||
initialDelaySeconds: 30 | ||
timeoutSeconds: 3 | ||
readinessProbe: | ||
httpGet: | ||
path: /_cluster/health | ||
port: 9200 | ||
initialDelaySeconds: 30 | ||
timeoutSeconds: 3 | ||
securityContext: | ||
capabilities: | ||
add: | ||
- IPC_LOCK | ||
image: quay.io/pires/docker-elasticsearch-kubernetes:2.0.0 | ||
env: | ||
- name: KUBERNETES_CA_CERTIFICATE_FILE | ||
value: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | ||
- name: NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: "CLUSTER_NAME" | ||
value: "loklakcluster" | ||
- name: "DISCOVERY_SERVICE" | ||
value: "elasticsearch" | ||
- name: NODE_MASTER | ||
value: "true" | ||
- name: NODE_DATA | ||
value: "true" | ||
- name: HTTP_ENABLE | ||
value: "true" | ||
ports: | ||
- containerPort: 9200 | ||
name: http | ||
protocol: TCP | ||
- containerPort: 9300 | ||
name: transport | ||
protocol: TCP | ||
volumeMounts: | ||
- mountPath: /data | ||
name: storage | ||
volumes: | ||
- name: storage | ||
gcePersistentDisk: | ||
pdName: data-index-disk | ||
fsType: ext4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: elasticsearch | ||
namespace: elasticsearch | ||
labels: | ||
component: elasticsearch | ||
spec: | ||
selector: | ||
component: elasticsearch | ||
ports: | ||
- name: http | ||
port: 9200 | ||
protocol: TCP | ||
- name: transport | ||
port: 9300 | ||
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: elasticsearch | ||
namespace: elasticsearch |