-
Notifications
You must be signed in to change notification settings - Fork 689
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deploy): Add standalone deployment yaml (#1218)
Signed-off-by: cegao <[email protected]>
- Loading branch information
Showing
2 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
# -------------------------------------------------- | ||
# - Single configuration deployment YAML for tf-operator | ||
# - Include: | ||
# CRD deployment | ||
# Namespace deployment | ||
# RBAC deployment | ||
# tf-operator container deployment set | ||
# -------------------------------------------------- | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: tfjobs.kubeflow.org | ||
spec: | ||
group: kubeflow.org | ||
scope: Namespaced | ||
names: | ||
kind: TFJob | ||
singular: tfjob | ||
plural: tfjobs | ||
versions: | ||
- name: v1 | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
validation: | ||
openAPIV3Schema: | ||
properties: | ||
spec: | ||
properties: | ||
tfReplicaSpecs: | ||
properties: | ||
# The validation works when the configuration contains | ||
# `Worker`, `PS` , `Chief` or `Evaluator`. Otherwise it will not be validated. | ||
Worker: | ||
properties: | ||
replicas: | ||
type: integer | ||
minimum: 1 | ||
PS: | ||
properties: | ||
replicas: | ||
type: integer | ||
minimum: 1 | ||
Chief: | ||
properties: | ||
replicas: | ||
type: integer | ||
minimum: 1 | ||
maximum: 1 | ||
Evaluator: | ||
properties: | ||
replicas: | ||
type: integer | ||
minimum: 0 | ||
maximum: 1 | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: tf-operator | ||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: tf-operator | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
- serviceaccounts | ||
- services | ||
- secrets | ||
- events | ||
- namespaces | ||
- persistentvolumes | ||
- persistentvolumeclaims | ||
verbs: | ||
- "*" | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- pods/log | ||
- pods/status | ||
verbs: | ||
- create | ||
- get | ||
- list | ||
- watch | ||
- delete | ||
- update | ||
- patch | ||
# This is needed for the launcher Role. | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods/exec | ||
verbs: | ||
- create | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- endpoints | ||
verbs: | ||
- create | ||
- get | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- patch | ||
- apiGroups: | ||
- rbac.authorization.k8s.io | ||
resources: | ||
- roles | ||
- rolebindings | ||
verbs: | ||
- create | ||
- list | ||
- watch | ||
- apiGroups: | ||
- policy | ||
resources: | ||
- poddisruptionbudgets | ||
verbs: | ||
- create | ||
- list | ||
- update | ||
- watch | ||
- apiGroups: | ||
- apiextensions.k8s.io | ||
resources: | ||
- customresourcedefinitions | ||
verbs: | ||
- create | ||
- get | ||
- apiGroups: | ||
- kubeflow.org | ||
resources: | ||
- tfjobs | ||
- tfjobs/status | ||
verbs: | ||
- "*" | ||
- apiGroups: | ||
- scheduling.incubator.k8s.io | ||
- scheduling.sigs.dev | ||
- scheduling.volcano.sh | ||
resources: | ||
- queues | ||
- podgroups | ||
verbs: | ||
- "*" | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: tf-operator | ||
namespace: tf-operator | ||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: tf-operator | ||
namespace: tf-operator | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: tf-operator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: tf-operator | ||
namespace: tf-operator | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tf-operator | ||
namespace: tf-operator | ||
labels: | ||
app: tf-operator | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: tf-operator | ||
template: | ||
metadata: | ||
labels: | ||
app: tf-operator | ||
spec: | ||
serviceAccountName: tf-operator | ||
containers: | ||
- name: tf-operator | ||
image: ghcr.io/kubeflow-incubator/tf-operator:latest | ||
imagePullPolicy: Always |