Skip to content

Conversation

xavier-hou
Copy link
Member

Pre-Checklist

Note: please complete ALL items in the following checklist.

  • I have read through the CONTRIBUTING.md documentation.
  • My code has the necessary comments and documentation (if needed).
  • I have added relevant tests

Description

Add zentao plugin, currently just deal with zentao installation.

For this implementation zentao application is deployed in a k8s cluster by client-go, later I expect to deploy zentao by Helm.

Implementation

1. create.go

Create zentao namespaces, persistentVolume, persistentVolumeClaim, deployment, service.

  • PersistentVolume use HostPath and in a single-node cluster now.
  • Service is exposed by NodePort.
2. delete.go

Delete zentao namespaces, persistentVolume, persistentVolumeClaim, deployment, service.

  • Perform the opposite operation of creation.
3. k8s.go

Some cluster-related operations

4. update.go

Just rebuild zentao deployment and service.

Options and configuration

Here needs more advice and consideration. I want to support different installation way in config files and use type field to indicate.
A simple example configuration file is as follows:

tools:
  # name of the tool
  - name: zentao
    # id of the tool instance
    instanceID: default
    # format: name.instanceID; If specified, dtm will make sure the dependency is applied first before handling this tool
    dependsOn: [ ]
    # options for the plugin
    options:
      type: "clientAPI"
      clientAPI:
        namespace: "zentao"
        storageClassName: "zentao-storage"
        persistentVolume:
          zentaoPVName: "zentao-pv"
          zentaoPVCapacity: "1G"
          mysqlPVName: "mysql-pv"
          mysqlPVCapacity: "1G"
        persistentVolumeclaim:
          zentaoPVCName: "zentao-pvc"
          zentaoPVCCapacity: "1G"
          mysqlPVCName: "mysql-pv"
          mysqlPVCCapacity: "1G"
        deployment:
          name: "zentao-dp"
          replicas: 3
          image: "easysoft/zentao:latest"
          mysqlPasswdName: "MYSQL_ROOT_PASSWORD"
          mysqlPasswdValue: "1234567"
        service:
          name: "zentao-svc"
          nodePort: 30081
      helm:

By the way, I am not particularly satisfied with the current implementation, I need more requirements and suggestions.

Please feel free to give me any advice you think would make sense, I would really appreciate it!

Related Issues

#508

New Behavior (screenshots if needed)

image

@xavier-hou xavier-hou force-pushed the feat-zentao branch 2 times, most recently from 2a52627 to c723bf7 Compare June 14, 2022 03:22
@KeHaohaoke
Copy link

I used your code for a local test, and it can run well. It's good that you try to specify the deployment method through configuration. Documents can be completed. @HXCGIT

@xavier-hou xavier-hou marked this pull request as ready for review June 20, 2022 10:32
@xavier-hou xavier-hou requested review from IronCore864 and a team as code owners June 20, 2022 10:32
@xavier-hou
Copy link
Member Author

/hold
I'll check the code again and add plugin docs.

@IronCore864
Copy link
Member

It seems MySQL is a requirement for zentao. Do you think it's possible to install MySQL as well? @HXCGIT @daniel-hutao @KeHaohaoke

@xavier-hou
Copy link
Member Author

@IronCore864 Yep, Zentao need MySQL.

  1. For official images easysoft/zentao, zentao service and mysql service are all installed. https://www.zentao.net/book/zentaopmshelp/405.html
  2. I'm not exactly sure what you mean. If we use a individual mysql service in another pod, we will need to modify some initialization scripts of the official image accordingly.

@KeHaohaoke @daniel-hutao any good ideas?

@xavier-hou
Copy link
Member Author

By the way, the official image doesn't seem to work well in mac m1 arm. Please test in linux amd64 system.

@xavier-hou xavier-hou closed this Jun 22, 2022
@xavier-hou
Copy link
Member Author

How to reopen this pull request?

@xavier-hou xavier-hou reopened this Jun 22, 2022
@xavier-hou xavier-hou force-pushed the feat-zentao branch 2 times, most recently from 2b73529 to a22cd6f Compare June 22, 2022 15:09
@xavier-hou
Copy link
Member Author

@KeHaohaoke @IronCore864 PTAL.

Signed-off-by: hxcGit <houxc_mail@163.com>
@KeHaohaoke
Copy link

Zentao's official image integrates MySQL, so we discuss that we can use the official image first. That's ok. @HXCGIT

Signed-off-by: hxcGit <houxc_mail@163.com>
@IronCore864
Copy link
Member

@HXCGIT thanks for this great contribution. I'll test it locally and get back to you ASAP.

@IronCore864
Copy link
Member

Merging now, see discussions in Slack. Please contribute another PR to follow up on those discussions. Thanks for your contribution! @HXCGIT

@IronCore864 IronCore864 merged commit 331d095 into devstream-io:main Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants