Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Manually deploy yaml for 1.28 k8s #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions charts/gravity-operator/deploy/admin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
apiVersion: v1
kind: Service
metadata:
name: gravity-operator-admin
labels:
app.kubernetes.io/name: gravity-operator-admin
helm.sh/chart: gravity-operator-0.3.0
app.kubernetes.io/instance: gravity-operator-admin
app.kubernetes.io/managed-by: Tiller
spec:
type: NodePort
ports:
- name: http
port: 80
targetPort: http
nodePort: 30066
selector:
app.kubernetes.io/name: gravity-operator-admin
app.kubernetes.io/instance: gravity-operator-admin
---
apiVersion: v1
kind: ConfigMap
metadata:
name: gravity-operator-admin
labels:
app.kubernetes.io/name: gravity-operator-admin
helm.sh/chart: gravity-operator-0.3.0
app.kubernetes.io/instance: gravity-operator-admin
app.kubernetes.io/managed-by: Tiller
data:
gravity.conf: |
tcp_nopush on;
tcp_nodelay on;
types_hash_max_size 2048;

gzip on;
gzip_min_length 1024;
gzip_buffers 4 8k;
gzip_types text/plain application/x-javascript text/css application/xml application/json;

server {
listen 80;
server_name localhost;

location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}

location /api/ {
proxy_pass http://gravity-operator:80/;
}

location /health {
access_log off;
return 200 "healthy";
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gravity-operator-admin
labels:
app.kubernetes.io/name: gravity-operator-admin
helm.sh/chart: gravity-operator-0.3.0
app.kubernetes.io/instance: gravity-operator-admin
app.kubernetes.io/managed-by: Tiller
spec:
selector:
matchLabels:
app.kubernetes.io/name: gravity-operator-admin
app.kubernetes.io/instance: gravity-operator-admin
strategy:
rollingUpdate:
maxUnavailable: 0
template:
metadata:
labels:
app.kubernetes.io/name: gravity-operator-admin
app.kubernetes.io/instance: gravity-operator-admin
spec:
restartPolicy: Always
volumes:
- name: ng-conf
configMap:
name: gravity-operator-admin
containers:
- name: admin
image: "moiot/gravity-admin:v0.2.0"
imagePullPolicy: IfNotPresent
volumeMounts:
- name: ng-conf
mountPath: /etc/nginx/conf.d
ports:
- name: http
containerPort: 80
protocol: TCP
readinessProbe:
httpGet:
path: /health
port: http
16 changes: 16 additions & 0 deletions charts/gravity-operator/deploy/cluster-co.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: gravity.mobike.io/v1alpha1
kind: Cluster
metadata:
name: gravity-operator-cluster
labels:
app.kubernetes.io/name: gravity-operator-cluster
helm.sh/chart: gravity-operator-0.3.0
app.kubernetes.io/instance: gravity-operator
app.kubernetes.io/managed-by: Tiller
spec:
rolling: "25%"
deploymentRules:
- group: "default"
pipelines: ["*"]
image: "moiot/gravity:v0.9.21"
command: ["/gravity", "-config=/etc/gravity/config.json"]
134 changes: 134 additions & 0 deletions charts/gravity-operator/deploy/crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
helm.sh/hook: crd-install

name: clusters.gravity.mobike.io

spec:
conversion:
strategy: None
group: gravity.mobike.io
names:
kind: Cluster
listKind: ClusterList
plural: clusters
singular: cluster
scope: Namespaced
versions:
Ryan-Git marked this conversation as resolved.
Show resolved Hide resolved
- additionalPrinterColumns:
- description: Total number of pipelines.
jsonPath: .status.pipelines
name: Total
type: integer
- description: Total number of pipelines which version match current deployment
rule.
jsonPath: .status.updatedPipelines
name: Updated
type: integer
- description: Total number of available pipelines (ready for at least minReadySeconds).
jsonPath: .status.availablePipelines
name: Available
type: integer
- description: Total number of unavailable pipelines.
jsonPath: .status.unavailablePipelines
name: Unavailable
type: integer
name: v1alpha1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
deploymentRules:
type: array
items:
type: object
properties:
command:
type: array
items:
type: string
group:
type: string
image:
type: string
pipelines:
type: array
items:
type: string
rolling:
type: string

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
helm.sh/hook: crd-install
generation: 1
name: pipelines.gravity.mobike.io

spec:
conversion:
strategy: None
group: gravity.mobike.io
names:
kind: Pipeline
listKind: PipelineList
plural: pipelines
singular: pipeline
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Position of the pipeline.
jsonPath: .status.position
name: Position
type: string
name: v1alpha1
served: true
storage: true
subresources:
status: {}
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
command:
type: array
items:
type: string
configHash:
type: string
image:
type: string
lastUpdate:
type: string
format: date-time
paused:
type: boolean
x-kubernetes-preserve-unknown-fields: true
status:
type: object
properties:
command:
type: array
items:
type: string
image:
type: string
podName:
type: string
position:
type: string
x-kubernetes-preserve-unknown-fields: true
65 changes: 65 additions & 0 deletions charts/gravity-operator/deploy/operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
apiVersion: v1
kind: Service
metadata:
name: gravity-operator
labels:
app.kubernetes.io/name: gravity-operator
helm.sh/chart: gravity-operator
app.kubernetes.io/instance: gravity-operator
app.kubernetes.io/managed-by: Tiller
spec:
type: ClusterIP
ports:
- name: http
port: 80
targetPort: http
selector:
app.kubernetes.io/name: gravity-operator
app.kubernetes.io/instance: gravity-operator

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gravity-operator
labels:
app.kubernetes.io/name: gravity-operator
helm.sh/chart: gravity-operator
app.kubernetes.io/instance: gravity-operator
app.kubernetes.io/managed-by: Tiller
spec:
minReadySeconds: 5
selector:
matchLabels:
app.kubernetes.io/name: gravity-operator
app.kubernetes.io/instance: gravity-operator
strategy:
type: Recreate
template:
metadata:
labels:
app.kubernetes.io/name: gravity-operator
app.kubernetes.io/instance: gravity-operator
spec:
serviceAccountName: gravity-operator
restartPolicy: Always
containers:
- name: operator
env:
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: MY_SERVICE_URI
value: http://gravity-operator:80
image: "moiot/gravity-operator:v0.3.0"
command: ["/gravity-operator"]
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8080
protocol: TCP
readinessProbe:
httpGet:
path: /metrics
port: http
40 changes: 40 additions & 0 deletions charts/gravity-operator/deploy/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: gravity-operator-role
rules:
- apiGroups: [""]
resources: ["configmaps", "pods", "services", "endpoints", "events"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

- apiGroups: ["apps"]
resources: ["statefulsets"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

- apiGroups: ["batch"]
resources: ["cronjobs", "jobs"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

- apiGroups: ["gravity.mobike.io"]
resources: ["*"]
verbs: ["*"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: gravity-operator-rolebinding
subjects:
- kind: ServiceAccount
name: gravity-operator
roleRef:
kind: Role
name: gravity-operator-role
apiGroup: rbac.authorization.k8s.io

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: gravity-operator