Commit 5a11a2fa authored by Daishan's avatar Daishan
Browse files

Fix kiali graph

parent c8153ba4
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -71,6 +71,9 @@ spec:
          mountPath: "/kiali-cert"
          mountPath: "/kiali-cert"
        - name: kiali-secret
        - name: kiali-secret
          mountPath: "/kiali-secret"
          mountPath: "/kiali-secret"
        - name: kiali-console
          subPath: env.js
          mountPath: /opt/kiali/console/env.js
        resources:
        resources:
{{- if .Values.resources }}
{{- if .Values.resources }}
{{ toYaml .Values.resources | indent 10 }}
{{ toYaml .Values.resources | indent 10 }}
@@ -78,6 +81,12 @@ spec:
{{ toYaml .Values.global.defaultResources | indent 10 }}
{{ toYaml .Values.global.defaultResources | indent 10 }}
{{- end }}
{{- end }}
      volumes:
      volumes:
      - name: kiali-console
        configMap:
          name: kiali-console
          items:
          - key: env.js
            path: env.js
      - name: kiali-configuration
      - name: kiali-configuration
        configMap:
        configMap:
          name: kiali
          name: kiali
+13 −0
Original line number Original line Diff line number Diff line
apiVersion: v1
kind: ConfigMap
metadata:
  name: kiali-console
  namespace: {{ .Release.Namespace }}
  labels:
    app: {{ template "kiali.name" . }}
    chart: {{ template "kiali.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
data:
  env.js: |
    window.WEB_ROOT='/k8s/clusters/{{ .Values.global.rancher.clusterId }}/api/v1/namespaces/istio-system/services/http:kiali:20001/proxy';
 No newline at end of file
+112 −0
Original line number Original line Diff line number Diff line
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kiali
  namespace: {{ .Release.Namespace }}
  labels:
    app: {{ template "kiali.name" . }}
    chart: {{ template "kiali.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app: kiali
  template:
    metadata:
      name: kiali
      labels:
        app: kiali
        chart: {{ template "kiali.chart" . }}
        heritage: {{ .Release.Service }}
        release: {{ .Release.Name }}
      annotations:
        sidecar.istio.io/inject: "false"
        scheduler.alpha.kubernetes.io/critical-pod: ""
        prometheus.io/scrape: "true"
        prometheus.io/port: "9090"
        kiali.io/runtimes: go,kiali
        {{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | indent 8 }}
        {{- end }}
    spec:
      serviceAccountName: kiali-service-account
{{- if .Values.global.priorityClassName }}
      priorityClassName: "{{ .Values.global.priorityClassName }}"
{{- end }}
      containers:
      - image: "{{ .Values.hub }}/{{ .Values.image }}:{{ .Values.tag }}"
        imagePullPolicy: {{ .Values.global.imagePullPolicy }}
        name: kiali
        command:
        - "/opt/kiali/kiali"
        - "-config"
        - "/kiali-configuration/config.yaml"
        - "-v"
        - "3"
        readinessProbe:
          httpGet:
            path: {{ .Values.contextPath }}/healthz
            port: 20001
            scheme:  {{ if .Values.security.enabled }} 'HTTPS' {{ else }} 'HTTP' {{ end }}
          initialDelaySeconds: 5
          periodSeconds: 30
        livenessProbe:
          httpGet:
            path: {{ .Values.contextPath }}/healthz
            port: 20001
            scheme:  {{ if .Values.security.enabled }} 'HTTPS' {{ else }} 'HTTP' {{ end }}
          initialDelaySeconds: 5
          periodSeconds: 30
        env:
        - name: ACTIVE_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        volumeMounts:
        - name: kiali-configuration
          mountPath: "/kiali-configuration"
        - name: kiali-cert
          mountPath: "/kiali-cert"
        - name: kiali-secret
          mountPath: "/kiali-secret"
        - name: kiali-console
          subPath: env.js
          mountPath: /opt/kiali/console/env.js
        resources:
{{- if .Values.resources }}
{{ toYaml .Values.resources | indent 10 }}
{{- else }}
{{ toYaml .Values.global.defaultResources | indent 10 }}
{{- end }}
      volumes:
      - name: kiali-console
        configMap:
          name: kiali-console
          items:
          - key: env.js
            path: env.js
      - name: kiali-configuration
        configMap:
          name: kiali
      - name: kiali-cert
        secret:
          secretName: istio.kiali-service-account
{{- if not .Values.security.enabled }}
          optional: true
{{- end }}
      - name: kiali-secret
        secret:
          secretName: {{ .Values.dashboard.secretName }}
          optional: true
      affinity:
      {{- include "nodeaffinity" . | indent 6 }}
      {{- include "podAntiAffinity" . | indent 6 }}
      {{- if .Values.tolerations }}
      tolerations:
{{ toYaml .Values.tolerations | indent 6 }}
      {{- else if .Values.global.defaultTolerations }}
      tolerations:
{{ toYaml .Values.global.defaultTolerations | indent 6 }}
      {{- end }}
+13 −0
Original line number Original line Diff line number Diff line
apiVersion: v1
kind: ConfigMap
metadata:
  name: kiali-console
  namespace: {{ .Release.Namespace }}
  labels:
    app: {{ template "kiali.name" . }}
    chart: {{ template "kiali.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
data:
  env.js: |
    window.WEB_ROOT='/k8s/clusters/{{ .Values.global.rancher.clusterId }}/api/v1/namespaces/istio-system/services/http:kiali:20001/proxy';
 No newline at end of file
+4 −0
Original line number Original line Diff line number Diff line
@@ -55,6 +55,10 @@ EOF
# Replace the name of the chart
# Replace the name of the chart
sed -i 's/name: istio/name: rancher-istio/g' charts/rancher-istio/${1}/Chart.yaml
sed -i 's/name: istio/name: rancher-istio/g' charts/rancher-istio/${1}/Chart.yaml


# Update kiali
cp ./scripts/istio/deployment.yaml charts/rancher-istio/${1}/charts/kiali/templates/
cp ./scripts/istio/kiali-console-configmap.yaml charts/rancher-istio/${1}/charts/kiali/templates/

# Replace istio kubectl images
# Replace istio kubectl images
sed -i 's/"{{ .Values.global.hub }}\/kubectl:{{ .Values.global.tag }}"/"{{ .Values.global.hub }}\/istio-kubectl:{{ .Values.global.tag }}"/g' charts/rancher-istio/${1}/charts/security/templates/*.yaml
sed -i 's/"{{ .Values.global.hub }}\/kubectl:{{ .Values.global.tag }}"/"{{ .Values.global.hub }}\/istio-kubectl:{{ .Values.global.tag }}"/g' charts/rancher-istio/${1}/charts/security/templates/*.yaml