-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from DerekTBrown/add-helm-chart
feat: add helm chart
- Loading branch information
Showing
21 changed files
with
824 additions
and
3 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,33 @@ | ||
name: Helm Publish | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
helm_publish: | ||
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions | ||
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token | ||
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: Install Helm | ||
uses: azure/setup-helm@v4 | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
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,74 @@ | ||
name: Helm Test | ||
on: | ||
pull_request: | ||
jobs: | ||
helm_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.22 | ||
|
||
- name: Install Tools | ||
shell: bash | ||
id: tool-versions | ||
env: | ||
TILT_TOOL_CTLPTL_VERSION: "0.8.28" | ||
TILT_TOOL_KIND_VERSION: "0.23.0" | ||
TILT_TOOL_KUBECTL_VERSION: "1.30.0" | ||
TILT_TOOL_HELM_VERSION: "3.14.4" | ||
TILT_TOOL_TILT_VERSION: "0.33.13" | ||
run: | | ||
# Create Tools Directory | ||
TOOLS_DIR=/opt/helm_tools | ||
mkdir -p "${TOOLS_DIR}" | ||
# Download ctlptl | ||
echo "Downloading ctlptl" | ||
curl -fsSL https://github.com/tilt-dev/ctlptl/releases/download/v${TILT_TOOL_CTLPTL_VERSION}/ctlptl.${TILT_TOOL_CTLPTL_VERSION}.linux.x86_64.tar.gz | sudo tar -xzv -C "${TOOLS_DIR}" ctlptl | ||
# Download kind | ||
echo "Downloading kind" | ||
curl -fsSL https://kind.sigs.k8s.io/dl/v${TILT_TOOL_KIND_VERSION}/kind-linux-amd64 -o "${TOOLS_DIR}/kind" | ||
# Download kubectl | ||
echo "Downloading kubectl" | ||
curl -fsSL https://dl.k8s.io/release/v${TILT_TOOL_KUBECTL_VERSION}/bin/linux/amd64/kubectl -o "${TOOLS_DIR}/kubectl" | ||
# Download helm | ||
echo "Downloading helm" | ||
curl -fsSL https://get.helm.sh/helm-v${TILT_TOOL_HELM_VERSION}-linux-amd64.tar.gz | tar -xzv -C "${TOOLS_DIR}" --strip-components=1 linux-amd64/helm | ||
# Download tilt | ||
echo "Downloading tilt" | ||
curl -fsSL https://github.com/tilt-dev/tilt/releases/download/v${TILT_TOOL_TILT_VERSION}/tilt.${TILT_TOOL_TILT_VERSION}.linux.x86_64.tar.gz | tar -xzv -C "${TOOLS_DIR}" tilt | ||
# Make the binaries runnable | ||
echo "Making binaries executable" | ||
sudo chmod -R +x "${TOOLS_DIR}" | ||
# Add tools to path | ||
echo "PATH=${PATH}:${TOOLS_DIR}" >> $GITHUB_ENV | ||
- name: Start Kind Cluster | ||
shell: bash | ||
run: | | ||
ctlptl apply -f kind.yaml | ||
- name: Run Tilt Tests | ||
shell: bash | ||
run: | | ||
tilt ci --debug --output-snapshot-on-exit=/tmp/tilt-snapshot.json | ||
- name: Upload Tilt Snapshot | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: tilt-snapshot | ||
path: | | ||
/tmp/tilt-snapshot.json |
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
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,30 @@ | ||
# -*- mode: bazel-starlark -*- | ||
|
||
# Build the image | ||
docker_build('goldpinger-local', '.') | ||
|
||
# Deploy with Helm | ||
k8s_yaml( | ||
helm( | ||
'charts/goldpinger', | ||
set = [ | ||
# Set the image to the one built by Tilt | ||
'image.repository=goldpinger-local', | ||
], | ||
) | ||
) | ||
|
||
# Track Goldpinger Resource | ||
k8s_resource( | ||
'chart-goldpinger', | ||
port_forwards = [8080], | ||
) | ||
|
||
# Validate that all 2 nodes can talk to eachother | ||
local_resource( | ||
'check_reachability', | ||
cmd='./extras/check_reachability.sh 2', | ||
resource_deps = [ | ||
'chart-goldpinger', | ||
], | ||
) |
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 | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
|
||
OWNERS |
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,8 @@ | ||
apiVersion: v1 | ||
name: goldpinger | ||
appVersion: "3.10.1" | ||
version: 1.0.0 | ||
description: Goldpinger is a tool to help debug, troublshoot and visualize network connectivity and slowness issues. | ||
home: https://github.com/bloomberg/goldpinger | ||
sources: | ||
- https://github.com/bloomberg/goldpinger |
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,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "goldpinger.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 "goldpinger.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 "goldpinger.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "goldpinger.labels" -}} | ||
helm.sh/chart: {{ include "goldpinger.chart" . }} | ||
{{ include "goldpinger.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "goldpinger.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "goldpinger.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "goldpinger.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "goldpinger.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
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,12 @@ | ||
{{- if and .Values.rbac.create .Values.rbac.clusterscoped }} | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "goldpinger.fullname" . }}-clusterrole | ||
labels: | ||
{{- include "goldpinger.labels" . | nindent 4 }} | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: ["list"] | ||
{{- end }} |
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,16 @@ | ||
{{- if and .Values.rbac.create .Values.rbac.clusterscoped }} | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "goldpinger.fullname" . }}-clusterrolebinding | ||
labels: | ||
{{- include "goldpinger.labels" . | nindent 4 }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "goldpinger.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
kind: ClusterRole | ||
name: {{ include "goldpinger.fullname" . }}-clusterrole | ||
apiGroup: rbac.authorization.k8s.io | ||
{{- end }} |
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,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "goldpinger.fullname" . }}-zap | ||
labels: | ||
{{- include "goldpinger.labels" . | nindent 4 }} | ||
data: | ||
zap.json: {{ .Values.goldpinger.zapConfig | toJson }} |
Oops, something went wrong.