-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from chxk/feat-bagua
add deploy operator
- Loading branch information
Showing
6 changed files
with
147 additions
and
2 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
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,69 @@ | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.4.1 | ||
creationTimestamp: null | ||
name: baguas.bagua.kuaishou.com | ||
spec: | ||
additionalPrinterColumns: | ||
- JSONPath: .metadata.namespace | ||
name: Namespace | ||
type: string | ||
- JSONPath: .status.phase | ||
name: Phase | ||
type: string | ||
- JSONPath: .metadata.creationTimestamp | ||
name: Age | ||
type: date | ||
group: bagua.kuaishou.com | ||
names: | ||
kind: Bagua | ||
listKind: BaguaList | ||
plural: baguas | ||
shortNames: | ||
- bg | ||
singular: bagua | ||
scope: Namespaced | ||
subresources: | ||
status: {} | ||
validation: | ||
openAPIV3Schema: | ||
description: Bagua is the Schema for the baguas API | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: 'BaguaSpec defines the desired state | ||
of Bagua' | ||
properties: | ||
enableElastic: | ||
type: boolean | ||
maxReplicas: | ||
format: int32 | ||
type: integer | ||
minReplicas: | ||
format: int32 | ||
minimum: 1 | ||
type: integer | ||
rdzvEndpoint: | ||
type: string | ||
type: object | ||
type: object | ||
version: v1alpha1 | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true |
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,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
app: bagua | ||
name: bagua |
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,18 @@ | ||
#!/bin/bash | ||
DIR=$( | ||
cd "$(dirname "$0")" | ||
pwd | ||
) | ||
|
||
function install() { | ||
for file in $(ls $DIR/crd); do | ||
kubectl apply -f $DIR/crd/$file | ||
done | ||
} | ||
|
||
function deploy() { | ||
install | ||
kubectl apply -f $DIR/deployment.yaml | ||
} | ||
|
||
deploy |
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,43 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
namespace: bagua | ||
name: bagua-operator | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: bagua-operator | ||
strategy: | ||
type: Recreate | ||
rollingUpdate: null | ||
template: | ||
metadata: | ||
labels: | ||
app: bagua-operator | ||
spec: | ||
containers: | ||
- name: ares-operator | ||
image: baguasys/operator:latest | ||
imagePullPolicy: "IfNotPresent" | ||
workingDir: /home/work | ||
command: | ||
- ./manager | ||
ports: | ||
- name: http | ||
containerPort: 8081 | ||
protocol: TCP | ||
readinessProbe: | ||
httpGet: | ||
path: | ||
/readyz | ||
port: http | ||
initialDelaySeconds: 15 | ||
periodSeconds: 10 | ||
livenessProbe: | ||
httpGet: | ||
path: | ||
/healthz | ||
port: http | ||
initialDelaySeconds: 15 | ||
periodSeconds: 10 |