Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[gitea] Initial Commit #6124

Closed
wants to merge 1 commit into from
Closed

Conversation

midnightconman
Copy link
Contributor

What this PR does / why we need it:
Adds a helm chart for gitea: https://gitea.io/en-US/

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:
This is very similar to gogs helm chart, with subtle differences.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 14, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: midnightconman
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: foxish

Assign the PR to them by writing /assign @foxish in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 14, 2018
@k8s-ci-robot
Copy link
Contributor

Hi @midnightconman. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 14, 2018
@midnightconman
Copy link
Contributor Author

/assign @foxish

@unguiculus
Copy link
Member

unguiculus commented Jun 17, 2018

There's another PR for Gitea: #3408 You may want to join forces.

@unguiculus
Copy link
Member

/assign

@filoozom
Copy link
Contributor

Would your initContainers workaround work in a Deployment with multiple replicas though? Wouldn't INTERNAL_TOKEN need to be shared across them?

The following table lists some of the configurable parameters of the Gitea
chart and their default values.

| Parameter | Description | Default |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sure what it's worth, but usually other Charts list every possible configuration settings of values.yaml. I'm not sure if that's really a benefit, because your values.yaml seems to have enough comments. Anyway, that's just my 2 cents


## Enable this to use captcha validation for registration.
##
serverDomain: gitea.example.com
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment and the key does not seems to go toogether

## Persistent Volume Storage configuration.
## ref: https://kubernetes.io/docs/user-guide/persistent-volumes
##
persistence:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you allow one to specify a existing PVC ? For exmaple jenkins does this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that works... read line 249.

##
databaseType: postgres

## Database host. Unused unless `postgresql.install` is false.
Copy link
Contributor

@Nodraak Nodraak Jun 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double negatives are hard to read and understand, could you use "Used only when postgresql.install is true." ? thanks :)

@jfelten
Copy link
Contributor

jfelten commented Jun 22, 2018

well darn it - I just created my own similar gitea chart since this PR was not there when I started. Feel free to borrow anything from my chart if helpful or let me know how I can help:

https://github.com/jfelten/gitea-helm-chart

@anapsix
Copy link
Collaborator

anapsix commented Jul 11, 2018

used this chart to setup Gitea, having some trouble
resolving these issues, I was able to use this chart to provision Gitea


reading config

I don't think it's picking up the config at all..
Logs show the following:

2018/07/11 11:51:03 [T] AppPath: /app/gitea/gitea
2018/07/11 11:51:03 [T] AppWorkPath: /app/gitea
2018/07/11 11:51:03 [T] Custom path: /data/gitea
2018/07/11 11:51:03 [T] Log path: /data/gitea/log
2018/07/11 11:51:03 [I] Log Mode: Console(Info)
2018/07/11 11:51:03 [I] XORM Log Mode: Console(Info)
2018/07/11 11:51:03 [I] Cache Service Enabled
2018/07/11 11:51:03 [I] Session Service Enabled
2018/07/11 11:51:03 [I] SQLite3 Supported
2018/07/11 11:51:03 [I] Run Mode: Development
2018/07/11 11:51:03 [I] Gitea v1.4.2 built with: bindata, sqlite
2018/07/11 11:51:03 [I] Listen: http://0.0.0.0:3000

copied the config, but got an error

cp /etc/gitea/conf/app.ini /data/gitea/conf/app.ini
s6-svc -h /etc/s6/gitea
## logs
2018/07/11 12:26:49 [T] AppPath: /app/gitea/gitea
2018/07/11 12:26:49 [T] AppWorkPath: /app/gitea
2018/07/11 12:26:49 [T] Custom path: /data/gitea
2018/07/11 12:26:49 [T] Log path: /app/gitea/log
2018/07/11 12:26:49 [I] Log Mode: Console(Info)
2018/07/11 12:26:49 [I] XORM Log Mode: Console(Info)
2018/07/11 12:26:49 [I] Cache Service Enabled
2018/07/11 12:26:49 [I] Session Service Enabled
2018/07/11 12:26:49 [I] Gitea v1.4.2 built with: bindata, sqlite
2018/07/11 12:26:49 [I] PING DATABASE postgres
2018/07/11 12:26:49 [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: pq: SSL is not enabled on the server

postgresql

adding SSL_MODE = disable to [database] section of configmap helps

    [database]
    DB_TYPE = {{ .Values.service.gitea.databaseType | quote }}
    HOST = {{ template "gitea.database.host" . }}
    {{ if .Values.postgresql.install -}}
    SSL_MODE = disable
    {{- end }}
    NAME = {{ template "gitea.database.name" . }}
    USER = {{ template "gitea.database.user" . }}
    PASSWD = {{ template "gitea.database.password" . }}
    PATH = {{ .Values.service.gitea.databasePath | quote }}

But initContainers should be fixed to copy the config to the right place, if I understand the issue correctly.
I've removed config-rw and updated init container with the following:

      initContainers:
        - name: copy-app-ini
          image: alpine:3.7
          command: ["/bin/sh"]
          args: 
            - -c
            - "cp /config/* /data/gitea/conf/; chmod 640 /data/gitea/conf/*; chown 1000:1000 -R /data/gitea/conf/*"
          volumeMounts:
            - name: config
              mountPath: /config
            - name: data
              mountPath: /data

indexerIssuePath

is defined as /data/issues.bleve, but it generates the following error:

InitIssueIndexer()] [E] InitIssuesIndexer: create index, mkdir /data/issues.bleve: permission denied

changing it to /data/gitea/issues.bleve helps

@mattfarina mattfarina added the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Aug 27, 2018
Copy link
Collaborator

@jpds jpds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A newer version of Gitea is out.


image:
repository: gitea/gitea
tag: 1.4.2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitea 1.5.1 is out.

@@ -0,0 +1,12 @@
apiVersion: v1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this only be created if .Values.postgresql.create=true?

- name: data
mountPath: /data
- name: config-rw
mountPath: /etc/gitea/conf

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect you mean to mount this to /etc/templates/ so that it gets consumed by https://github.com/go-gitea/gitea/blob/6e03390aa8fa096206457962db1955d642860b57/docker/etc/s6/gitea/setup#L39 on initial start up

@stormmore
Copy link

stormmore commented Sep 10, 2018

On top of the 2 comments I have made, It should be noted that the config file that is used is in /data/gitea/conf/app.ini so during an upgrade, changing any setting in the Chart's values will have no impact on the configuration.

One solution would be to have a pre-upgrade hook that deletes /data/conf/app.ini and do the mount to /etc/templates per my other comment. Seems a bit of overkill.

I suspect, the config could simply be mounted to /data/gitea/conf/ after the /data/ volume is mounted.

Another thing I noticed while investigating this chart is that there is a difference between the app.ini content in the chart and what is written by the gitea installer in the UI. Unfortunately, I forgot to save the diff and I suspect it is just a diff between different gitea releases.

@stale
Copy link

stale bot commented Oct 10, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

@stale stale bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 10, 2018
@stale
Copy link

stale bot commented Oct 24, 2018

This issue is being automatically closed due to inactivity.

@stale stale bot closed this Oct 24, 2018
Copy link

@ArnauFauquer ArnauFauquer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all tested, and perfect

@Tchoupinax
Copy link

Hello :)

What is the state of this project branch ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet