<!DOCTYPE html>
<html lang="en-US">
<head>
  {{ template "head" .Data }}

  {{ if gt (len .Data.VpaData.Namespaces) 1 }} 
  <script src="static/js/filter.js" type="module"></script>
  {{ end }}

  {{- if opts.EnableCost }}
  <noscript>
    <style>
      #email-box, #api-token-box, #cost-settings-box {
        display:none;
      }
    </style>
  </noscript>

  <script>
    window.INSIGHTS_HOST = "{{ opts.InsightsHost }}"
  </script>

  <script defer src="static/js/email.js"></script>
  <script defer src="static/js/api-token.js"></script>
  <script defer src="static/js/cost_settings.js"></script>
  {{- end }}
</head>

<body class="layoutSidebar">
  <header class="layoutSidebar__sidebar">
    {{ template "navigation" . }}
  </header>

  <div class="layoutSidebar__main">
    <main class="verticalRhythm --rhythm-3">

      {{- if opts.EnableCost }}
      {{ template "email" . }}
      {{ template "api_token" . }}
      {{ template "cost_settings" . }}
      {{- end }}

      <h1>Namespace Details</h1>

      {{ if gt (len .Data.VpaData.Namespaces) 1 }}
        {{ template "filter" .Data.VpaData.Namespaces }}
      {{ end }}

      <div
        class="verticalRhythm --rhythm-3"
        {{ if gt (len .Data.VpaData.Namespaces) 1 }}
        aria-live="off"
        id="js-filter-container"
        {{ end }}
      >
        {{ range $nsName, $nsSummary := .Data.VpaData.Namespaces }}
          {{ template "namespace" $nsSummary }}
        {{end}}
      </div>

      <aside class="verticalRhythm" id="glossary">
        <h2>Glossary</h2>

        <dl>
          <div class="dl-entry">
            <dt id="qos">QoS</dt>
            <dd>
              <blockquote>
                "QoS (Quality of Service) class is a designation assigned to a pod based on its resource requests and limits. Kubernetes uses QoS classes to make decisions about scheduling and evicting Pods."

                <cite>
                  <a
                    class="--link-1"
                    href="https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod"
                    rel="noreferrer noopener"
                    target="_blank"
                  >
                    Kubernetes Documentation:
                    <br>Configure Quality of Service for Pods <i
                      aria-label="(Opens in new window)"
                      class="fas fa-fw fa-external-link-alt"
                    ></i>
                  </a>
                </cite>
              </blockquote>
            </dd>
          </div>

          <div class="dl-entry">
            <dt id="guaranteed-qos">Guaranteed QoS</dt>
            <dd>
              <blockquote>
                "For a Pod to be given a QoS class of Guaranteed:
                <ul>
                  <li>
                    Every Container, including init containers, in the Pod must have a memory limit and a memory request, and they must be the same.
                  </li>
                  <li>
                    Every Container, including init containers, in the Pod must have a CPU limit and a CPU request, and they must be the same."
                  </li>
                </ul>

                <cite>
                  <a
                    class="--link-1"
                    href="https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/#create-a-pod-that-gets-assigned-a-qos-class-of-guaranteed"
                    rel="noreferrer noopener"
                    target="_blank"
                  >
                    Kubernetes Documentation:
                    <br>Create a Pod That Gets Assigned a QoS Class of Guaranteed <i
                      aria-label="(Opens in new window)"
                      class="fas fa-fw fa-external-link-alt"
                    ></i>
                  </a>
                </cite>
              </blockquote>
            </dd>
          </div>

          <div class="dl-entry">
            <dt id="burstable-qos">Burstable QoS</dt>
            <dd>
              <blockquote>
                "A Pod is given a QoS class of Burstable if:
                <ul>
                  <li>
                    The Pod does not meet the criteria for QoS class Guaranteed.
                  </li>
                  <li>
                    At least one Container in the Pod has a memory or CPU request."
                  </li>
                </ul>

                <cite>
                  <a
                    class="--link-1"
                    href="https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/#create-a-pod-that-gets-assigned-a-qos-class-of-burstable"
                    rel="noreferrer noopener"
                    target="_blank"
                  >
                    Kubernetes Documentation:
                    <br>Create a Pod That Gets Assigned a QoS Class of Burstable <i
                      aria-label="(Opens in new window)"
                      class="fas fa-fw fa-external-link-alt"
                    ></i>
                  </a>
                </cite>
              </blockquote>
            </dd>
          </div>
        </dl>
      </aside>
    </main>

    <footer>
      {{ template "footer" . }}
    </footer>
  </div>
</body>
</html>
