1

我正在尝试在我的 Kubernetes 集群上部署 GLPI 应用程序(http://glpi-project.org/),但我遇到了一个问题。

这是我的部署代码:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pv-claim-glpi
  labels:
    type: openebs
spec:
  storageClassName: openebs-storageclass
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
---

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: glpi
  namespace: jb
  labels:
    app: glpi
spec:
  selector:
    matchLabels:
      app: glpi
  replicas: 1 # tells deployment to run 1 pods matching the template
  template: # create pods using pod definition in this template
    metadata:
      # unlike pod-nginx.yaml, the name is not included in the meta data as a unique name is
      # generated from the deployment name
      labels:
        app: glpi
    spec:
      volumes:
      - name: pv-storage-glpi
        persistentVolumeClaim:
          claimName: pv-claim-glpi
      containers:
      - name: mariadb
        image: mariadb
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: "glpi"
        - name: MYSQL_DATABASE
          value: "glpi"
        - name: MYSQL_USER
          value: "glpi"
        - name: MYSQL_PASSWORD
          value: "glpi"
        - name: GLPI_SOURCE_URL
          value: "https://forge.glpi-project.org/attachments/download/2020/glpi-0.85.4.tar.gz"
        ports:
        - containerPort: 3306
          name: mariadb
        volumeMounts:
        - mountPath: /var/lib/mariadb/
          name: pv-storage-glpi
          subPath: mariadb
      - name: glpi
        image: driket54/glpi
        ports:
        - containerPort: 80
          name: http
        - containerPort: 8090
          name: https
        volumeMounts:
        - mountPath: /var/glpidata
          name: pv-storage-glpi
          subPath: glpidata
---
apiVersion: v1
kind: Service
metadata:
  name: glpi
  namespace: jb
spec:
  selector:
    app: glpi
  ports:
  - protocol: "TCP"
    port: 80
    targetPort: http
    name: http
  - protocol: "TCP"
    port: 8090
    targetPort: https
    name: https
  - protocol: "TCP"
    port: 3306
    targetPort: mariadb
    name: mariadb
  type: NodePort  
---  

docker 映像已正确部署,但在我的测试阶段,在应用程序设置期间,我在设置数据库(mysql)时收到以下错误。

错误glpi

我已经检查了凭据(主机、用户名、密码)并且是正确的

请帮忙

4

1 回答 1

0

不是一个真正的答案,因为我没有预期的 Kubernetes 知识,但我还不能添加评论:(

你应该首先改变的是你的 GLPi 版本。使用此链接。这是最后一个: https ://github.com/glpi-project/glpi/releases/download/9.3.0/glpi-9.3.tgz

然后您可以使用 cli 工具来设置数据库。 https://glpi-install.readthedocs.io/en/latest/command-line.html

使用我从您的文件中获得的信息:

php scripts/cliinstall.php --host=mariadb(not sure about this one in your environment but you get hte idea) --db=glpi --user=glpi --pass=glpi
于 2018-08-23T12:21:29.440 回答