-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add cluster-dev.yml for development and restore cluster.yml
- Loading branch information
Showing
2 changed files
with
204 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
# Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0 | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
|
||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: jifa | ||
labels: | ||
name: jifa | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
namespace: jifa | ||
name: jifa-service-account | ||
|
||
--- | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
namespace: jifa | ||
name: jifa-role | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods", "pods/exec"] | ||
verbs: ["get", "list", "delete", "patch", "create"] | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
namespace: jifa | ||
name: role-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: jifa-role | ||
subjects: | ||
- kind: ServiceAccount | ||
namespace: jifa | ||
name: jifa-service-account | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
namespace: jifa | ||
name: mysql-pvc | ||
spec: | ||
storageClassName: alibabacloud-cnfs-nas | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
namespace: jifa | ||
name: mysql-initdb-config | ||
data: | ||
initdb.sql: | | ||
CREATE DATABASE IF NOT EXISTS jifa; | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
namespace: jifa | ||
name: mysql | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: mysql | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: mysql | ||
spec: | ||
containers: | ||
- image: mysql:5.6 | ||
name: mysql | ||
env: | ||
- name: MYSQL_ROOT_PASSWORD | ||
value: password | ||
ports: | ||
- containerPort: 3306 | ||
name: mysql | ||
volumeMounts: | ||
- name: mysql-pv | ||
mountPath: /var/lib/mysql | ||
- name: mysql-initdb | ||
mountPath: /docker-entrypoint-initdb.d | ||
volumes: | ||
- name: mysql-pv | ||
persistentVolumeClaim: | ||
claimName: mysql-pvc | ||
- name: mysql-initdb | ||
configMap: | ||
name: mysql-initdb-config | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
namespace: jifa | ||
name: mysql-service | ||
spec: | ||
ports: | ||
- port: 3306 | ||
selector: | ||
app: mysql | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
namespace: jifa | ||
name: jifa-pvc | ||
spec: | ||
storageClassName: alibabacloud-cnfs-nas | ||
accessModes: | ||
- ReadWriteMany | ||
resources: | ||
requests: | ||
storage: 2Gi | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
namespace: jifa | ||
name: jifa-master | ||
labels: | ||
app: jifa-master | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: jifa-master | ||
template: | ||
metadata: | ||
labels: | ||
app: jifa-master | ||
spec: | ||
serviceAccountName: jifa-service-account | ||
containers: | ||
- name: main-container | ||
image: eclipsejifa/jifa:latest | ||
imagePullPolicy: Always | ||
volumeMounts: | ||
- name: jifa-pv | ||
mountPath: "/jifa-storage" | ||
env: | ||
- name: MYSQL_HOST | ||
value: mysql-service:3306 | ||
- name: MYSQL_DATABASE | ||
value: jifa | ||
- name: MYSQL_USER | ||
value: root | ||
- name: MYSQL_PASSWORD | ||
value: password | ||
args: | ||
- --jifa.role=master | ||
- --jifa.storage-pvc-name=jifa-pvc | ||
- --jifa.storage-path=/jifa-storage | ||
- --jifa.service-account-name=jifa-service-account | ||
- --jifa.elastic-worker-image=eclipsejifa/jifa:latest | ||
ports: | ||
- name: jifa-port | ||
containerPort: 8102 | ||
volumes: | ||
- name: jifa-pv | ||
persistentVolumeClaim: | ||
claimName: jifa-pvc | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
namespace: jifa | ||
name: jifa-service | ||
spec: | ||
selector: | ||
app: jifa-master | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: jifa-port | ||
type: LoadBalancer |
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