cstor-operators icon indicating copy to clipboard operation
cstor-operators copied to clipboard

Cstor: services declare used ports

Open survivant opened this issue 2 years ago • 0 comments

I ran a tool to validate the cluster (https://github.com/derailed/popeye), and I found out that lot of services declare ports that are not in the corresponding pods.

here a example :

service

apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2021-07-07T14:06:22Z"
  labels:
    openebs.io/cas-type: cstor
    openebs.io/persistent-volume: pvc-96532ea1-852e-4a1f-b5fd-35a4ad3f8adc
    openebs.io/storage-engine-type: cstor
    openebs.io/target-service: cstor-target-svc
    openebs.io/version: 2.10.0
  
  name: pvc-96532ea1-852e-4a1f-b5fd-35a4ad3f8adc
  namespace: openebs
 
spec:
  clusterIP: 10.105.114.84
  ports:
  - name: cstor-iscsi
    port: 3260
    protocol: TCP
    targetPort: 3260
  - name: cstor-grpc
    port: 7777
    protocol: TCP
    targetPort: 7777
  - name: mgmt
    port: 6060
    protocol: TCP
    targetPort: 6060
  - name: exporter
    port: 9500
    protocol: TCP
    targetPort: 9500
  selector:
    app: cstor-volume-manager
    openebs.io/persistent-volume: pvc-96532ea1-852e-4a1f-b5fd-35a4ad3f8adc
    openebs.io/target: cstor-target
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}

pod

---
apiVersion: v1
kind: Pod
metadata:
  annotations:
    cni.projectcalico.org/podIP: 192.168.158.114/32
    cni.projectcalico.org/podIPs: 192.168.158.114/32
    prometheus.io/path: /metrics
    prometheus.io/port: "9500"
    prometheus.io/scrape: "true"
  creationTimestamp: "2021-07-07T15:52:24Z"
  generateName: pvc-96532ea1-852e-4a1f-b5fd-35a4ad3f8adc-target-d569c5dd5-
  labels:
    app: cstor-volume-manager
    monitoring: volume_exporter_prometheus
    openebs.io/persistent-volume: pvc-96532ea1-852e-4a1f-b5fd-35a4ad3f8adc
    openebs.io/persistent-volume-claim: pvc-report-engine-data
    openebs.io/target: cstor-target
    openebs.io/version: 2.10.0
    pod-template-hash: d569c5dd5
  name: pvc-96532ea1-852e-4a1f-b5fd-35a4ad3f8adc-target-d569c5dd5-lwllw
  namespace: openebs
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: ReplicaSet
    name: pvc-96532ea1-852e-4a1f-b5fd-35a4ad3f8adc-target-d569c5dd5
    uid: b6015e4d-8a78-4725-9950-21fedefea141
  resourceVersion: "55359644"
  uid: cb9d25fb-fc63-45bb-b1a8-24d2fda37719
spec:
  affinity: {}
  containers:
  - env:
    - name: QueueDepth
      value: "32"
    - name: Luworkers
      value: "16"
    image: openebs/cstor-istgt:2.10.0
    imagePullPolicy: IfNotPresent
    name: cstor-istgt
    ports:
    - containerPort: 3260
      protocol: TCP
    resources:
      limits:
        cpu: 500m
        memory: 128Mi
      requests:
        cpu: 250m
        memory: 64Mi
    securityContext:
      privileged: true
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /var/run
      name: sockfile
    - mountPath: /usr/local/etc/istgt
      name: conf
    - mountPath: /var/openebs/cstor-target
      name: storagepath
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: openebs-cstor-operator-token-mjfml
      readOnly: true
  - args:
    - -e=cstor
    command:
    - maya-exporter
    image: openebs/m-exporter:2.10.0
    imagePullPolicy: IfNotPresent
    name: maya-volume-exporter
    ports:
    - containerPort: 9500
      protocol: TCP
    resources:
      limits:
        cpu: 500m
        memory: 128Mi
      requests:
        cpu: 250m
        memory: 64Mi
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /var/run
      name: sockfile
    - mountPath: /usr/local/etc/istgt
      name: conf
    - mountPath: /var/openebs/cstor-target
      name: storagepath
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: openebs-cstor-operator-token-mjfml
      readOnly: true
  - env:
    - name: OPENEBS_IO_CSTOR_VOLUME_ID
      value: c3fcb553-bd9c-46ff-ac0a-a0dac1798bd1
    - name: RESYNC_INTERVAL
      value: "30"
    - name: NODE_NAME
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: spec.nodeName
    - name: POD_NAME
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.name
    - name: OPENEBS_NAMESPACE
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.namespace
    image: openebs/cstor-volume-manager:2.10.0
    imagePullPolicy: IfNotPresent
    name: cstor-volume-mgmt
    ports:
    - containerPort: 80
      protocol: TCP
    resources:
      limits:
        cpu: 500m
        memory: 128Mi
      requests:
        cpu: 250m
        memory: 64Mi
    securityContext:
      privileged: true
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /var/run
      name: sockfile
    - mountPath: /usr/local/etc/istgt
      name: conf
    - mountPath: /var/openebs/cstor-target
      name: storagepath
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: openebs-cstor-operator-token-mjfml
      readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  nodeName: test-pcl4006
  preemptionPolicy: PreemptLowerPriority
  priority: 0
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext: {}
  serviceAccount: openebs-cstor-operator
  serviceAccountName: openebs-cstor-operator
  terminationGracePeriodSeconds: 30
  tolerations:
  - effect: NoExecute
    key: node.alpha.kubernetes.io/notReady
    operator: Exists
    tolerationSeconds: 30
  - effect: NoExecute
    key: node.alpha.kubernetes.io/unreachable
    operator: Exists
    tolerationSeconds: 30
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
    tolerationSeconds: 30
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
    tolerationSeconds: 30
  volumes:
  - emptyDir: {}
    name: sockfile
  - emptyDir: {}
    name: conf
  - hostPath:
      path: /var/openebs/cstor-target/pvc-96532ea1-852e-4a1f-b5fd-35a4ad3f8adc
      type: DirectoryOrCreate
    name: storagepath
  - name: openebs-cstor-operator-token-mjfml
    secret:
      defaultMode: 420
      secretName: openebs-cstor-operator-token-mjfml
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2021-07-07T15:52:24Z"
    status: "True"
    type: Initialized
  - lastProbeTime: null
    lastTransitionTime: "2021-07-07T15:52:27Z"
    status: "True"
    type: Ready
  - lastProbeTime: null
    lastTransitionTime: "2021-07-07T15:52:27Z"
    status: "True"
    type: ContainersReady
  - lastProbeTime: null
    lastTransitionTime: "2021-07-07T15:52:24Z"
    status: "True"
    type: PodScheduled
  containerStatuses:
  - containerID: containerd://ed4fed5944edff047062f6423e1b02c011a57644520065a1a3ea5afe49e40315
    image: docker.io/openebs/cstor-istgt:2.10.0
    imageID: docker.io/openebs/cstor-istgt@sha256:4391bbd300d7729ef9cc37e76359c3e2790b0bffba3bba2f72de85f653d5171e
    lastState: {}
    name: cstor-istgt
    ready: true
    restartCount: 0
    started: true
    state:
      running:
        startedAt: "2021-07-07T15:52:25Z"
  - containerID: containerd://3eb68c7833cf96adbdd6b619ed61bc583736bd86eeeb04b71b98a5f049ad09e9
    image: docker.io/openebs/cstor-volume-manager:2.10.0
    imageID: docker.io/openebs/cstor-volume-manager@sha256:bb06918934d030fcd70f0c96dd708a29f8f634ff3279e801f0c873fcfddefcc1
    lastState:
      terminated:
        containerID: containerd://5995201eec92d366cac9e8a825656c52b8932454f2be1fd1ec6213d187e6406b
        exitCode: 255
        finishedAt: "2021-07-07T15:52:26Z"
        reason: Error
        startedAt: "2021-07-07T15:52:26Z"
    name: cstor-volume-mgmt
    ready: true
    restartCount: 1
    started: true
    state:
      running:
        startedAt: "2021-07-07T15:52:26Z"
  - containerID: containerd://afdd8f5bc2b4d4ce3914fffed6f0a314a6922f7952d5574d77b60a48cf390fcc
    image: docker.io/openebs/m-exporter:2.10.0
    imageID: docker.io/openebs/m-exporter@sha256:52ae352117ea92400c1aa660c33391e7be99019c45d8fda44474778bf3c29239
    lastState: {}
    name: maya-volume-exporter
    ready: true
    restartCount: 0
    started: true
    state:
      running:
        startedAt: "2021-07-07T15:52:25Z"
  hostIP: 10.1.34.6
  phase: Running
  podIP: 192.168.158.114
  podIPs:
  - ip: 192.168.158.114
  qosClass: Burstable
  startTime: "2021-07-07T15:52:24Z"

here a list of ports that are not in the pod

- name: cstor-grpc
    port: 7777
    protocol: TCP
    targetPort: 7777
  - name: mgmt
    port: 6060
    protocol: TCP
    targetPort: 6060

survivant avatar Jul 13 '21 15:07 survivant