# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. apiVersion: v1 kind: ServiceAccount metadata: name: ix-exporter namespace: "kube-system" --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: ix-exporter rules: - apiGroups: - "" resources: - pods - nodes verbs: - get - list - watch --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: ix-exporter roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: ix-exporter subjects: - kind: ServiceAccount name: ix-exporter namespace: "kube-system" --- apiVersion: apps/v1 kind: DaemonSet metadata: name: "ix-exporter" namespace: "kube-system" labels: app.kubernetes.io/name: "ix-exporter" spec: updateStrategy: type: RollingUpdate selector: matchLabels: app.kubernetes.io/name: "ix-exporter" template: metadata: labels: app.kubernetes.io/name: "ix-exporter" name: "ix-exporter" spec: tolerations: - key: CriticalAddonsOnly operator: Exists priorityClassName: system-node-critical serviceAccountName: ix-exporter containers: - image: iluvatarcorex/ix-exporter:4.2.1-x86_64 name: "ix-exporter" args: - --log-level=4 - --enable-kubernetes=true - --ip=0.0.0.0 securityContext: privileged: true runAsNonRoot: false runAsUser: 0 env: - name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName volumeMounts: - name: pod-resources readOnly: true mountPath: "/var/lib/kubelet/pod-resources" - name: host-proc mountPath: /host-proc readOnly: true mountPropagation: HostToContainer - name: host-time mountPath: /etc/localtime readOnly: true - name: tmp-dir mountPath: "/tmp" readOnly: false volumes: - name: host-proc hostPath: path: "/proc" - name: pod-resources hostPath: path: "/var/lib/kubelet/pod-resources" - name: host-time hostPath: path: /etc/localtime - name: tmp-dir hostPath: path: "/tmp/iluvatar" --- kind: Service apiVersion: v1 metadata: name: "ix-exporter" namespace: "kube-system" labels: app.kubernetes.io/name: "ix-exporter" spec: selector: app.kubernetes.io/name: "ix-exporter" type: NodePort ports: - name: "metrics" port: 32021 targetPort: 32021 nodePort: 32021