Копирование смонтированных файлов с помощью команды в Kubernetes идет медленно - PullRequest
0 голосов
/ 19 октября 2018

Я создаю кластер OrientDB с Kubernetes (в Minikube), и я использую Stateful Sets для создания модулей.Я пытаюсь смонтировать все конфигурации кластера OrientDB в папку с именем config.С помощью команды я копирую файлы после монтирования в стандартную папку / orientdb / config.Однако после того, как я добавил эту функциональность, модули создавались с меньшей скоростью, и иногда я получаю исключения, такие как:

Unable to connect to the server: net/http: TLS handshake timeout

До этого я пытался монтировать конфиги непосредственно в папку / orientdb / config.Но у меня была ошибка с разрешениями, поэтому я исследовал, что монтирование в корневую папку запрещено.

Как я могу подойти к такой проблеме?И можно ли найти какой-нибудь обходной путь?

Stateful Set выглядит следующим образом:

kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: orientdbservice
spec:
  serviceName: orientdbservice
  replicas: 3
  selector:
    matchLabels:
      service: orientdb
      type: container-deployment
  template:
    metadata:
      labels:
        service: orientdb
        type: container-deployment
    spec:
      containers:
      - name: orientdbservice
        image: orientdb:2.2.36
        command: ["/bin/sh","-c", "cp /configs/* /orientdb/config/ ; /orientdb/bin/server.sh -Ddistributed=true" ]
        env:
        - name: ORIENTDB_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: orientdb-password
              key: password.txt
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        ports:
        - containerPort: 2424
          name: port-binary
        - containerPort: 2480
          name: port-http
        volumeMounts:
        - name: config
          mountPath: /orientdb/config
        - name: orientdb-config-backups
          mountPath: /configs/backups.json
          subPath: backups.json
        - name: orientdb-config-events
          mountPath: /configs/events.json
          subPath: events.json
        - name: orientdb-config-distributed
          mountPath: /configs/default-distributed-db-config.json
          subPath: default-distributed-db-config.json
        - name: orientdb-config-hazelcast
          mountPath: /configs/hazelcast.xml
          subPath: hazelcast.xml
        - name: orientdb-config-server
          mountPath: /configs/orientdb-server-config.xml
          subPath: orientdb-server-config.xml
        - name: orientdb-config-client-logs
          mountPath: /configs/orientdb-client-log.properties
          subPath: orientdb-client-log.properties
        - name: orientdb-config-server-logs
          mountPath: /configs/orientdb-server-log.properties
          subPath: orientdb-server-log.properties
        - name: orientdb-config-plugin
          mountPath: /configs/pom.xml
          subPath: pom.xml
        - name: orientdb-databases
          mountPath: /orientdb/databases
        - name: orientdb-backup
          mountPath: /orientdb/backup
        - name: orientdb-data
          mountPath: /orientdb/bin/data
      volumes:
      - name: config
        emptyDir: {}
      - name: orientdb-config-backups
        configMap:
          name: orientdb-configmap-backups
      - name: orientdb-config-events
        configMap:
          name: orientdb-configmap-events
      - name: orientdb-config-distributed
        configMap:
          name: orientdb-configmap-distributed
      - name: orientdb-config-hazelcast
        configMap:
          name: orientdb-configmap-hazelcast
      - name: orientdb-config-server
        configMap:
          name: orientdb-configmap-server
      - name: orientdb-config-client-logs
        configMap:
          name: orientdb-configmap-client-logs
      - name: orientdb-config-server-logs
        configMap:
          name: orientdb-configmap-server-logs
      - name: orientdb-config-plugin
        configMap:
          name: orientdb-configmap-plugin
      - name: orientdb-data
        hostPath:
          path: /import_data
          type: Directory
  volumeClaimTemplates:
  - metadata:
      name: orientdb-databases
      labels:
        service: orientdb
        type: pv-claim
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 20Gi
  - metadata:
      name: orientdb-backup
      labels:
        service: orientdb
        type: pv-claim
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 10Gi
...