Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.3 kB
5
Indexable
Never
Creat following services
--------------------------------------------------------------------
apiVersion: v1
kind: Service
metadata:
  name: topolvm-cluster-metric
  labels:
    app.kubernetes.io/compose: metrics
spec:
  selector:
    name: topolvm-operator
  ports:
    - name: metrics
      protocol: TCP
      port: 8080
      targetPort: 8080



apiVersion: v1
kind: Service
metadata:
  name: topolvm-node
  labels:
    app.kubernetes.io/compose: metrics
spec:
  selector:
    app.kubernetes.io/compose: node
  ports:
    - name: metrics
      protocol: TCP
      port: 8080
      targetPort: 8080


Create following roles
--------------------------------------------------------------------------------
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: prometheus-k8s
  namespace: odf-topolvm
rules:
  - verbs:
      - get
      - list
      - watch
    apiGroups:
      - ''
    resources:
      - services
      - endpoints
      - pods



kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: prometheus-k8s
  namespace: odf-topolvm
subjects:
  - kind: ServiceAccount
    name: prometheus-k8s
    namespace: openshift-monitoring
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: prometheus-k8s