Created
October 30, 2020 11:27
-
-
Save tvvignesh/d7114658800add046460b38c74ae2f5f to your computer and use it in GitHub Desktop.
Dgraph-Kind restart repro
This file contains hidden or 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
| --- | |
| # Source: dgraph/templates/alpha/configs.yaml | |
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: dgraph-dgraph-alpha-config | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: alpha | |
| release: dgraph | |
| heritage: Helm | |
| data: | |
| config.toml: | | |
| whitelist = '10.0.0.0/8,172.0.0.0/8,192.168.0.0/16' | |
| lru_mb = 2048 | |
| config.yaml: | | |
| lru_mb: 2048 | |
| --- | |
| # Source: dgraph/templates/zero/configs.yaml | |
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: dgraph-dgraph-zero-config | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: zero | |
| release: dgraph | |
| heritage: Helm | |
| data: | |
| config.toml: | | |
| whitelist = '10.0.0.0/8,172.0.0.0/8,192.168.0.0/16' | |
| lru_mb = 2048 | |
| --- | |
| # Source: dgraph/templates/alpha/svc-headless.yaml | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: dgraph-dgraph-alpha-headless | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: alpha | |
| release: dgraph | |
| heritage: Helm | |
| spec: | |
| type: ClusterIP | |
| clusterIP: None | |
| ports: | |
| - name: grpc-alpha-int | |
| port: 7080 | |
| targetPort: 7080 | |
| selector: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: alpha | |
| release: dgraph | |
| --- | |
| # Source: dgraph/templates/alpha/svc.yaml | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: dgraph-dgraph-alpha | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: alpha | |
| release: dgraph | |
| heritage: Helm | |
| monitor: alpha-dgraph-io | |
| spec: | |
| type: ClusterIP | |
| ports: | |
| - port: 8080 | |
| targetPort: 8080 | |
| name: http-alpha | |
| - port: 9080 | |
| name: grpc-alpha | |
| publishNotReadyAddresses: true | |
| selector: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: alpha | |
| release: dgraph | |
| --- | |
| # Source: dgraph/templates/ratel/svc.yaml | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: dgraph-dgraph-ratel | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: ratel | |
| release: dgraph | |
| heritage: Helm | |
| spec: | |
| type: ClusterIP | |
| ports: | |
| - port: 80 | |
| targetPort: 8000 | |
| name: http-ratel | |
| selector: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: ratel | |
| release: dgraph | |
| --- | |
| # Source: dgraph/templates/zero/svc-headless.yaml | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: dgraph-dgraph-zero-headless | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: zero | |
| release: dgraph | |
| heritage: Helm | |
| spec: | |
| type: ClusterIP | |
| clusterIP: None | |
| ports: | |
| - name: grpc-zero | |
| port: 5080 | |
| targetPort: 5080 | |
| selector: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| release: dgraph | |
| component: zero | |
| --- | |
| # Source: dgraph/templates/zero/svc.yaml | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: dgraph-dgraph-zero | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: zero | |
| release: dgraph | |
| heritage: Helm | |
| monitor: zero-dgraph-io | |
| spec: | |
| type: ClusterIP | |
| ports: | |
| - port: 5080 | |
| targetPort: 5080 | |
| name: grpc-zero | |
| - port: 6080 | |
| targetPort: 6080 | |
| name: http-zero | |
| publishNotReadyAddresses: true | |
| selector: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| release: dgraph | |
| component: zero | |
| --- | |
| # Source: dgraph/templates/ratel/deployment.yaml | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: dgraph-dgraph-ratel | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: ratel | |
| release: dgraph | |
| heritage: Helm | |
| spec: | |
| selector: | |
| matchLabels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: ratel | |
| release: dgraph | |
| replicas: 1 | |
| template: | |
| metadata: | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: ratel | |
| release: dgraph | |
| spec: | |
| securityContext: | |
| fsGroup: 1001 | |
| runAsUser: 1001 | |
| containers: | |
| - name: "dgraph-dgraph-ratel" | |
| image: "docker.io/dgraph/dgraph:v20.07.1" | |
| imagePullPolicy: "IfNotPresent" | |
| command: | |
| - dgraph-ratel | |
| ports: | |
| - name: http-ratel | |
| containerPort: 8000 | |
| resources: | |
| null | |
| --- | |
| # Source: dgraph/templates/alpha/statefulset.yaml | |
| apiVersion: apps/v1 | |
| kind: StatefulSet | |
| metadata: | |
| name: dgraph-dgraph-alpha | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: alpha | |
| release: dgraph | |
| heritage: Helm | |
| spec: | |
| serviceName: dgraph-dgraph-alpha-headless | |
| replicas: 1 | |
| podManagementPolicy: "OrderedReady" | |
| updateStrategy: | |
| type: "RollingUpdate" | |
| selector: | |
| matchLabels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| release: dgraph | |
| component: alpha | |
| template: | |
| metadata: | |
| name: dgraph-dgraph-alpha | |
| annotations: | |
| prometheus.io/path: /debug/prometheus_metrics | |
| prometheus.io/port: "8080" | |
| prometheus.io/scrape: "true" | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| release: dgraph | |
| component: alpha | |
| spec: | |
| affinity: | |
| podAntiAffinity: | |
| preferredDuringSchedulingIgnoredDuringExecution: | |
| - weight: 100 | |
| podAffinityTerm: | |
| labelSelector: | |
| matchExpressions: | |
| - key: component | |
| operator: In | |
| values: | |
| - alpha | |
| topologyKey: kubernetes.io/hostname | |
| securityContext: | |
| fsGroup: 1001 | |
| runAsUser: 1001 | |
| containers: | |
| - name: dgraph-dgraph-alpha | |
| image: docker.io/dgraph/dgraph:v20.07.1 | |
| ports: | |
| - containerPort: 7080 | |
| name: grpc-alpha-int | |
| - containerPort: 8080 | |
| name: http-alpha | |
| - containerPort: 9080 | |
| name: grpc-alpha | |
| imagePullPolicy: "IfNotPresent" | |
| env: | |
| - name: POD_NAMESPACE | |
| valueFrom: | |
| fieldRef: | |
| fieldPath: metadata.namespace | |
| - name: DGRAPH_ALPHA_CONFIG | |
| value: /dgraph/config/config.toml | |
| command: | |
| - bash | |
| - "-c" | |
| - | | |
| set -ex | |
| dgraph alpha --my=$(hostname -f):7080 --zero dgraph-dgraph-zero-0.dgraph-dgraph-zero-headless.${POD_NAMESPACE}.svc.cluster.local:5080 | |
| resources: | |
| requests: | |
| memory: 100Mi | |
| volumeMounts: | |
| - name: datadir | |
| mountPath: /dgraph | |
| - name: config-volume | |
| mountPath: /dgraph/config | |
| terminationGracePeriodSeconds: 600 | |
| volumes: | |
| - name: datadir | |
| persistentVolumeClaim: | |
| claimName: datadir | |
| - name: config-volume | |
| configMap: | |
| name: dgraph-dgraph-alpha-config | |
| volumeClaimTemplates: | |
| - metadata: | |
| name: datadir | |
| annotations: | |
| volume.alpha.kubernetes.io/storage-class: anything | |
| spec: | |
| accessModes: | |
| - "ReadWriteOnce" | |
| resources: | |
| requests: | |
| storage: "200Mi" | |
| storageClassName: "standard" | |
| --- | |
| # Source: dgraph/templates/zero/statefulset.yaml | |
| apiVersion: apps/v1 | |
| kind: StatefulSet | |
| metadata: | |
| name: "dgraph-dgraph-zero" | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| component: zero | |
| release: dgraph | |
| heritage: Helm | |
| spec: | |
| serviceName: dgraph-dgraph-zero-headless | |
| replicas: 1 | |
| podManagementPolicy: "OrderedReady" | |
| updateStrategy: | |
| type: "RollingUpdate" | |
| selector: | |
| matchLabels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| release: dgraph | |
| component: zero | |
| template: | |
| metadata: | |
| name: dgraph-dgraph-zero | |
| annotations: | |
| prometheus.io/path: /debug/prometheus_metrics | |
| prometheus.io/port: "6080" | |
| prometheus.io/scrape: "true" | |
| labels: | |
| app: dgraph | |
| chart: dgraph-0.0.11 | |
| release: dgraph | |
| component: zero | |
| spec: | |
| affinity: | |
| podAntiAffinity: | |
| preferredDuringSchedulingIgnoredDuringExecution: | |
| - weight: 100 | |
| podAffinityTerm: | |
| labelSelector: | |
| matchExpressions: | |
| - key: component | |
| operator: In | |
| values: | |
| - zero | |
| topologyKey: kubernetes.io/hostname | |
| securityContext: | |
| fsGroup: 1001 | |
| runAsUser: 1001 | |
| containers: | |
| - name: dgraph-dgraph-zero | |
| image: docker.io/dgraph/dgraph:v20.07.1 | |
| ports: | |
| - containerPort: 5080 | |
| name: grpc-zero | |
| - containerPort: 6080 | |
| name: http-zero | |
| imagePullPolicy: "IfNotPresent" | |
| env: | |
| - name: POD_NAMESPACE | |
| valueFrom: | |
| fieldRef: | |
| fieldPath: metadata.namespace | |
| - name: DGRAPH_ZERO_CONFIG | |
| value: /dgraph/config/config.toml | |
| command: | |
| - bash | |
| - "-c" | |
| - | | |
| set -ex | |
| [[ `hostname` =~ -([0-9]+)$ ]] || exit 1 | |
| ordinal=${BASH_REMATCH[1]} | |
| idx=$(($ordinal + 1)) | |
| if [[ $ordinal -eq 0 ]]; then | |
| exec dgraph zero --my=$(hostname -f):5080 --idx $idx --replicas 5 | |
| else | |
| exec dgraph zero --my=$(hostname -f):5080 --peer dgraph-dgraph-zero-0.dgraph-dgraph-zero-headless.${POD_NAMESPACE}.svc.cluster.local:5080 --idx $idx --replicas 5 | |
| fi | |
| resources: | |
| requests: | |
| memory: 100Mi | |
| volumeMounts: | |
| - name: datadir | |
| mountPath: /dgraph | |
| - name: config-volume | |
| mountPath: /dgraph/config | |
| terminationGracePeriodSeconds: 60 | |
| volumes: | |
| - name: datadir | |
| persistentVolumeClaim: | |
| claimName: datadir | |
| - name: config-volume | |
| configMap: | |
| name: dgraph-dgraph-zero-config | |
| volumeClaimTemplates: | |
| - metadata: | |
| name: datadir | |
| annotations: | |
| volume.alpha.kubernetes.io/storage-class: anything | |
| spec: | |
| accessModes: | |
| - "ReadWriteOnce" | |
| resources: | |
| requests: | |
| storage: "200Mi" | |
| storageClassName: "standard" |
This file contains hidden or 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
| --- | |
| apiVersion: apps/v1 | |
| kind: StatefulSet | |
| metadata: | |
| name: dgraph | |
| namespace: db | |
| spec: | |
| serviceName: "dgraph" | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: dgraph | |
| template: | |
| metadata: | |
| labels: | |
| app: dgraph | |
| spec: | |
| containers: | |
| - name: ratel | |
| image: dgraph/dgraph:latest | |
| imagePullPolicy: IfNotPresent | |
| ports: | |
| - containerPort: 8000 | |
| name: http-ratel | |
| command: | |
| - dgraph-ratel | |
| - name: zero | |
| image: dgraph/dgraph:latest | |
| imagePullPolicy: IfNotPresent | |
| ports: | |
| - containerPort: 5080 | |
| name: grpc-zero | |
| - containerPort: 6080 | |
| name: http-zero | |
| volumeMounts: | |
| - name: zerodir | |
| mountPath: /dgraph | |
| command: | |
| - bash | |
| - "-c" | |
| - | | |
| set -ex | |
| dgraph zero --my=$(hostname -f):5080 | |
| - name: alpha | |
| image: dgraph/dgraph:latest | |
| imagePullPolicy: IfNotPresent | |
| ports: | |
| - containerPort: 8080 | |
| name: http-alpha | |
| - containerPort: 9080 | |
| name: grpc-alpha | |
| volumeMounts: | |
| - name: alphadir | |
| mountPath: /dgraph | |
| env: | |
| - name: POD_NAMESPACE | |
| valueFrom: | |
| fieldRef: | |
| fieldPath: metadata.namespace | |
| command: | |
| - bash | |
| - "-c" | |
| - | | |
| set -ex | |
| dgraph alpha --my=$(hostname -f):7080 --zero dgraph-0.dgraph.${POD_NAMESPACE}.svc.cluster.local:5080 | |
| terminationGracePeriodSeconds: 60 | |
| volumes: | |
| - name: alphadir | |
| persistentVolumeClaim: | |
| claimName: alphadir | |
| - name: zerodir | |
| persistentVolumeClaim: | |
| claimName: zerodir | |
| volumeClaimTemplates: | |
| - metadata: | |
| name: alphadir | |
| annotations: | |
| volume.alpha.kubernetes.io/storage-class: anything | |
| spec: | |
| accessModes: | |
| - ReadWriteOnce | |
| resources: | |
| requests: | |
| storage: 200Mi | |
| storageClassName: "standard" | |
| - metadata: | |
| name: zerodir | |
| annotations: | |
| volume.alpha.kubernetes.io/storage-class: anything | |
| spec: | |
| accessModes: | |
| - ReadWriteOnce | |
| resources: | |
| requests: | |
| storage: 200Mi | |
| storageClassName: "standard" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment