Skip to content

Commit

Permalink
Add manifest files for deploying the gitea-operator (#30)
Browse files Browse the repository at this point in the history
* Add manifest files for deploying the gitea-operator

---------

Signed-off-by: Landon LaSmith <[email protected]>
Co-authored-by: Gerard Ryan <[email protected]>
  • Loading branch information
LaVLaS and grdryn authored Oct 4, 2023
1 parent 022cc75 commit a1fbed4
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Artifacts in support of ODH Edge use cases that show integration with Red Hat Ad
| Red Hat Advanced Cluster Management | 2.8 |
| OpenShift Pipelines | 1.11.x |
| Quay Registry | 2.8 |
| Gitea | 1.20.2 |

## Proof of Concept Edge use case with ACM

Expand Down Expand Up @@ -55,6 +56,51 @@ See [pipelines/README.md](pipelines/README.md)
* Set variable `enableUserWorkload` to `true`
* Edit contents of [thanos-secret](acm/odh-core/acm-observability/secrets/thanos.yaml) file.

### Gitea in cluster git server for GitOps workflow
We are relying on the [gitea-operator](https://github.com/rhpds/gitea-operator) to manage the Gitea server installation in the cluster. This will simplify the setup of Gitea so that we can create a minimal [Gitea](https://github.com/rhpds/gitea-operator#migrating-repositories-for-created-users) CR to configure and install the Gitea server. The gitea-operator will be installed on the `odh-core` cluster as part of the ACM application rollout.

1. Wait for the gitea-operator installation to complete and the `gitea.pfe-rhpds.com` CRD is available on the `odh-core` cluster
```
$ oc get crd gitea.pfe.rhpds.com
NAME CREATED AT
gitea.pfe.rhpds.com 2023-08-25T03:00:13Z
```

1. Create the Gitea CustomResource to deploy the server with an admin user
```
cat <<EOF | oc apply -f -
---
apiVersion: v1
kind: Namespace
metadata:
name: gitea
---
apiVersion: pfe.rhpds.com/v1
kind: Gitea
metadata:
name: gitea-ai-edge
namespace: gitea
spec:
# Create the admin user
giteaAdminUser: admin-edge
giteaAdminEmail: admin@ai-edge
giteaAdminPassword: "opendatahub"
# Create the gitea users accounts to access the cluster
giteaCreateUsers: true
giteaGenerateUserFormat: "edge-user-%d"
giteaUserNumber: 3
giteaUserPassword: "opendatahub"
# Populate each gitea user org with a clone of the entries in the giteaRepositoriesList
giteaMigrateRepositories: true
giteaRepositoriesList:
- repo: https://github.com/opendatahub-io/ai-edge.git
name: ai-edge-gitops
private: false
EOF
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).
Expand Down
13 changes: 13 additions & 0 deletions acm/odh-core/olm-operator-subscriptions/gitea/catalogsource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: redhat-rhpds-gitea
namespace: gitea-operator
spec:
sourceType: grpc
image: quay.io/rhpds/gitea-catalog:latest
displayName: Red Hat Demo Platform (Gitea)
publisher: Red Hat Demo Platform

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
resources:
- namespace.yaml
- catalogsource.yaml
- operatorgroup.yaml
- subscription.yaml
5 changes: 5 additions & 0 deletions acm/odh-core/olm-operator-subscriptions/gitea/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: gitea-operator
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: gitea-operator
namespace: gitea-operator
spec:
targetNamespaces: []
12 changes: 12 additions & 0 deletions acm/odh-core/olm-operator-subscriptions/gitea/subscription.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: gitea-operator
namespace: gitea-operator
spec:
channel: stable
installPlanApproval: Automatic
name: gitea-operator
source: redhat-rhpds-gitea
sourceNamespace: gitea-operator
1 change: 1 addition & 0 deletions acm/odh-core/olm-operator-subscriptions/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ resources:
- operatorgroup.yaml
- opendatahub-operator.yaml
- openshift-pipelines.yaml
- ../gitea

0 comments on commit a1fbed4

Please sign in to comment.