Skip to content

Commit

Permalink
Merge branch 'main' into helm-dashboard-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
undera committed Jul 21, 2023
2 parents e986e1e + 5b60263 commit bcff1e6
Show file tree
Hide file tree
Showing 14 changed files with 124 additions and 46 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down
43 changes: 43 additions & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,49 @@ It executes the test scripts or commands within the deployed application's envir
Running test hooks results
![Detail5](images/screenshot_test_results.png)

The Helm Dashboard provides basic information about your Helm releases, including revision number, deployment date, release message, cluster details, and deployment status.
![Detail6](images/screenshot_basic_info.png)

### Resource Tab

In the Resources tab of the Helm Dashboard, you can view the kind (type), name, status, and any associated messages for your Kubernetes resources.
![Detail7](images/screenshot_resource.png)

### Manifest Tab

Text: The Manifests tab displays the textual representation of the Kubernetes manifests associated with your Helm release. It provides the YAML or JSON configuration files that define the desired state of the resources deployed in your cluster.
![Detail8](images/screenshot_manifest_view.png)

Diff with Previous: The "Diff with Previous" feature allows you to compare the current version of the manifests with the previous version. It highlights the differences between the two versions, making it easier to identify the changes made in the deployment.
![Detail9](images/screenshot_manifest_diff_prev.png)

Diff with Specific: The "Diff with Specific" option enables you to compare the current version of the manifests with a specific past version. It allows you to select a particular revision and view the differences between that revision and the current one.
![Detail10](images/screenshot_manifest_diff_specific.png)

### Values Tab

Text: The Values tab displays the textual representation of the values file associated with your Helm chart. It shows the YAML or JSON file that contains the configuration values used during the deployment of the chart.
![Detail11](images/screenshot_values_view.png)

Diff: The "Diff" feature allows you to compare the current values with the previous values used in a previous deployment. It highlights any differences between the two versions, making it easier to identify changes made to the configuration.
![Detail12](images/screenshot_values_diff_prev.png)

### Text Tab

Text: The Notes tab displays any accompanying notes or documentation related to the Helm chart.
![Detail14](images/screenshot_notes_view.png)

Diff with previous: The "Diff" feature is not typically available in the Notes tab. This tab is primarily meant for viewing the static text-based notes associated with the chart and doesn't involve comparisons or tracking changes like in the Manifests or Values tabs.
![Detail15](images/screenshot_notes_diff_prev.png)

Diff with Specific Version: Similar to the previous point, the ability to view a diff with a specific version of the notes is not a standard feature in the Notes section of the Helm Dashboard. The Notes section usually presents the information for the specific version of the Helm chart that is currently deployed.
![Detail16](images/screenshot_notes_diff_specific_version.png)









Expand Down
4 changes: 3 additions & 1 deletion charts/helm-dashboard/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ metadata:
{{- end }}

---
{{- if .Values.serviceAccount.create -}}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand All @@ -24,6 +25,7 @@ rules:
{{- else }}
verbs: ["get", "list", "watch"]
{{- end }}
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -36,4 +38,4 @@ roleRef:
subjects:
- kind: ServiceAccount
namespace: {{ .Release.Namespace }}
name: {{ include "helm-dashboard.serviceAccountName" . }}
name: {{ include "helm-dashboard.serviceAccountName" . }}
Binary file added images/screenshot_basic_info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot_manifest_diff_prev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot_manifest_diff_specific.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot_manifest_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot_notes_diff_prev.png
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.
Binary file added images/screenshot_notes_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot_resource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot_values_diff_prev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot_values_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 74 additions & 45 deletions scripts/install_plugin.sh
Original file line number Diff line number Diff line change
@@ -1,53 +1,90 @@
#!/bin/sh -e

# Copied w/ love from the chartmuseum/helm-push :)
#!/bin/sh
set -e

[ ! -z "$HELM_DEBUG" ] && set -x


# Function to print error message and exit
error_exit() {
echo "$1" >&2
exit 1
}

# Function to validate command availability
validate_command() {
command -v "$1" >/dev/null 2>&1 || error_exit "Required command '$1' not found. Please install it."
}

# Function to detect the latest version from GitHub API
get_latest_version() {
local latest_version
latest_version="$(curl -s "${api_repo}" | grep -oE '"name": "v[^"]+' | cut -d 'v' -f 2)"
echo "$latest_version"
}

# Function to download and install the plugin
install_plugin() {
local plugin_version="$1"
local plugin_url="$2"
local plugin_filename="$3"
local plugin_directory="$4"

# Download the plugin archive
if validate_command "curl"; then
curl --fail -sSL "${plugin_url}" -o "${plugin_filename}"
elif validate_command "wget"; then
wget -q "${plugin_url}" -O "${plugin_filename}"
else
error_exit "Both 'curl' and 'wget' commands not found. Please install either one."
fi

# Extract and install the plugin
tar xzf "${plugin_filename}" -C "${plugin_directory}"
mv "${plugin_directory}/${name}" "bin/${name}" || mv "${plugin_directory}/${name}.exe" "bin/${name}"
}

# Main script
name="helm-dashboard"
repo="https://github.com/komodorio/${name}"
api_repo="https://api.github.com/repos/komodorio/${name}/releases/latest"
HELM_PUSH_PLUGIN_NO_INSTALL_HOOK="${HELM_PUSH_PLUGIN_NO_INSTALL_HOOK:-}"

if [ -n "${HELM_PUSH_PLUGIN_NO_INSTALL_HOOK}" ]; then
# Check if in development mode
if [ -n "$HELM_PUSH_PLUGIN_NO_INSTALL_HOOK" ]; then
echo "Development mode: not downloading versioned release."
exit 0
fi

version="$(curl -s ${api_repo} | grep '\"name\": "v.*\"' | cut -d 'v' -f 2 | cut -d '"' -f 1)"
echo Tried to autodetect latest version: $version
# Autodetect the latest version
version=$(get_latest_version)
echo "Tried to autodetect latest version: $version"
[ -z "$version" ] && {
version="$(cat plugin.yaml | grep "version" | cut -d '"' -f 2)"
echo Defaulted to version: $version
version="$(awk -F '"' '/version/ {print $2}' plugin.yaml)"
echo "Defaulted to version: $version"
}
echo "Downloading and installing ${name} v${version} ..."

url=""
echo "Downloading and installing ${name} v${version} ..."

# convert architecture of the target system to a compatible GOARCH value.
# Otherwise failes to download of the plugin from github, because the provided
# architecture by `uname -m` is not part of the github release.
arch=""
# Convert architecture of the target system to a compatible GOARCH value
case $(uname -m) in
x86_64)
arch="x86_64"
;;
armv6*)
arch="armv6"
;;
# match every arm processor version like armv7h, armv7l and so on.
armv7*)
arch="armv7"
;;
aarch64 | arm64)
arch="arm64"
;;
*)
echo "Failed to detect target architecture"
exit 1
;;
x86_64)
arch="x86_64"
;;
armv6*)
arch="armv6"
;;
armv7*)
arch="armv7"
;;
aarch64 | arm64)
arch="arm64"
;;
*)
error_exit "Failed to detect target architecture"
;;
esac


# Construct the plugin download URL
if [ "$(uname)" = "Darwin" ]; then
url="${repo}/releases/download/v${version}/${name}_${version}_Darwin_${arch}.tar.gz"
elif [ "$(uname)" = "Linux" ] ; then
Expand All @@ -56,22 +93,14 @@ else
url="${repo}/releases/download/v${version}/${name}_${version}_windows_${arch}.tar.gz"
fi

echo $url
echo "$url"

mkdir -p "bin"
mkdir -p "releases/v${version}"

# Download with curl if possible.
if [ -x "$(which curl 2>/dev/null)" ]; then
curl --fail -sSL "${url}" -o "releases/v${version}.tar.gz"
else
wget -q "${url}" -O "releases/v${version}.tar.gz"
fi
tar xzf "releases/v${version}.tar.gz" -C "releases/v${version}"
mv "releases/v${version}/${name}" "bin/${name}" || \
mv "releases/v${version}/${name}.exe" "bin/${name}"
install_plugin "$version" "$url" "releases/v${version}.tar.gz" "releases/v${version}"

echo
echo "Helm Dashboard is installed, to start it, run in your terminal:"
echo " helm dashboard"
echo
echo "Helm Dashboard is installed. To start it, run the following command:"
echo "helm dashboard"

0 comments on commit bcff1e6

Please sign in to comment.