kappnav / issues

kAppNav global issues
0 stars 0 forks source link

Operator adds kAppNav annotations to StatefulSet which is not part of an Application #160

Closed matthewpwilson closed 4 years ago

matthewpwilson commented 4 years ago

If I install kAppNav into my OCP 4.2 cluster and create an application CR, kAppNav adds annotations to StatefulSets that are not part of the application (i.e. they do not match the selector) but in the same namespace. In this case the StatefulSet is managed by another operator, and the presence of the unexpected annotations causes the operator to recreate the resource each time they are added!

Should kAppNav be adding these annotations to resources it doesn't own at all?

Application CR:

apiVersion: app.k8s.io/v1beta1
kind: Application
metadata:
  labels:
    app.kubernetes.io/name: coffeeshop
    app.kubernetes.io/version: 1.0.0
  name: coffeeshop 
spec:
  descriptor:
    links:
    - description: GitOps Repo
      url: "http://github.ibm.com/appsody-coffeeshop/gitops"
  componentKinds:
  - group: App
    kind: Deployment
  - group: App
    kind: StatefulSet
  - group: App
    kind: Service
  - group: App
    kind: Route
  - group: App
    kind: Ingress
  - group: App
    kind: ConfigMap
  selector:
    matchLabels:
      app.kubernetes.io/part-of: coffeeshop

StatefulSet metadata:

piVersion: apps/v1
kind: StatefulSet
metadata:
  annotations:
    kappnav.status.flyover: Status is normal when resource exists
    kappnav.status.flyover.nls: '"status.flyover.unregistered"'
    kappnav.status.value: Normal
    strimzi.io/kafka-version: 2.4.0
    strimzi.io/storage: '{"type":"ephemeral"}'
  creationTimestamp: "2020-03-16T16:25:21Z"
  generation: 1
  labels:
    app.kubernetes.io/instance: my-cluster
    app.kubernetes.io/managed-by: strimzi-cluster-operator
    app.kubernetes.io/name: strimzi
    strimzi.io/cluster: my-cluster
    strimzi.io/kind: Kafka
    strimzi.io/name: my-cluster-kafka
  name: my-cluster-kafka
  namespace: coffeeshop
  ownerReferences:
  - apiVersion: kafka.strimzi.io/v1beta1
    blockOwnerDeletion: false
    controller: false
    kind: Kafka
    name: my-cluster
    uid: fb1dcc18-6ea8-40d0-96e2-e4f6065aa628
  resourceVersion: "11114272"
  selfLink: /apis/apps/v1/namespaces/coffeeshop/statefulsets/my-cluster-kafka
  uid: 4790b2c8-9ee8-437f-b838-b3b07fa980a1
ianpartridge commented 4 years ago

@cvignola who can take a look at this? It's blocking our usage of kAppNav in a Strimzi-based scenario.

cvignola commented 4 years ago

@ianpartridge @paulben is investigating.

ianpartridge commented 4 years ago

Great, thanks!

paulben commented 4 years ago

I've recreated it. Working on a fix.

ianpartridge commented 4 years ago

How's it going? Do you have a test version of kAppNav we could try out?

ianpartridge commented 4 years ago

Hi @rlcundiff could you point us at a fixed version of kAppNav that we could download and test out please?