integr8ly / gitea-operator Goto Github PK
View Code? Open in Web Editor NEWAn Operator that installs Gitea
License: Apache License 2.0
An Operator that installs Gitea
License: Apache License 2.0
https://github.com/integr8ly/gitea-operator/blob/master/pkg/controller/gitea/templateHelper.go
lines 17 and 18
docker.io/wkulhanek/gitea:1.6.0
This repository no longer exists.
Reference a Gitea image that exists.
The image repository no longer exists.
@pb82 I would like us to standardise on a makefile for the operators. I think one closer to https://raw.githubusercontent.com/integr8ly/3scale-operator/d2b1230dc9dcda8ed21f11b9c1d5787c41b0ab47/Makefile makes sense particularly around the tests and checks
In order to communicate what version of the gitea we are installing it would be good to have it reflected in the status block
I have created a CSV and deployed the operator using that and the roles, service account and role binding in the deploy/ directory. I have deployed it into an operatorgroup having one namespace in it.
Upon doing that I see constant errors in the logs, presumably as it looks for the gitea CRs to act on.
Operator deploys without permission problems
Operator logs show this as soon as it is deployed.
E0206 12:27:37.686923 1 reflector.go:205] github.com/integr8ly/gitea-operator/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go:126:
Failed to list *v1alpha1.Gitea: giteas.integreatly.org is forbidden:
User "system:serviceaccount:playground:gitea-operator" cannot list giteas.integreatly.org at the cluster scope:
no RBAC policy matched
Server https://ose.cms.solute.us:8443
openshift v3.11.154
kubernetes v1.11.0+d4cacc
Create OperatorGroup
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: playground
namespace: playground
spec:
targetNamespaces:
- playground
Create RBAC requirements
oc create -f deploy/roles.yaml
oc create -f deploy/role_binding.yaml
oc create -f deploy/service_account.yaml
Create CSV in playground namespace
oc create -f gitea.csv -n playground
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
annotations:
capabilities: Basic Install
name: gitea-operator.v0.0.5
namespace: placeholder
spec:
apiservicedefinitions: {}
customresourcedefinitions:
owned:
- kind: Gitea
name: giteas.integreatly.org
version: v1alpha1
displayName: Gitea
description: Provides one managed Gitea instance per CR, deleted upon deletion of the CR.
description: An Operator that installs Gitea. Installation is performed by creating a custom resource of kind Gitea. You can uninstall Gitea by removing this resource. The Operator will also watch all Gitea resources and reinstall them if they are deleted.
displayName: Gitea Operator
install:
spec:
deployments:
- name: gitea-operator
spec:
replicas: 1
selector:
matchLabels:
name: gitea-operator
strategy: {}
template:
metadata:
labels:
name: gitea-operator
spec:
containers:
- command:
- gitea-operator
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: gitea-operator
- name: TEMPLATE_PATH
value: /usr/local/bin/templates
image: quay.io/integreatly/gitea-operator:master
imagePullPolicy: Always
name: gitea-operator
ports:
- containerPort: 60000
name: metrics
resources: {}
serviceAccountName: gitea-operator
permissions:
- rules:
- apiGroups:
- ""
resources:
- pods
- services
- endpoints
- persistentvolumeclaims
- events
- configmaps
- secrets
- serviceaccounts
verbs:
- '*'
- apiGroups:
- apps
resources:
- deployments
- daemonsets
- replicasets
- statefulsets
verbs:
- '*'
- apiGroups:
- monitoring.coreos.com
resources:
- servicemonitors
verbs:
- get
- create
- apiGroups:
- integreatly.org
resources:
- '*'
verbs:
- '*'
- apiGroups:
- route.openshift.io
resources:
- routes
- routes/custom-host
verbs:
- '*'
- apiGroups:
- extensions
resources:
- ingresses
verbs:
- '*'
serviceAccountName: gitea-operator
strategy: deployment
installModes:
- supported: true
type: OwnNamespace
- supported: true
type: SingleNamespace
- supported: false
type: MultiNamespace
- supported: true
type: AllNamespaces
maturity: alpha
provider: {}
version: 0.0.5
Check out the logs
oc logs $(oc get pods -l name=gitea-operator -n playground -o=custom-columns="name:.metadata.name" --no-headers)
Operator does not detect that the database is running on GKE and k3s distros of k8s.
After the postgres pod reaches a running state the gitea pod to be created.
The operator remains in Phase: Wait for Database
.
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-01-18T23:30:10Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2+k3s1", GitCommit:"cdab19b09a84389ffbf57bebd33871c60b1d6b28", GitTreeState:"clean", BuildDate:"2020-01-27T18:09:26Z", GoVersion:"go1.13.6", Compiler:"gc", Platform:"linux/amd64"}
oc
commands for kubectl
including the example cr.Phase: Wait for Database
)I am not sure if this is a openshift vs non-openshift distros. It would be great if the operator could be made more distro agnostic.
Is it possible, without changing the operator code, to provide a different image and tag to deploy gitea from? I was thinking an attribute in the CRD, but I don't see that in place.
I see these mentioned at constants in pkg/controller/gitea/templateHelper.go so I'm thinking that isn't currently implemented, but I don't know Go well enough yet to be sure.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.