nefelim4ag / teamcity-charts

GNU General Public License v3.0
5 stars 3 forks source link

Dynamically building a `node-config.xml` #3

Closed alec-drw closed 9 months ago

alec-drw commented 9 months ago

Hello! Appreciate the work you have done on this chart - something JetBrains should be providing themselves. I have used this to deploy JetBrains 2021.2 which has required a few tweaks, but overall a smooth process.

When migrating a backup over from a VM, the one piece that seems to be missing here is some sort of ownership over the nodes-config.xml file that lives in the data directory. Prior to the switch to HAProxy from Nginx there was no mention of node responsibilities, and I would have to edit that file manually. Abstracting responsibilities to values.yaml has proven to be a very clean solution, however I do believe this should be taken a step further and use the provide values to generate a node-config.xml that matches with the TEAMCITY_SERVER_OPTS defined in the startup wrapper.

Something similar to the following (although this is partially broken templating logic):

  nodes-config.xml: |
    <?xml version="1.0" encoding="UTF-8"?>
    <nodes-config>
      <nodes>
{{- range $index, $value := .Values.teamcity.nodes }}
        <node id="{{ $.Release.Name }}-{{ $index }}" url="{{ $value.ingress.host[0] }}" enabled-responsibilities="{{ $value.responsibilities }}"">
{{- end -}}
      </nodes>
    </nodes-config>
nefelim4ag commented 9 months ago

But you do not need to edit it at all, this file is managed by TeamCity. After migration it will be overwritten, afaik that will not cause any issues. You can always access the current node config in the admin interface.

If you would like, I can assist you and help write a template for it. AFAIK url is not needed or only needed for inter-node communication. But your mileage may differ.

alec-drw commented 9 months ago

I see - I just did a rolling restart of TC and found that nodes-config.xml was rewritten correctly and the headless services are properly referenced in the UI. Thanks for the clarification!