intellij-kubernetes icon indicating copy to clipboard operation
intellij-kubernetes copied to clipboard

As a user I'd like help with references in a multi-doc file

Open adietish opened this issue 2 years ago • 5 comments

If you have multi-resource document, you may be resources reference each other within that document. As a user I'd like to have an easy way to jump from the referee to the referencing component and vice-versa. The jetbrains plugin displays clickable markers to labels (on the left ruler) but it doesnt work for me/I'm unsure how this works). I'd like to implement those as InlayHint.

ex. in the following multi-resource file that was generated by quarkus, there's a service that's referencing a pod (Service->Deployment, Ingress->Service)

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    app.quarkus.io/build-timestamp: 2023-07-14 - 15:53:39 +0000
  labels:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.kubernetes.io/managed-by: quarkus
  name: openshift-quickstart
spec:
  ports:
    - name: http
      port: 80
      protocol: TCP
      targetPort: 8080
    - name: https
      port: 443
      protocol: TCP
      targetPort: 8443
  selector:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    app.quarkus.io/build-timestamp: 2023-07-14 - 15:53:39 +0000
  labels:
    app.kubernetes.io/managed-by: quarkus
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.kubernetes.io/name: openshift-quickstart
  name: openshift-quickstart
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/version: 1.0.0-SNAPSHOT
      app.kubernetes.io/name: openshift-quickstart
  template:
    metadata:
      annotations:
        app.quarkus.io/build-timestamp: 2023-07-14 - 15:53:39 +0000
      labels:
        app.kubernetes.io/managed-by: quarkus
        app.kubernetes.io/version: 1.0.0-SNAPSHOT
        app.kubernetes.io/name: openshift-quickstart
    spec:
      containers:
        - env:
            - name: KUBERNETES_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          image: adietish/openshift-quickstart:1.0.0-SNAPSHOT
          imagePullPolicy: Always
          name: openshift-quickstart
          ports:
            - containerPort: 8080
              name: http
              protocol: TCP
            - containerPort: 8443
              name: https
              protocol: TCP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    app.quarkus.io/build-timestamp: 2023-07-14 - 15:53:39 +0000
  labels:
    app.kubernetes.io/name: openshift-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
    app.kubernetes.io/managed-by: quarkus
  name: openshift-quickstart
spec:
  rules:
    - http:
        paths:
          - backend:
              service:
                name: openshift-quickstart
                port:
                  name: http
            path: /
            pathType: Prefix

adietish avatar Jul 24 '23 13:07 adietish