Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install gitea #39

Merged
merged 2 commits into from
Nov 17, 2023
Merged

install gitea #39

merged 2 commits into from
Nov 17, 2023

Conversation

nimakaviani
Copy link
Contributor

fixes 32

@nimakaviani nimakaviani marked this pull request as draft October 18, 2023 06:42
@cmoulliard
Copy link
Contributor

Why do you install gitea as kubernetes resources and not using a Helm chart instead as I described in my issue #32 ?

@nimakaviani
Copy link
Contributor Author

The values file was used in helm template to generate and put the vanilla k8s resources under resources/gitea/k8s. I kept it there as I am still experimenting with what resources we want to configure (including the ingress and service information you mentioned in #32). we can remove it once we finalize the PR,

If we go down the route of installing gitea using the helm chart, we will have to either pull the helm go libraries in or create a dependency to helm, which I'd like to avoid.

As we discussed in #5 handling of any package or tool outside the initial bootstrapping should be handed over to Argo Apps, which can then take care of helm or kustomize or any other package types. That's why I am hesitant to introduce helm as part of the bootstrapping mechanism. its a draft PR, so open to suggestions here.

@cmoulliard
Copy link
Contributor

cmoulliard commented Oct 18, 2023

If we go down the route of installing gitea using the helm chart, we will have to either pull the helm go libraries in or create a dependency to helm, which I'd like to avoid.

Why ? You are also today creating a hard dependency as you must maintain the ArgoCD YAML file able to install argocd as core component + controller tracking its installation while using helm go lib we could more easily install the core components (argo cd, vault, argo workflow, cert manager) before to delegate to ArgoCD the job to install the pluggable Application CRs = Components
How will it be possible to configure the core component such as ArgoCD YAML resources during its deployment by the controller; using go template ?

@cmoulliard
Copy link
Contributor

we can remove it once we finalize the PR,

Ok.

@nabuskey
Copy link
Collaborator

@nimakaviani Is this going to be ready for review soon? I would like to get Gittea integration going.

@nabuskey
Copy link
Collaborator

We should reference the secret for the admin user credentials instead of directly using it in the pod template. See: https://gitea.com/gitea/helm-chart#admin-user

This way other controllers can reference it and get the credentials to talk to Gitea api. This does mean we have to helm template then add another manifest for the secret, which is a bit annoying and may cause confusions among users. So we should document and warn.

@nabuskey
Copy link
Collaborator

For helm values, we will also need to specify endpoint domain and URLs. Otherwise, API responses from Gitea for anything referencing base url has the default values of git.example.com.

For my local testing, I am using this, then port-forward.

gitea:
  admin:
    existingSecret: gitea-admin-secret
  config:
    database:
      DB_TYPE: sqlite3
    session:
      PROVIDER: memory
    cache:
      ADAPTER: memory
    queue:
      TYPE: level
    server:
      DOMAIN: localtest.me
      ROOT_URL: 'http://localtest.me:3000'

@nimakaviani nimakaviani linked an issue Nov 16, 2023 that may be closed by this pull request
- generalize installation for all embedded resources
- enable blocking on verification
- use secrets and https for gitea deployment

Signed-off-by: Nima Kaviani <[email protected]>
@nimakaviani nimakaviani marked this pull request as ready for review November 16, 2023 22:23
@nimakaviani nimakaviani changed the title wip - install gitea install gitea Nov 16, 2023
Copy link
Contributor

@jessesanford jessesanford left a comment

Choose a reason for hiding this comment

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

Love it. Thanks for drying up those local installs.

pkg/controllers/localbuild/argo.go Outdated Show resolved Hide resolved
pkg/controllers/localbuild/nginx.go Outdated Show resolved Hide resolved
pkg/controllers/localbuild/gitea.go Outdated Show resolved Hide resolved
)

//go:embed resources/nginx/k8s/*
var installNginxFS embed.FS
var timeout = time.After(3 * time.Minute)

func RawNginxInstallResources() ([][]byte, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we keep the ability to get embedded resources outside of these packages? Keep the functions or export the variable. The git repository reconciler needs a way to retrieve these to sync with gittea repos. You don't have to pass local dir ref and we have a distinction between repositories created with embedded contents vs local directory.

apiVersion: idpbuilder.cnoe.io/v1alpha1
kind: GitRepository
metadata:
  name: argocd
  namespace: default
spec:
  giteaURL: "http://localhost:3000"
  source:
    embeddedAppName: "argocd"
    type: embedded

Copy link
Contributor Author

@nimakaviani nimakaviani Nov 17, 2023

Choose a reason for hiding this comment

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

lets revisit it as part of pushing the files to the repos in the next PR. We will make adjustments where needed and when needed.

api/v1alpha1/localbuild_types.go Show resolved Hide resolved
pkg/controllers/localbuild/installer.go Outdated Show resolved Hide resolved
Signed-off-by: Nima Kaviani <[email protected]>
@nimakaviani nimakaviani requested a review from nabuskey November 17, 2023 01:18
@nimakaviani nimakaviani merged commit 11a9914 into main Nov 17, 2023
2 checks passed
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.

[suggestion] Use gitea as embedded git server
4 participants