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

feat: release KubePanel v1.0.0 #4401

Merged
merged 21 commits into from
Dec 13, 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
10 changes: 10 additions & 0 deletions frontend/plugins/kubepanel/deploy/Kubefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM scratch

USER 65532:65532

COPY manifests manifests

ENV cloudDomain="127.0.0.1.nip.io"
ENV cloudPort=""

CMD ["kubectl apply -f manifests"]
21 changes: 21 additions & 0 deletions frontend/plugins/kubepanel/deploy/menifests/appcr.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: app.sealos.io/v1
kind: App
metadata:
name: kubepanel
namespace: app-system
spec:
data:
desc: Kube Panel
url: "https://kubepanel.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}"
icon: "https://kubepanel.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}/logo.svg"
i18n:
zh:
name: 资源监控
zh-Hans:
name: 资源监控
menuData:
helpDropDown: false
nameColor: text-black
name: Kube Panel
type: iframe
displayType: normal
85 changes: 85 additions & 0 deletions frontend/plugins/kubepanel/deploy/menifests/deploy.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
app: kubepanel-frontend
name: kubepanel-frontend
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kubepanel-frontend-config
namespace: kubepanel-frontend
data:
config.yaml: |-
addr: :3000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: kubepanel-frontend
namespace: kubepanel-frontend
spec:
replicas: 1
selector:
matchLabels:
app: kubepanel-frontend
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
template:
metadata:
labels:
app: kubepanel-frontend
spec:
serviceAccountName: cluster-version-reader
containers:
- name: kubepanel-frontend
env:
- name: SEALOS_DOMAIN
value: {{ .cloudDomain }}
- name: SEALOS_PORT
value: "{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}"
securityContext:
runAsNonRoot: true
runAsUser: 1001
allowPrivilegeEscalation: false
capabilities:
drop:
- 'ALL'
resources:
limits:
cpu: 1000m
memory: 1024Mi
requests:
cpu: 10m
memory: 128Mi
# do not modify this image, it is used for CI/CD
image: ghcr.io/labring/sealos-kubepanel-frontend:latest
imagePullPolicy: Always
volumeMounts:
- name: kubepanel-frontend-volume
mountPath: /config.yaml
subPath: config.yaml
volumes:
- name: kubepanel-frontend-volume
configMap:
name: kubepanel-frontend-config
---
apiVersion: v1
kind: Service
metadata:
labels:
app: kubepanel-frontend
name: kubepanel-frontend
namespace: kubepanel-frontend
spec:
ports:
- name: http
port: 3000
protocol: TCP
targetPort: 3000
selector:
app: kubepanel-frontend
45 changes: 45 additions & 0 deletions frontend/plugins/kubepanel/deploy/menifests/ingress.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright © 2022 sealos.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/configuration-snippet: |
more_clear_headers "X-Frame-Options:";
more_set_headers "Content-Security-Policy: default-src * blob: data: *.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} {{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}; img-src * data: blob: resource: *.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} {{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}; connect-src * wss: blob: resource:; style-src 'self' 'unsafe-inline' blob: *.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} {{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} resource:; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: *.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} {{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} resource: *.baidu.com *.bdstatic.com; frame-src 'self' *.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} {{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} mailto: tel: weixin: mtt: *.baidu.com; frame-ancestors 'self' https://{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} https://*.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}";
more_set_headers "X-Xss-Protection: 1; mode=block";
higress.io/response-header-control-remove: X-Frame-Options
higress.io/response-header-control-update: |
Content-Security-Policy "default-src * blob: data: *.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} {{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}; img-src * data: blob: resource: *.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} {{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}; connect-src * wss: blob: resource:; style-src 'self' 'unsafe-inline' blob: *.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} {{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} resource:; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: *.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} {{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} resource: *.baidu.com *.bdstatic.com; frame-src 'self' *.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} {{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} mailto: tel: weixin: mtt: *.baidu.com; frame-ancestors 'self' https://{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }} https://*.{{ .cloudDomain }}{{ if .cloudPort }}:{{ .cloudPort }}{{ end }}"
X-Xss-Protection "1; mode=block"
name: kubepanel-frontend
namespace: kubepanel-frontend
spec:
rules:
- host: kubepanel.{{ .cloudDomain }}
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: kubepanel-frontend
port:
number: 3000
tls:
- hosts:
- kubepanel.{{ .cloudDomain }}
secretName: {{ .certSecretName }}
11 changes: 7 additions & 4 deletions frontend/plugins/kubepanel/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "kubepanel",
"version": "0.1.0",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"link-sdk": "rm -rf node_modules/sealos-desktop-sdk && yalc link sealos-desktop-sdk",
"unlink-sdk": "yalc remove --all && pnpm install sealos-desktop-sdk"
"link-sdk": "pnpm link sealos-desktop-sdk",
"unlink-sdk": "pnpm unlink sealos-desktop-sdk"
},
"dependencies": {
"@ant-design/charts": "^1.4.2",
Expand All @@ -21,10 +21,11 @@
"@emotion/styled": "^11.11.0",
"@kubernetes/client-node": "^0.19.0",
"@monaco-editor/react": "^4.6.0",
"@tanstack/react-query": "^4.29.25",
"antd": "^5.11.0",
"auto-bind": "^5.0.1",
"axios": "^1.5.1",
"byline": "^5.0.0",
"eventsource": "^2.0.2",
"framer-motion": "^10.16.4",
"fs": "0.0.1-security",
"immer": "^10.0.3",
Expand All @@ -47,6 +48,8 @@
"zustand-computed": "^1.3.7"
},
"devDependencies": {
"@types/byline": "^4.2.36",
"@types/eventsource": "^1.1.15",
"@types/js-yaml": "^4.0.8",
"@types/lodash": "^4.14.199",
"@types/node": "^20",
Expand Down
52 changes: 27 additions & 25 deletions frontend/plugins/kubepanel/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified frontend/plugins/kubepanel/public/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions frontend/plugins/kubepanel/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 0 additions & 14 deletions frontend/plugins/kubepanel/src/api/create.ts

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/plugins/kubepanel/src/api/delete.ts

This file was deleted.

Loading
Loading