Skip to content

Commit

Permalink
Merge pull request #1 from doitintl/helm-1.0.0
Browse files Browse the repository at this point in the history
doit-eks-lens helm chart version 1.0.0
  • Loading branch information
Chimbu-DoiT authored Feb 21, 2024
2 parents 7b7788f + a04968d commit 7ea6212
Show file tree
Hide file tree
Showing 8 changed files with 849 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release Charts

on:
push:
branches:
- main

jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
67 changes: 66 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,66 @@
# doit-eks-metrics-helm-chart
# doit-eks-lens-helm-chart

Repository contains the helm chart templates to install the components required for [EKS Lens](#https://help.doit.com/docs/dashboards/eks-lens).

## Usage

[Helm](https://helm.sh) must be installed to use the charts. Please refer to Helm's [documentation](https://helm.sh/docs) to get started.

Once Helm has been set up correctly, add the repo as follows:

helm repo add doit-eks-lens https://doitintl.github.io/doit-eks-lens-helm-chart/

If you had already added this repo earlier, run `helm repo update` to retrieve the latest versions of the packages.You can then run `helm search repo doit-eks-lens` to see the charts.

To generate templates:

helm template doit-eks-lens-helm-chart/doit-eks-lens

To install the doit-eks-lens chart with its own kube-state-metrics deployment:

helm upgrade -install doit-eks-lens doit-eks-lens-helm-chart/doit-eks-lens --set region=<EKS-CLUSTER-REGION> \
--set metricsDeploymentId=<DEPLOYMENT-ID> \
--set s3_bucket=<S3-BUCKET-NAME> \
--set s3_prefix=<S3-BUCKET-PREFIX> \
--set role_arn=<IAM-ROLE-ARN> \
--namespace doit-eks-metrics \
--create-namespace

Example:

helm upgrade -install doit-eks-lens doit-eks-lens-helm-chart/doit-eks-lens --set region=us-east-1 \
--set metricsDeploymentId=2Dw7oXwSkgjwjsXGcSMr \
--set s3_bucket=doitintl-eks-metrics-410386763839-us-east-1 \
--set s3_prefix=eks-metrics/410386763839/us-east-1/public \
--set role_arn=arn:aws:iam::410386763839:role/doit_eks_us-east-1_public \
--namespace doit-eks-metrics \
--create-namespace

To install the doit-eks-lens chart without kube-state-metrics deployment and use an existing kube-state-metrics in the cluster:

helm upgrade -install doit-eks-lens doit-eks-lens-helm-chart/doit-eks-lens --set region=<EKS-CLUSTER-REGION> \
--set metricsDeploymentId=<DEPLOYMENT-ID> \
--set s3_bucket=<S3-BUCKET-NAME> \
--set s3_prefix=<S3-BUCKET-PREFIX> \
--set role_arn=<IAM-ROLE-ARN> \
--set kubeStateMetrics.install=false \
--set collector.otelcol.kubeStateMetrics.endpoint=<KUBE-STATE-METRICS-SERVICE-NAME:PORT> \
--namespace doit-eks-metrics \
--create-namespace

Example:

helm upgrade -install doit-eks-lens doit-eks-lens-helm-chart/doit-eks-lens --set region=us-west-2 \
--set metricsDeploymentId=2Dw7oXwSkgjwjsXGcSMr \
--set s3_bucket=doitintl-eks-metrics-317630533282-us-west-2 \
--set s3_prefix=eks-metrics/317630533282/us-west-2/wonderful-sheepdog-1708421720 \
--set role_arn=arn:aws:iam::317630533282:role/doit_eks_us-west-2_wonderful-sheepdog-1708421720 \
--set kubeStateMetrics.install=false \
--set collector.otelcol.kubeStateMetrics.endpoint="kube-state-metrics.kube-system:8080" \
--namespace doit-eks-metrics \
--create-namespace


To uninstall the chart:

helm delete doit-eks-lens --namespace doit-eks-metrics
23 changes: 23 additions & 0 deletions doit-eks-lens/.helmignore
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/
6 changes: 6 additions & 0 deletions doit-eks-lens/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: doit-eks-lens
description: A Helm chart for DoiT EKS lens
type: application
version: 1.0.0
appVersion: "1.0.0"
61 changes: 61 additions & 0 deletions doit-eks-lens/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "doit-eks-lens.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "doit-eks-lens.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "doit-eks-lens.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "doit-eks-lens.labels" -}}
helm.sh/chart: {{ include "doit-eks-lens.chart" . }}
{{ include "doit-eks-lens.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "doit-eks-lens.selectorLabels" -}}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "doit-eks-lens.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "doit-eks-lens.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
Loading

0 comments on commit 7ea6212

Please sign in to comment.