Skip to content

Commit

Permalink
Merge pull request #717 from yuleichun-striving/main
Browse files Browse the repository at this point in the history
add some codes for kosmos helm
  • Loading branch information
duanmengkk committed Sep 22, 2024
2 parents d2c16e1 + 9b09586 commit 819fd1c
Show file tree
Hide file tree
Showing 11 changed files with 1,206 additions and 0 deletions.
29 changes: 29 additions & 0 deletions charts/kosmos/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v2
name: kosmos-charts
description: A Helm chart for Kosmos

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# The optional kubeVersion field can define semver constraints on supported Kubernetes versions.
# Helm will validate the version constraints when installing the chart and fail if the cluster
# runs an unsupported Kubernetes version.
kubeVersion: ">= 1.16.0-0"

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: latest
35 changes: 35 additions & 0 deletions charts/kosmos/templates/01-serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: clustertree
namespace: {{ .Values.global.namespace }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kosmos-operator
namespace: {{ .Values.global.namespace }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kosmos-scheduler
namespace: {{ .Values.global.namespace }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: clusterlink-controller-manager
namespace: {{ .Values.global.namespace }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: clusterlink-elector
namespace: {{ .Values.global.namespace }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: clusterlink-network-manager
namespace: {{ .Values.global.namespace }}
234 changes: 234 additions & 0 deletions charts/kosmos/templates/02-clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: clustertree
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kosmos-scheduler
rules:
- verbs:
- get
- list
- watch
apiGroups:
- kosmos.io
resources:
- '*'
- verbs:
- create
- patch
- update
apiGroups:
- ''
- events.k8s.io
resources:
- events
- verbs:
- create
apiGroups:
- coordination.k8s.io
resources:
- leases
- verbs:
- get
- update
apiGroups:
- coordination.k8s.io
resources:
- leases
resourceNames:
- kosmos-scheduler
- verbs:
- create
apiGroups:
- ''
resources:
- endpoints
- verbs:
- get
- update
apiGroups:
- ''
resources:
- endpoints
- verbs:
- get
- list
- watch
apiGroups:
- ''
resources:
- nodes
- verbs:
- delete
- get
- list
- watch
apiGroups:
- ''
resources:
- pods
- verbs:
- create
apiGroups:
- ''
resources:
- bindings
- pods/binding
- verbs:
- patch
- update
apiGroups:
- ''
resources:
- pods/status
- verbs:
- get
- list
- watch
apiGroups:
- ''
resources:
- replicationcontrollers
- services
- verbs:
- get
- list
- watch
apiGroups:
- apps
- extensions
resources:
- replicasets
- verbs:
- get
- list
- watch
apiGroups:
- apps
resources:
- statefulsets
- verbs:
- get
- list
- watch
apiGroups:
- policy
resources:
- poddisruptionbudgets
- verbs:
- get
- list
- watch
- update
apiGroups:
- ''
resources:
- persistentvolumeclaims
- persistentvolumes
- verbs:
- create
apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
- verbs:
- create
apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
- verbs:
- get
- list
- watch
apiGroups:
- storage.k8s.io
resources:
- '*'
- verbs:
- get
- list
- watch
apiGroups:
- ''
resources:
- configmaps
- namespaces
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kosmos
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: clusterlink-controller-manager
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: clusterlink-elector
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: clusterlink-network-manager
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- get
83 changes: 83 additions & 0 deletions charts/kosmos/templates/03-clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: clustertree
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: clustertree
subjects:
- kind: ServiceAccount
name: clustertree
namespace: {{ .Values.global.namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kosmos-scheduler
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kosmos-scheduler
subjects:
- kind: ServiceAccount
name: kosmos-scheduler
namespace: {{ .Values.global.namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kosmos
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kosmos
subjects:
- kind: ServiceAccount
name: kosmos-control
namespace: {{ .Values.global.namespace }}
- kind: ServiceAccount
name: clusterlink-controller-manager
namespace: kosmos-system
- kind: ServiceAccount
name: kosmos-operator
namespace: {{ .Values.global.namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: clusterlink-controller-manager
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: clusterlink-controller-manager
subjects:
- kind: ServiceAccount
name: clusterlink-controller-manager
namespace: {{ .Values.global.namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: clusterlink-elector
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: clusterlink-elector
subjects:
- kind: ServiceAccount
name: clusterlink-elector
namespace: {{ .Values.global.namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: clusterlink-network-manager
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: clusterlink-network-manager
subjects:
- kind: ServiceAccount
name: clusterlink-network-manager
namespace: {{ .Values.global.namespace }}
Loading

0 comments on commit 819fd1c

Please sign in to comment.