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

Fix/cloud init scripts #4084

Merged
merged 5 commits into from
Oct 16, 2023
Merged
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
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
Loading