Skip to content

Commit

Permalink
Fix/cloud init scripts (#4084)
Browse files Browse the repository at this point in the history
* fix incorrect colon display;
optimize:if avx is not supported, select the lower version of mongo;
check cluster ready, can skip;
fix costcenter app logo;
add metrics server;

* optimize

* add db metrics

* add cilium prompts

* add openebs-backup sc
  • Loading branch information
bxy4543 authored Oct 16, 2023
1 parent 17a0e3e commit 513162a
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 52 deletions.
13 changes: 13 additions & 0 deletions deploy/cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ sealos apply -f Clusterfile
Note: if you want to change pod cidr, please edit the `Clusterfile` before run `sealos apply`
### OpenEBS sc create
```shell
kubectl create -f - <<EOF
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-backup
provisioner: openebs.io/local
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
EOF
```
### Ingress-nginx setup
We use ingress-nginx to expose our services. You can install ingress-nginx by using sealos:
Expand Down
83 changes: 83 additions & 0 deletions deploy/cloud/manifests/db-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: database-monitor
name: database-monitor-config
namespace: sealos
data:
config.yml: |
server:
addr: ":9090"
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: database-monitor
name: database-monitor-deployment
namespace: sealos
spec:
replicas: 1
selector:
matchLabels:
app: database-monitor
strategy:
type: Recreate
template:
metadata:
labels:
app: database-monitor
spec:
containers:
- args:
- /config/config.yml
command:
- /manager
env:
- name: PROMETHEUS_SERVICE_HOST
value: http://kb-addon-prometheus-server.
image: ghcr.io/labring/sealos-cloud-database-monitor:latest
imagePullPolicy: Always
name: database-monitor
ports:
- containerPort: 9090
protocol: TCP
resources:
requests:
cpu: 1m
memory: 500M
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /config
name: config-vol
dnsPolicy: ClusterFirst
restartPolicy: Always
volumes:
- configMap:
defaultMode: 420
name: database-monitor-config
name: config-vol
---
apiVersion: v1
kind: Service
metadata:
labels:
app: database-monitor
name: database-monitor
namespace: sealos
spec:
ports:
- name: http
port: 9090
protocol: TCP
targetPort: 9090
selector:
app: database-monitor
3 changes: 3 additions & 0 deletions deploy/cloud/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ function prepare {
# apply notifications crd
kubectl apply -f manifests/notifications_crd.yaml

# apply kb database metrics
kubectl apply -f manifests/db-metrics.yaml

# gen mongodb uri
gen_mongodbUri

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
data:
desc: sealos CLoud costcenter
url: "https://costcenter.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}"
icon: "https://costcenter.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}/logo.png"
icon: "https://costcenter.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}/logo.svg"
i18n:
zh:
name: 费用中心
Expand Down
Loading

0 comments on commit 513162a

Please sign in to comment.