Git Product home page Git Product logo

gitea-operator's People

Contributors

camilamacedo86 avatar david-martin avatar gastaldi avatar jameelb avatar maleck13 avatar mikenairn avatar pb82 avatar philbrookes avatar sedroche avatar tremes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitea-operator's Issues

Operator appears to need cluster scope permissions so can't be in own namespace?

Description

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.

Expected Behavior

Operator deploys without permission problems

Actual Behavior

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

Environment

  • Operating system: (E.g RHEL 7.6 )
  • OpenShift version:
    ~$ oc version
    oc v3.11.0+0cbc58b
    kubernetes v1.11.0+d4cacc0
    features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://ose.cms.solute.us:8443
openshift v3.11.154
kubernetes v1.11.0+d4cacc

  • OLM version
    upgraded OpenShift 3.11 to use 0.12.0, functioning well with multiple other operators including our own.
  • Project Version/Tag: (E.g release-1.0.1)
    06b13cd (tag: v0.0.5)

Steps to reproduce

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 stuck in `Wait for Database` phase on non-openshift distros

Description

Operator does not detect that the database is running on GKE and k3s distros of k8s.

Expected Behavior

After the postgres pod reaches a running state the gitea pod to be created.

Actual Behavior

The operator remains in Phase: Wait for Database.

Environment

  • Operating system: Fedora 32.20200512.0
  • Kubernetes version: k3s: v1.17.2+k3s1 containerd:1.3.3-k3s1
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"}
  • Project Version/Tag: 0.0.5

Steps to reproduce

  • Install the operator and example cr as per the Makefile substituting oc commands for kubectl including the example cr.
  • Check the running pods (postgres should be up and running fine)
  • Check operator logs (stuck in 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.

Changing the image deployed by the operator

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.