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

Statefulset support #1903

Closed
yacut opened this issue Nov 8, 2019 · 8 comments
Closed

Statefulset support #1903

yacut opened this issue Nov 8, 2019 · 8 comments
Assignees

Comments

@yacut
Copy link

yacut commented Nov 8, 2019

General remarks
Kiali does not supports statefulset apps.

Describe the bug
If you use k8s statefulset instead of k8s deployment for your app, than kiali will not display any workload for the app.

Screenshot 2019-11-07 at 23 12 54

Screenshot 2019-11-07 at 23 12 39

Versions used
Kiali: v1.9
Istio: 1.3.4
Kubernetes flavour and version: GKE 1.13.11-gke.9

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Kiali dashboard'
  2. Click on 'Overview'
  3. No statefulset workload is shown in the namespace overview
  4. Click on "Applications"
  5. Choose some statefulset app
  6. No statefulset workload is shown in the app overview

Expected behavior
All statefulset workloads are shown as in the case of standard deployment workloads

@jotak
Copy link
Contributor

jotak commented Nov 8, 2019

I'm surprised, Statefulset is among the workload kinds kiali is supposed to fetch: https://github.com/kiali/kiali/blob/master/business/workloads.go#L251-L261
Can you tell if it is correctly visible from the Workloads menu?

Does it have the correct app label set on it? If possible, it would be nice to see the Statefulset yaml - amend anything you would need to hide

@yacut
Copy link
Author

yacut commented Nov 8, 2019

Can you tell if it is correctly visible from the Workloads menu?

No
Screenshot 2019-11-08 at 14 47 33

Does it have the correct app label set on it? If possible, it would be nice to see the Statefulset yaml - amend anything you would need to hide

apiVersion: apps/v1
kind: StatefulSet
metadata:
  creationTimestamp: "2019-11-07T16:08:19Z"
  generation: 4
  labels:
    app: my-service
    version: stable
  name: my-service
  namespace: default
  resourceVersion: "5913223"
  selfLink: /apis/apps/v1/namespaces/default/statefulsets/my-service
  uid: d090e18f-0178-11ea-8f65-0a952dda548a
spec:
  podManagementPolicy: Parallel
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: my-service
      version: stable
  serviceName: my-service
  template:
    metadata:
      annotations:
        traffic.sidecar.istio.io/excludeOutboundIPRanges: 0.0.0.0/0
      creationTimestamp: null
      labels:
        app: my-service
        version: stable
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: app
                      operator: In
                      values:
                        - my-service
                topologyKey: failure-domain.beta.kubernetes.io/zone
              weight: 100
      automountServiceAccountToken: true
      containers:
        - env:
            - name: NODE_ENV
              value: development
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
            - name: KUBERNETES_NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: POD_IP
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: status.podIP
          image: my-service
          imagePullPolicy: Always
          name: my-service
          ports:
            - containerPort: 8080
              name: http-app
              protocol: TCP
          securityContext:
            allowPrivilegeEscalation: true
            privileged: false
            readOnlyRootFilesystem: false
            runAsGroup: 1337
            runAsNonRoot: false
            runAsUser: 0
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: my-service
      serviceAccountName: my-service
      shareProcessNamespace: false
      terminationGracePeriodSeconds: 60
  updateStrategy:
    rollingUpdate:
      partition: 1
    type: RollingUpdate
status:
  collisionCount: 0
  currentReplicas: 1
  currentRevision: my-service-6bdbb7d45d
  observedGeneration: 4
  readyReplicas: 2
  replicas: 2
  updateRevision: my-service-69d6d4d8c8
  updatedReplicas: 1

@mattmahoneyrh
Copy link
Contributor

mattmahoneyrh commented Nov 8, 2019

There are similar issues encountered when creating Bookinfo workloads of type 'StatefulSet' and 'ReplicationController' by applying the following Bookinfo test yaml:

https://github.com/kiali/kiali/blob/master/tests/e2e/assets/bookinfo-workloads.yaml

After applying the above yaml, the API call 'api/namespaces/bookinfo/workloads' does not return reviews-v5 (ReplicationController) and reviews-v6 (StatefulSet).

Issue was flushed out by E2E test
bookinfo-workloads.yaml -> test_diversity_in_workload_list_endpoint()

@jshaughn
Copy link
Collaborator

jshaughn commented Nov 8, 2019

Assigning to @lucasponce for review as this is related to cache/optimization work in this commit from 21 days ago. It looks to be intentional but could be considered a breaking change in behavior for Kiali v1.8+.

For efficiency Kiali no longer fetches all workload kinds, presumably because there are so many kinds and many of those kinds are not frequently used. The filtered kinds are currently:

  • CronJob
  • DeploymentConfig
  • Job
  • ReplicationController
  • StatefulSet

The good news is it's configurable. So, to see the StatefulSets you need to remove it from the excluded workload kinds:

If installed with the Kiali Operator then edit the Kiali CR and add an entry for exclude_workloads. Add only those you want to exclude (i.e. don't use). So, if you use everything other than CronJob and Job:

spec:
  kubernetes_config:
    excluded_workloads:
    - CronJob
    - Job

The Kiali operator will pick up and apply the change. If you install with Helm charts then edit the Kiali configMap in a similar way.

@mattmahoneyrh
Copy link
Contributor

mattmahoneyrh commented Nov 8, 2019

@jshaughn the suggested change to the Kiali CR resolved the issue.

@jshaughn
Copy link
Collaborator

jshaughn commented Nov 8, 2019

cc @yacut see above ^

@yacut
Copy link
Author

yacut commented Nov 9, 2019

@jshaughn It's works now. Thank you

@yacut yacut closed this as completed Nov 9, 2019
@lucasponce
Copy link
Contributor

@yacut @mattmahoneyrh @jshaughn

Yes, you are right, it's configurable, by default Kiali fetched every kind of controller and that added extra-pressure on kubernetes API adding more latency by default.

Now, it's configurable and user can configure the controllers that are fetched by Kiali.

Also this feedback is good, @yacut can you also add more info about your sceneario ? I mean, to see how many other controllers are used (i.e. we have feedback that Jobs are very uncommon together with Istio scenarios).

[1] https://github.com/kiali/kiali/blob/master/operator/deploy/kiali/kiali_cr.yaml#L452

aljesusg pushed a commit to aljesusg/kiali that referenced this issue Mar 26, 2022
* Support more powerful graph find/hide expressions. Make better use of disjuntive selectors
to enhance handling of OR/AND.

kiali#3165
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

No branches or pull requests

5 participants