-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
339 additions
and
18 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,43 @@ | ||
name: Push Images | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
images: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.23.1 | ||
- name: Build Go code for amd64 | ||
run: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o app-tool-amd64 main.go | ||
- name: Build Go code for arm64 | ||
run: GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o app-tool-arm64 main.go | ||
- name: Debug docker | ||
run: echo ${{ secrets.DOCKER_USERNAME }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: kubesphere/app-tool:${{ github.ref_name }} |
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,3 @@ | ||
FROM kubesphere/kubectl:v1.27.4 | ||
ARG TARGETARCH | ||
COPY app-tool-${TARGETARCH} /usr/local/bin/app-tool |
Empty file.
Empty file.
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,2 @@ | ||
|
||
|
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,26 @@ | ||
# 商店导入工具 | ||
|
||
## 概述 | ||
|
||
本工具用于把 helm repo 中的软件同步到应用商店中。注意, 您可以在 kubespehre 直接配置repo源使用, 参考文档 | ||
|
||
https://ask.kubesphere.io/forum/d/23922-kubesphere-411-ying-yong-shang-dian-pei-zhi-fang-fa | ||
|
||
这个工具是把 repo 中的应用变成全局商店应用, 不是必须的操作。 | ||
|
||
## 使用方法 | ||
|
||
配置安装参数, 指定要同步的源 | ||
|
||
```bash | ||
app-tool: | ||
repoUrl: "https://charts.kubesphere.io/stable" | ||
``` | ||
|
||
## 注意事项 | ||
|
||
由于商店允许多次上传并生成随机名称的应用,本工具不会处理多次执行的场景。如果您多次执行,希望清理生成的资源,请手动执行 | ||
|
||
``` | ||
kubectl delete applications.application.kubesphere.io xxx | ||
``` |
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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,6 @@ | ||
apiVersion: v2 | ||
appVersion: 1.16.0 | ||
description: A Helm chart for Kubernetes | ||
name: app-tool | ||
type: application | ||
version: 0.1.0 |
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,23 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: app-tool-job | ||
namespace: extension-app-tool | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
kubesphere.io/serviceaccount-name: app-tool | ||
spec: | ||
serviceAccountName: app-tool-k8s | ||
containers: | ||
- name: app-tool-job | ||
image: kubesphere/app-tool:1.0.0 | ||
args: | ||
- /bin/sh | ||
- -c | ||
- | | ||
app-tool --repo={{ .Values.repoUrl }} --server=http://ks-console.kubesphere-system | ||
restartPolicy: Never | ||
backoffLimit: 0 |
25 changes: 25 additions & 0 deletions
25
extensions/app-tool/charts/app-tool/templates/post-install-job.yaml
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,25 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: post-install-job | ||
namespace: extension-app-tool | ||
annotations: | ||
"helm.sh/hook": post-install | ||
"helm.sh/hook-delete-policy": hook-succeeded,hook-failed | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: post-install-job | ||
image: kubesphere/kubectl:v1.27.4 | ||
command: | ||
- /bin/sh | ||
- -c | ||
- | | ||
kubectl delete serviceaccounts.kubesphere.io app-tool -n extension-app-tool | ||
kubectl delete globalrolebindings.iam.kubesphere.io app-tool-platform-admin | ||
kubectl delete clusterroles.rbac.authorization.k8s.io app-tool-k8s-cluster-role | ||
kubectl delete clusterrolebindings.rbac.authorization.k8s.io app-tool-k8s | ||
kubectl delete serviceaccounts app-tool-k8s -n extension-app-tool | ||
restartPolicy: Never | ||
backoffLimit: 0 |
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,41 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: app-tool-k8s-cluster-role | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
- secrets | ||
verbs: | ||
- '*' | ||
- apiGroups: | ||
- "application.kubesphere.io" | ||
resources: | ||
- "*" | ||
verbs: | ||
- "*" | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: app-tool-k8s | ||
namespace: extension-app-tool | ||
subjects: | ||
- kind: ServiceAccount | ||
name: app-tool-k8s | ||
namespace: extension-app-tool | ||
roleRef: | ||
kind: ClusterRole | ||
name: app-tool-k8s-cluster-role | ||
apiGroup: rbac.authorization.k8s.io | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: app-tool-k8s | ||
namespace: extension-app-tool |
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,22 @@ | ||
apiVersion: kubesphere.io/v1alpha1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: app-tool | ||
namespace: extension-app-tool | ||
--- | ||
apiVersion: iam.kubesphere.io/v1beta1 | ||
kind: GlobalRoleBinding | ||
metadata: | ||
labels: | ||
iam.kubesphere.io/role-ref: platform-admin | ||
name: app-tool-platform-admin | ||
roleRef: | ||
apiGroup: iam.kubesphere.io | ||
kind: GlobalRole | ||
name: platform-admin | ||
subjects: | ||
- apiGroup: kubesphere.io | ||
kind: ServiceAccount | ||
name: app-tool | ||
namespace: extension-app-tool | ||
|
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 @@ | ||
repoUrl: "https://charts.kubesphere.io/stable" |
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,33 @@ | ||
apiVersion: kubesphere.io/v1alpha1 | ||
name: app-tool | ||
version: 0.1.0 | ||
displayName: | ||
zh: 应用商店同步工具 | ||
en: App store sync tool | ||
description: | ||
zh: 应用商店同步工具 | ||
en: App store sync tool | ||
home: https://kubesphere.io | ||
sources: | ||
- https://github.com/kubesphere | ||
kubeVersion: ">=1.19.0-0" | ||
ksVersion: ">=4.1.1-0" | ||
category: dev-tools | ||
keywords: | ||
- dev-tools | ||
provider: | ||
zh: | ||
name: "kubesphere" | ||
email: "" | ||
url: "" | ||
en: | ||
name: "kubesphere" | ||
email: "" | ||
url: "" | ||
icon: ./static/favicon.svg | ||
installationMode: HostOnly | ||
externalDependencies: | ||
- name: openpitrix | ||
type: extension | ||
version: '>= 1.0.0-0' | ||
required: true |
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,55 @@ | ||
kind: ClusterRole | ||
rules: | ||
- verbs: | ||
- '*' | ||
apiGroups: | ||
- 'extensions.kubesphere.io' | ||
- 'jsbundles.extensions.kubesphere.io' | ||
resources: | ||
- '*' | ||
- verbs: | ||
- '*' | ||
apiGroups: | ||
- '' | ||
resources: | ||
- 'configmaps' | ||
- 'secrets' | ||
- verbs: | ||
- '*' | ||
apiGroups: | ||
- 'rbac.authorization.k8s.io' | ||
resources: | ||
- 'clusterroles' | ||
- verbs: | ||
- '*' | ||
apiGroups: | ||
- '*' | ||
resources: | ||
- '*' | ||
|
||
--- | ||
kind: Role | ||
rules: | ||
- verbs: | ||
- '*' | ||
apiGroups: | ||
- '' | ||
- 'apps' | ||
- 'batch' | ||
- 'app.k8s.io' | ||
- 'autoscaling' | ||
resources: | ||
- '*' | ||
- verbs: | ||
- '*' | ||
apiGroups: | ||
- 'networking.k8s.io' | ||
resources: | ||
- 'ingresses' | ||
- 'networkpolicies' | ||
- verbs: | ||
- '*' | ||
apiGroups: | ||
- '*' | ||
resources: | ||
- '*' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,3 @@ | ||
app-tool: | ||
repoUrl: "https://charts.kubesphere.io/stable" | ||
|
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
Oops, something went wrong.