Skip to content

Commit

Permalink
feat: helm-chart support
Browse files Browse the repository at this point in the history
Signed-off-by: Bence Csati <csatib02@gmail.com>
  • Loading branch information
csatib02 committed Sep 2, 2024
1 parent b840f5b commit 9e43b4c
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 79 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,29 @@ jobs:
with:
name: Kube-Pod-Autocomplete-Binary
path: build/dist/*

helm-chart:
name: Helm-Chart
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.15.4

- name: Helm lint
run: make lint-helm

- name: Helm package
id: build
run: make helm-chart

- name: Upload Helm chart artifact
uses: actions/upload-artifact@v4
with:
name: Kube-Pod-Autocomplete-Helm-Chart
path: build/*.tgz
21 changes: 21 additions & 0 deletions deploy/charts/kube-pod-autocomplete/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
10 changes: 10 additions & 0 deletions deploy/charts/kube-pod-autocomplete/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v2
type: application
name: kube-pod-autocomplete
version: 0.0.0
appVersion: latest
description: backend service designed to enhance the user experience when navigating resource lists in Kubernetes clusters.
sources:
- https://github.com/csatib02/kube-pod-autocomplete
maintainers:
- name: csatib02
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.name }}
namespace: {{ .Values.namespace }}
labels:
app.kubernetes.io/name: {{ .Values.name }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app.kubernetes.io/name: {{ .Values.name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ .Values.name }}
spec:
serviceAccountName: {{ .Values.serviceAccount.name }}
containers:
- name: {{ .Values.name }}
image: {{ .Values.image }}
ports:
- containerPort: {{ .Values.containerPort }}
resources:
limits:
cpu: {{ .Values.resources.limits.cpu }}
memory: {{ .Values.resources.limits.memory }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name }}
namespace: {{ .Values.namespace }}

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Values.rbac.clusterRoleName }}
namespace: {{ .Values.namespace }}
rules:
- apiGroups: [""]
resources:
{{- toYaml .Values.rbac.resourceTypes | nindent 4 }}
verbs: ["get", "list"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ .Values.rbac.clusterRoleBindingName }}
namespace: {{ .Values.namespace }}
subjects:
- kind: ServiceAccount
name: {{ .Values.serviceAccount.name }}
namespace: {{ .Values.namespace }}
roleRef:
kind: ClusterRole
name: {{ .Values.rbac.clusterRoleName }}
apiGroup: rbac.authorization.k8s.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.name }}
namespace: {{ .Values.namespace }}
spec:
selector:
app.kubernetes.io/name: {{ .Values.name }}
type: {{ .Values.service.type }}
ports:
- protocol: TCP
port: {{ .Values.servicePort }}
targetPort: {{ .Values.containerPort }}
30 changes: 30 additions & 0 deletions deploy/charts/kube-pod-autocomplete/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Namespace where the application will be deployed
namespace: kube-pod-autocomplete

# General settings for the service
name: kube-pod-autocomplete
replicas: 1
image: csatib02/kube-pod-autocomplete:v0.1.0
containerPort: 8080
servicePort: 8080

# Service settings
service:
type: ClusterIP

# Service Account settings
serviceAccount:
name: kube-pod-autocomplete-sa

# RBAC settings
rbac:
clusterRoleName: kube-pod-autocomplete-clusterrole
resourceTypes:
- "pods"
clusterRoleBindingName: kube-pod-autocomplete-clusterrolebinding

# Resource limits for the application
resources:
limits:
cpu: "1"
memory: "512Mi"
48 changes: 0 additions & 48 deletions deploy/kube-pod-autocomplete.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions deploy/rbac.yaml

This file was deleted.

0 comments on commit 9e43b4c

Please sign in to comment.