Compare commits

..

No commits in common. "main" and "ot-karpenter-0.2.0" have entirely different histories.

41 changed files with 58 additions and 1075 deletions

View File

@ -8,14 +8,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: v3.16.2
version: v3.5.4
- uses: actions/setup-python@v4
with:

View File

@ -25,4 +25,3 @@ jobs:
VALIDATE_YAML: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_EXCLUDE: .*(README\.md|NOTES.txt).*

View File

@ -8,30 +8,34 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
uses: actions/checkout@v2
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.8.0
uses: helm/kind-action@v1.5.0
with:
cluster_name: kind
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: v3.16.2
version: v3.5.4
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.0
- name: Install yq
run: |
sudo snap install yq
- uses: actions/setup-python@v4
with:
python-version: '3.9'
check-latest: true
- name: Install and test Helm charts
- name: Install and test Redis Related Helm charts
run: |
kubectl cluster-info --context kind-kind
changed=$(ct list-changed --config ct.yaml)
ct install --config ct.yaml || true
chart_dirs=("redis-operator" "redis" "redis-cluster" "redis-replication" "redis-sentinel")
for dir in "${chart_dirs[@]}"
do
if [[ -f ./charts/$dir/Chart.yaml ]]; then
helm dependency update ./charts/$dir/
fi
chart_version=$(yq e .version ./charts/$dir/Chart.yaml)
echo "Installing $dir chart with version $chart_version..."
helm install $dir ./charts/$dir/
helm test $dir
done
echo "Listing installed Helm charts..."

View File

@ -14,6 +14,14 @@ helm repo add ot-helm https://ot-container-kit.github.io/helm-charts
You can then run `helm search repo ot-helm` to see the charts.
### Helm Charts List
Currently supported helm charts are:-
- [Redis Operator](./charts/redis-operator)
- [Redis Standalone](./charts/redis)
- [Redis Cluster](./charts/redis-cluster)
- [K8s Vault Webhook](./charts/k8s-vault-webhook)
### Pre-Requisities

View File

@ -1,21 +0,0 @@
---
apiVersion: v1
description: A base helm chart which will be used by different helm charts
engine: gotpl
maintainers:
- name: iamabhishek-dubey
email: "abhishek.dubey@opstree.com"
url: https://github.com/iamabhishek-dubey
name: base
sources:
- https://github.com/ot-container-kit/helm-charts
version: 0.1.0
appVersion: "0.1.0"
home: https://github.com/ot-container-kit/helm-charts
keywords:
- deployment
- base
- opstree
- kubernetes
- openshift
icon: https://raw.githubusercontent.com/OT-CONTAINER-KIT/helm-charts/main/static/helm-chart-logo.svg

View File

@ -1,28 +0,0 @@
# base
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
A base helm chart which will be used by different helm charts.
**Homepage:** <https://github.com/ot-container-kit/helm-charts>
## Maintainers
| Name | Email | Url |
|-------------------|----------------------------|----------------------------------------|
| iamabhishek-dubey | abhishek.dubey@opstree.com | <https://github.com/iamabhishek-dubey> |
## Source Code
* <https://github.com/ot-container-kit/helm-charts>
## Values
| Key | Type | Default | Description |
|----------------------------|--------|---------|--------------------------------------------------------------------------------|
| config | object | `{}` | ConfigMap key value pair to create configs |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template |
----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

View File

@ -1,13 +0,0 @@
{{- define "configmap" -}}
{{- if .Values.base.config -}}
{{- $top := . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "base.fullname" . }}
labels:
{{- include "base.labels" . | nindent 4 }}
data:
{{- toYaml .Values.base.config | nindent 2 -}}
{{- end -}}
{{- end -}}

View File

@ -1,42 +0,0 @@
{{/*
Create a default fully qualified app name.
We truncate service name aka .Release.Name at 59 chars because some Kubernetes name fields are limited to 63 (by the DNS naming spec).
We append 4 characters for chart type at the end which is -web or -crn or -wrk or -job or -sts.
*/}}
{{- define "base.fullname" -}}
{{- $name := .Release.Name | trunc 59 | trimSuffix "-" }}
{{- printf "%s-%s" $name .Chart.Name }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "base.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "base.labels" -}}
helm.sh/chart: {{ include "base.chart" . }}
{{ include "base.selectorLabels" . }}
{{- if .Release.Revision }}
app.kubernetes.io/version: {{ .Release.Revision | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "base.selectorLabels" -}}
app.kubernetes.io/name: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "base.serviceAccountName" -}}
{{- default (include "base.fullname" .) .Values.base.serviceAccount.name }}
{{- end }}

View File

@ -1,12 +0,0 @@
{{- define "serviceAccount" -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "base.serviceAccountName" . }}
labels:
{{- include "base.labels" . | nindent 4 }}
{{- with .Values.base.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@ -1,13 +0,0 @@
# Default values for base template.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
serviceAccount:
# -- Annotations to add to the service account
annotations: {}
# -- The name of the service account to use.
# -- If not set and create is true, a name is generated using the fullname template
name: ""
# -- ConfigMap key value pair to create configs
config: {}

View File

@ -1,16 +0,0 @@
apiVersion: v2
name: ingress-management
description: A Helm chart to manage Ingress traffic
version: 0.1.0
appVersion: "1.0"
home: https://github.com/ot-container-kit/helm-charts
maintainers:
- name: sharvarikhamkar1304
keywords:
- ingress
- kong
- httpRoute
- kubernetes
icon: https://raw.githubusercontent.com/OT-CONTAINER-KIT/helm-charts/main/static/helm-chart-logo.svg
sources:
- https://github.com/ot-container-kit/helm-charts

View File

@ -1,49 +0,0 @@
# Ingress Management Helm Chart
A simple and reusable Helm chart to manage Kubernetes Gateway API HTTPRoutes for routing traffic to backend services.
This chart helps manage HTTPRoute resources to expose services using the Kubernetes Gateway API. You can customize host, path, service, and namespace via values.
## Homepage
[https://github.com/ot-container-kit/helm-charts](https://github.com/ot-container-kit/helm-charts)
## Maintainers
| Name | URL |
| ---------------- | --------------------------------------------- |
| sharvari-khamkar | [GitHub](https://github.com/sharvari-khamkar) |
## Source Code
[GitHub - ot-container-kit/helm-charts](https://github.com/ot-container-kit/helm-charts)
## Requirements
| Repository | Name | Version |
| ------------------------------------------------------------------------------------------------ | ---- | ------- |
| [https://ot-container-kit.github.io/helm-charts](https://ot-container-kit.github.io/helm-charts) | base | 0.1.0 |
## Values
| **Attribute** | **Scope** | **Example** | **Description** | **Default** |
|------------------|------------------|------------------------|------------------------------------------------------------------------|--------------|
| <br> `name` <br> <br> | <br> Global <br> <br> | <br> `"my-app"` <br> <br> | <br> Name of the HTTPRoute and backend service (the app name)<br><br> | `""` |
| <br> `namespace` <br> <br> | <br> Global <br> <br> | <br> `"default"` <br> <br> | <br> Kubernetes namespace where resources like HTTPRoute will be deployed<br><br> | `""` |
| <br> `host` <br> <br> | Routing | `"app.example.com"` | Hostname to expose the app<br><br> | `""` |
| <br>`path` <br> <br> | Routing | `"/api"` | Path under the host<br><br> | `""` |
| <br>`service.name` <br> <br> | Service Config | `"my-backend-svc"` | Name of the backend service to which traffic will be routed<br><br> | `""` |
| <br>`service.kind` <br> <br> | Service Config | `"Service"` | Kind of backend resource (Service by default)<br><br> | `"Service"` |
| <br>`service.port` <br> <br> | Service Config | `80` | Port on which the backend service listens<br><br> | `80` |

View File

@ -1,46 +0,0 @@
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: {{ required "A valid 'name' is required!" .Values.name }}
{{- if .Values.labels }}
labels:
{{ toYaml .Values.labels | indent 4 }}
{{- end }}
{{- if .Values.annotations }}
annotations:
{{ toYaml .Values.annotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.parentRefs }}
parentRefs:
{{- range .Values.parentRefs }}
- name: {{ .name }}
{{- if .namespace }}
namespace: {{ .namespace }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.hostnames }}
hostnames:
{{- range .Values.hostnames }}
- "{{ . }}"
{{- end }}
{{- end }}
rules:
{{- range .Values.rules }}
- matches:
{{- range .matches }}
- path:
type: {{ .path.type }}
value: {{ .path.value | quote }}
{{- end }}
backendRefs:
{{- range .backendRefs }}
- name: {{ .name }}
kind: {{ .kind | default "Service" }}
port: {{ .port }}
{{- end }}
{{- end }}

View File

@ -1,60 +0,0 @@
---
# charts/ingress-management/values.yaml
# -- Name of the HTTPRoute and backend service (typically the app name)
name: ""
# -- Labels to apply to the HTTPRoute metadata
labels:
app: ""
# -- Optional annotations to apply to the HTTPRoute resource
annotations: {}
# -- Reference to the Gateway (parentRefs)
parentRefs:
- name: ""
namespace: ""
# -- Hostnames to be matched in the HTTPRoute
hostnames:
- ""
# -- Routing rules for HTTPRoute
rules:
- matches:
- path:
type: PathPrefix
value: ""
backendRefs:
- name: ""
kind: Service
port: 80
# -----------------------------------------------------
# Example values.yaml File
# -----------------------------------------------------
# name: open-webui
# labels:
# app: open-webui
# annotations:
# konghq.com/protocols: https
# konghq.com/https-redirect-status-code: "301"
# parentRefs:
# - name: kong
# namespace: default
# hostnames:
# - bp-ai.opstree.dev
# rules:
# - matches:
# - path:
# type: PathPrefix
# value: /
# backendRefs:
# - name: open-webui
# kind: Service
# port: 80

View File

@ -1,9 +1,7 @@
apiVersion: v2
name: ot-karpenter
version: 0.3.0
maintainers:
- name: opstree
version: 0.2.0
dependencies:
- name: karpenter
version: 1.1.1
version: 1.1.1
repository: oci://public.ecr.aws/karpenter

View File

@ -7,11 +7,11 @@ To install Karpenter, use the following commands:
```shell
$ helm repo add ot-helm https://ot-container-kit.github.io/helm-charts/
$ helm install karpenter ot-helm/karpenter --namespace <namespace> --dependency-update --create-namespace
$ helm install karpenter ot-helm/karpenter --namespace <namespace> --dependency-update --include-crds
```
Adds the ot-helm repository to Helm, which contains the Karpenter Helm chart.
Installs the Karpenter chart from the ot-helm repository.
# Adds the ot-helm repository to Helm, which contains the Karpenter Helm chart.
# Installs the Karpenter chart from the ot-helm repository.
@ -22,7 +22,7 @@ $ helm upgrade karpenter ot-helm/karpenter --install --namespace <namespace> --c
```
Upgrades an existing Karpenter release or installs it if it doesn't exist.
# Upgrades an existing Karpenter release or installs it if it doesn't exist.
To uninstall the chart:
@ -31,8 +31,8 @@ To uninstall the chart:
$ helm delete karpenter --namespace <namespace>
```
Deletes the Karpenter release from the specified namespace.
Replace <namespace> with the namespace where Karpenter is installed.
# Deletes the Karpenter release from the specified namespace.
# Replace <namespace> with the namespace where Karpenter is installed.
@ -72,6 +72,7 @@ Replace <namespace> with the namespace where Karpenter is installed.
### Notes:
- After deployment of helm chart, in order for the nodepool to work, ec2nodeclass should be installed as well.
- Refer to Example Folder for a example values.yaml file
- Karpenter automatically creates and manages NodePools as part of the installation process.
- Make sure to configure the IAM roles required by Karpenter for it to interact with EC2 instances and manage resources along with all prerequisites.

View File

@ -79,4 +79,5 @@ nodePools:
nodeClass:
group: karpenter.k8s.aws # Node class group for Karpenter
kind: EC2NodeClass # Kind of node class, EC2NodeClass indicates AWS EC2 instances
name: default # The name of the node class (default for this pool)
name: default # The name of the node class (default for this pool)

View File

View File

@ -1,33 +0,0 @@
{{- range .Values.ec2NodeClasses }}
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: {{ .name }}
spec:
amiFamily: {{ .amiFamily | default "AL2" }}
role: {{ .role }}
{{- if .detailedMonitoring }}
detailedMonitoring: {{ .detailedMonitoring }}
{{- end }}
subnetSelectorTerms:
- tags:
karpenter.sh/discovery: "{{ $.Values.clusterName }}"
securityGroupSelectorTerms:
- tags:
karpenter.sh/discovery: "{{ $.Values.clusterName }}"
amiSelectorTerms:
- id: "{{ .amiSelector.arm }}"
- id: "{{ .amiSelector.amd }}"
{{- if .amiSelector.gpu }}
- id: "{{ .amiSelector.gpu }}"
{{- end }}
{{- if .amiSelector.name }}
- name: "{{ .amiSelector.name }}"
{{- end }}
{{- if .tags }}
tags:
{{- range $key, $value := .tags }}
{{ $key }}: "{{ $value }}"
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,25 +1,18 @@
# Custom values for your chart
# Name of the EKS cluster (for identification in the chart and Karpenter)
clusterName: ""
# AWS partition, default is 'aws' (used in multi-region or partitioned environments)
awsPartition: ""
# AWS account ID where the resources will be provisioned
awsAccountId: 3333
clusterName: "" # Name of the EKS cluster (for identification in the chart and Karpenter)
awsPartition: "" # AWS partition, default is 'aws' (used in multi-region or partitioned environments)
awsAccountId: 3333 # AWS account ID where the resources will be provisioned
# Karpenter chart overrides
karpenter:
settings:
# Cluster name for the Karpenter controller to identify and manage nodes in this cluster
clusterName: ""
# Name of SQS queue for handling EC2 instance interruptions
# interruptionQueue: ""
clusterName: "" # Cluster name for the Karpenter controller to identify and manage nodes in this cluster
serviceAccount:
annotations:
# IAM role ARN for Karpenter controller's access to AWS services
eks.amazonaws.com/role-arn: arn:aws:iam::3333:role/KarpenterControllerRole-demo-eks
eks.amazonaws.com/role-arn: #arn:aws:iam::3333:role/KarpenterControllerRole-demo-eks # IAM role ARN for Karpenter controller's access to AWS services
# Karpenter controller resources can be customized in this section below
# Karpenter controller resources can be customized in this section below
# controller:
# resources:
# requests:
@ -29,31 +22,6 @@ karpenter:
# cpu: "1" # CPU resource limit for the Karpenter controller (maximum resources Karpenter can consume)
# memory: "1Gi" # Memory resource limit for the Karpenter controller
# EC2NodeClasses define the EC2 instance classes that Karpenter can use
ec2NodeClasses:
- name: default
# Amazon Linux 2 AMI family
amiFamily: AL2
# "KarpenterNodeRole-my-eks-cluster" # Name of karpenter Node Role ( NOT THE ARN )
role:
amiSelector:
# To get the AMI ID, run the commands below in the AWS CLI and replace the AMI ID in the values.yaml file
# ARM_AMI_ID="$(aws ssm get-parameter --name /aws/service/eks/optimized-ami/${K8S_VERSION}/amazon-linux-2-arm64/recommended/image_id --query Parameter.Value --output text)"
arm:
# AMD_AMI_ID="$(aws ssm get-parameter --name /aws/service/eks/optimized-ami/${K8S_VERSION}/amazon-linux-2/recommended/image_id --query Parameter.Value --output text)"
amd:
# GPU_AMI_ID="$(aws ssm get-parameter --name /aws/service/eks/optimized-ami/${K8S_VERSION}/amazon-linux-2-gpu/recommended/image_id --query Parameter.Value --output text)"
# gpu: ami-gpu-id
# amazon-eks-node-1.27-* # Optional: EKS Node AMI Name
# name:
# Optional, propagates tags to underlying EC2 resources
# tags:
# environment: production
# team: "engineering"
# owner: "admin@company.com"
# Enable detailed monitoring for the EC2 instance
# detailedMonitoring: true
# NodePools define groups of nodes with specific requirements
nodePools:
- name: default # Name of the node pool, preset here is set to default nodepool
@ -69,17 +37,13 @@ nodePools:
- key: karpenter.sh/capacity-type # Defines the instance's capacity type
operator: In # Only nodes with the specified capacity type will be selected
values:
- "on-demand" # Specifies that the node should be an on-demand instance, can be "spot" as well
- "on-demand" # Specifies that the node should be an on-demand instance, can be "spot" as well
- key: karpenter.k8s.aws/instance-category # Defines the instance category (e.g., t, m, r)
operator: In # Only nodes with the specified instance category will be selected
values:
- "t" # These can be customized as per need
- "m"
- "r"
# - key: karpenter.k8s.aws/instance-family # Uncomment to define the instance family (e.g., t3, m5, r5)
# operator: In
# values:
# - "t3a"
- "t" # These can be customized as per need
- "m"
- "r"
- key: karpenter.k8s.aws/instance-generation # Instance generation requirement
operator: Gt # Greater than the specified value
values:
@ -91,20 +55,20 @@ nodePools:
expireAfter: 720h # Maximum lifetime of the node pool before it expires (720 hours = 30 days)
limits: # Resource limits for the node pool
cpu: "1000" # Maximum CPU limit for the node pool
memory: "1Gi"
#memory: "1Gi"
disruption: # Policy for handling disruption in the node pool
consolidationPolicy: WhenEmptyOrUnderutilized # Consolidate nodes when they are empty or underutilized
consolidateAfter: 1m # Time after which consolidation will occur, in this case, 1 minute
# Uncomment Below annotations key ( next 3 Lines ) if you want to use annotations
#Uncomment Below annotations key ( next 3 Lines ) if you want to use annotations
# annotations: # Annotations are key-value pairs that provide additional metadata for the node pool
# example.com/owner: "my-team" # An example annotation that associates the node pool with a team
# example.com/maintainer: "admin@company.com" # Example annotation for the maintainer's contact information
# Uncomment below taint key ( next 4 Lines ) if you want to use taints
#Uncomment below taint key ( next 4 Lines ) if you want to use taints
# taints: # Taints are used to control which pods can be scheduled on the node pool
# - key: "example.com/special-taint" # Taint key that identifies the taint
# value: "special-value" # Value associated with the taint
# effect: "NoExecute" # Effect of the taint. In this case, NoExecute means pods won't be scheduled on tainted nodes
# Comment Labels Key below if you dont want to use Labels
# Comment Labels Key below if you dont want to use Labels
labels: # Labels are key-value pairs used for categorizing the node pool
environment: production # Label indicating that this node pool is for production use
team: "engineering" # Label associating the node pool with the engineering team

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: microservice
description: Basic helm chart for deploying microservices on kubernetes with best practices
type: application
version: 0.1.8
version: 0.1.6
appVersion: "0.1.2"
maintainers:
- name: ashwani-opstree

View File

@ -33,7 +33,7 @@ spec:
{{- end }}
{{- end }}
spec:
{{- with .Values.global.imagePullSecrets }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
@ -67,11 +67,11 @@ spec:
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if and .Values.deployment.healthProbes.enabled .Values.deployment.livenessProbe.httpGet }}
{{- if and .Values.deployment.healthProbes.enabled .Values.deployment.livenessProbe }}
livenessProbe:
{{- toYaml .Values.deployment.livenessProbe | nindent 12 }}
{{- end }}
{{- if and .Values.deployment.healthProbes.enabled .Values.deployment.readinessProbe.httpGet }}
{{- if and .Values.deployment.healthProbes.enabled .Values.deployment.readinessProbe }}
readinessProbe:
{{- toYaml .Values.deployment.readinessProbe | nindent 12 }}
{{- end }}

View File

@ -1,26 +0,0 @@
---
apiVersion: v2
description: A deployment helm chart which will be used to deploy any type of stateless application
maintainers:
- name: iamabhishek-dubey
email: "abhishek.dubey@opstree.com"
url: https://github.com/iamabhishek-dubey
name: web
sources:
- https://github.com/ot-container-kit/helm-charts
dependencies:
- name: base
version: 0.1.0
repository: https://ot-container-kit.github.io/helm-charts
version: 0.1.0
appVersion: "0.1.0"
home: https://github.com/ot-container-kit/helm-charts
keywords:
- deployment
- base
- opstree
- kubernetes
- openshift
- microservice
- stateless
icon: https://raw.githubusercontent.com/OT-CONTAINER-KIT/helm-charts/main/static/helm-chart-logo.svg

View File

@ -1,46 +0,0 @@
# Web Deployment Helm Chart
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
A deployment helm chart which will be used to deploy any type of stateless application
**Homepage:** <https://github.com/ot-container-kit/helm-charts>
## Maintainers
| Name | Email | Url |
|-------------------|------------------------------|----------------------------------------|
| iamabhishek-dubey | <abhishek.dubey@opstree.com> | <https://github.com/iamabhishek-dubey> |
## Source Code
* <https://github.com/ot-container-kit/helm-charts>
## Requirements
| Repository | Name | Version |
|------------------------------------------------|------|---------|
| https://ot-container-kit.github.io/helm-charts | base | 0.1.0 |
## Values
| Key | Type | Default | Description |
|------------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| autoscaling | object | `{"enabled":false,"maxReplicas":50,"minReplicas":10,"targetCPUUtilizationPercentage":65,"targetMemoryUtilizationPercentage":65}` | Autoscaling properties with target CPU and Memory details |
| base | object | `{"image":{"command":[],"pullPolicy":"IfNotPresent","pullSecrets":"","repository":"nginx","tag":"latest"}}` | Base block to define the inputs for image, secret and configmap env |
| base.image | object | `{"command":[],"pullPolicy":"IfNotPresent","pullSecrets":"","repository":"nginx","tag":"latest"}` | Image block with all image details |
| base.image.command | list | `[]` | Additional command arguments which needs to be passed |
| base.image.pullPolicy | string | `"IfNotPresent"` | Default image pull policy |
| base.image.pullSecrets | string | `""` | Image pull secrets for private repository authentication |
| base.image.repository | string | `"nginx"` | Default image repository |
| base.image.tag | string | `"latest"` | Default image tag |
| healthcheck | object | `{"enabled":true,"statusPath":"/"}` | Healthcheck details for readiness and liveness probe |
| healthcheck.enabled | bool | `true` | Healthcheck is enabled or not |
| healthcheck.statusPath | string | `"/"` | Healthcheck status path on status will be checked |
| ingress | object | `{"annotations":{"ingress.gcp.kubernetes.io/pre-shared-cert":"global-sign-opstree-com-2024","kubernetes.io/ingress.allow-http":"false"},"class":"nginx","enabled":false}` | Ingress details with class, annotations and rules |
| internalIngress | object | `{"annotations":{"kubernetes.io/ingress.allow-http":"true"},"class":"nginx-internal","enabled":false}` | Internal ingress details with class, annotations and rules |
| replicaCount | int | `2` | Number of replicas for deployment, it will be overridden in case autoscaling is enabled |
| resources | object | `{}` | Kubernetes resource in terms of requests and limits |
| service | object | `{"port":80,"type":"ClusterIP"}` | Service specification details with port and type |
| service.type | string | `"ClusterIP"` | Prometheus metrics to expose metrics on path with port metrics: path: /v1/metrics port: 8081 |
| volumes | string | `nil` | Kubernetes volumes definition which needs to be mounted |

View File

@ -1,4 +0,0 @@
{{ include "configmap" . }}
---
{{ include "serviceAccount" . }}
---

View File

@ -1,18 +0,0 @@
{{- if .Values.volumes }}
{{- if .Values.volumes.configMaps }}
{{ range $cm := .Values.volumes.configMaps}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $cm.name }}
labels:
{{- include "base.labels" $ | nindent 4 }}
data:
{{- range $filename, $content := $cm.data }}
{{ $filename }}: |-
{{ $content | toString | indent 4}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,87 +0,0 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "base.fullname" . }}
labels:
{{- include "base.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
{{- with .Values.replicaCount }}
replicas: {{ . }}
{{- end }}
{{- end }}
selector:
matchLabels:
{{- include "base.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "base.selectorLabels" . | nindent 8 }}
spec:
{{- if .Values.base.image.pullSecrets }}
imagePullSecrets:
- name: {{ .Values.base.image.pullSecrets }}
{{- end }}
serviceAccountName: {{ include "base.serviceAccountName" . }}
terminationGracePeriodSeconds: 120
containers:
- name: {{ include "base.fullname" . }}
image: "{{ .Values.base.image.repository }}:{{ .Values.base.image.tag }}"
imagePullPolicy: {{ .Values.base.image.pullPolicy }}
{{- if .Values.base.image.command }}
command:
{{- toYaml .Values.base.image.command | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
livenessProbe:
httpGet:
path: {{ .Values.healthcheck.statusPath }}
port: http
initialDelaySeconds: 30
periodSeconds: 60
successThreshold: 1
timeoutSeconds: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: {{ .Values.healthcheck.statusPath }}
port: http
initialDelaySeconds: 30
periodSeconds: 60
successThreshold: 1
timeoutSeconds: 1
failureThreshold: 3
{{- if .Values.base.config }}
envFrom:
- configMapRef:
name: {{ include "base.fullname" . }}
{{- end }}
{{- if .Values.base.secret }}
- secretRef:
name: {{ include "base.fullname" . }}
{{- end }}
{{- if .Values.volumes }}
volumeMounts:
{{- if .Values.volumes.configMaps }}
{{- range $conf := .Values.volumes.configMaps }}
- mountPath: {{ $conf.mountPath }}
name: {{ $conf.name }}-volume
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.volumes }}
volumes:
{{- if .Values.volumes.configMaps }}
{{- range $conf := .Values.volumes.configMaps }}
- name: {{ $conf.name }}-volume
configMap:
name: {{ $conf.name }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,33 +0,0 @@
{{- if .Values.autoscaling.enabled }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "base.fullname" . }}
labels:
{{- include "base.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "base.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

View File

@ -1,39 +0,0 @@
---
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: {{ .Values.ingress.class }}
labels:
{{- include "base.labels" . | nindent 4 }}
name: {{ include "base.fullname" . }}-external-ing
spec:
ingressClassName: {{ .Values.ingress.class }}
rules:
{{- range $rule := .Values.ingress.rules }}
- host: {{ $rule.hostname }}
http:
paths:
{{- if (kindIs "slice" $rule.path) }}
{{- range $path := $rule.path }}
- path: {{ $path }}
pathType: Prefix
backend:
service:
name: {{ include "base.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- if (kindIs "string" $rule.path) }}
- path: {{ $rule.path }}
pathType: Prefix
backend:
service:
name: {{ include "base.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,41 +0,0 @@
{{- if .Values.internalIngress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "base.fullname" . }}-internal-ing
annotations:
kubernetes.io/ingress.class: {{ .Values.internalIngress.class }}
{{- if .Values.internalIngress.annotations }}
{{ toYaml .Values.internalIngress.annotations | nindent 4 }}
{{- end }}
labels:
{{- include "base.labels" . | nindent 4 }}
spec:
ingressClassName: {{ .Values.internalIngress.class }}
rules:
{{- range $rule := .Values.internalIngress.rules }}
- host: {{ $rule.hostname }}
http:
paths:
{{- if (kindIs "slice" $rule.path) }}
{{- range $path := $rule.path }}
- path: {{ $path }}
pathType: Prefix
backend:
service:
name: {{ include "base.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- if (kindIs "string" $rule.path) }}
- path: {{ $rule.path }}
pathType: Prefix
backend:
service:
name: {{ include "base.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,12 +0,0 @@
{{- if .Values.base.secret -}}
{{- $top := . -}}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "base.fullname" . }}
labels:
{{- include "base.labels" . | nindent 4 }}
stringData:
{{- toYaml .Values.base.secret | nindent 2 -}}
{{- end -}}

View File

@ -1,22 +0,0 @@
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "base.fullname" . }}
annotations:
{{- if .Values.service.metrics }}
prometheus.io/path: "{{ .Values.service.metrics.path }}"
prometheus.io/port: "{{ .Values.service.metrics.port }}"
prometheus.io/scrape: "true"
{{- end }}
labels:
{{- include "base.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "base.selectorLabels" . | nindent 4 }}

View File

@ -1,91 +0,0 @@
# -- Base block to define the inputs for image, secret and configmap env
base:
# -- Image block with all image details
image:
# -- Default image pull policy
pullPolicy: "IfNotPresent"
# -- Additional command arguments which needs to be passed
command: []
# -- Default image repository
repository: nginx
# -- Default image tag
tag: latest
# -- Image pull secrets for private repository authentication
pullSecrets: ""
# secret:
# FOO_SECRET: BAR
# config:
# FOO_CONFIG: BAR
# -- Healthcheck details for readiness and liveness probe
healthcheck:
# -- Healthcheck is enabled or not
enabled: true
# -- Healthcheck status path on status will be checked
statusPath: /
# -- Autoscaling properties with target CPU and Memory details
autoscaling:
enabled: false
targetCPUUtilizationPercentage: 65
targetMemoryUtilizationPercentage: 65
minReplicas: 10
maxReplicas: 50
# -- Service specification details with port and type
service:
port: 80
# -- Prometheus metrics to expose metrics on path with port
# metrics:
# path: /v1/metrics
# port: 8081
type: ClusterIP
# -- Kubernetes resource in terms of requests and limits
resources: {}
# -- Number of replicas for deployment, it will be overridden in case autoscaling is enabled
replicaCount: 2
# -- Kubernetes volumes definition which needs to be mounted
volumes:
# -- List of configmaps with mount path and data
# configMaps:
# - name: web
# mountPath: /test
# data:
# test.txt: |-
# Dummy text
# -- Ingress details with class, annotations and rules
ingress:
enabled: false
class: nginx
annotations:
ingress.gcp.kubernetes.io/pre-shared-cert: global-sign-opstree-com-2024
kubernetes.io/ingress.allow-http: "false"
# rules:
# - hostname: origin-sample-service.opstree.com
# path: /api/sample
# - hostname: origin-sample-service.opstree.com
# path:
# - /api
# - /api2
# - hostname: sample-service.opstree.com
# path: /api/sample
# -- Internal ingress details with class, annotations and rules
internalIngress:
enabled: false
class: nginx-internal
annotations:
kubernetes.io/ingress.allow-http: "true"
# rules:
# - hostname: origin-sample-service.opstree.in
# path: /api/sample
# - hostname: origin-sample-service.opstree.in
# path:
# - /api
# - /api2
# - hostname: sample-service.opstree.in
# path: /api/sample

View File

@ -1,26 +0,0 @@
---
apiVersion: v2
description: A deployment helm chart which will be used to deploy any type of stateless application
maintainers:
- name: iamabhishek-dubey
email: "abhishek.dubey@opstree.com"
url: https://github.com/iamabhishek-dubey
name: worker
sources:
- https://github.com/ot-container-kit/helm-charts
dependencies:
- name: base
version: 0.1.0
repository: https://ot-container-kit.github.io/helm-charts
version: 0.1.0
appVersion: "0.1.0"
home: https://github.com/ot-container-kit/helm-charts
keywords:
- deployment
- base
- opstree
- kubernetes
- openshift
- microservice
- stateless
icon: https://raw.githubusercontent.com/OT-CONTAINER-KIT/helm-charts/main/static/helm-chart-logo.svg

View File

@ -1,39 +0,0 @@
# Worker Deployment Helm Chart
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
A deployment helm chart which will be used to deploy any type of stateless application
**Homepage:** <https://github.com/ot-container-kit/helm-charts>
## Maintainers
| Name | Email | Url |
|-------------------|------------------------------|----------------------------------------|
| iamabhishek-dubey | <abhishek.dubey@opstree.com> | <https://github.com/iamabhishek-dubey> |
## Source Code
* <https://github.com/ot-container-kit/helm-charts>
## Requirements
| Repository | Name | Version |
|------------------------------------------------|------|---------|
| https://ot-container-kit.github.io/helm-charts | base | 0.1.0 |
## Values
| Key | Type | Default | Description |
|------------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| autoscaling | object | `{"enabled":false,"maxReplicas":50,"minReplicas":10,"targetCPUUtilizationPercentage":65,"targetMemoryUtilizationPercentage":65}` | Autoscaling properties with target CPU and Memory details |
| base | object | `{"image":{"command":[],"pullPolicy":"IfNotPresent","pullSecrets":"","repository":"nginx","tag":"latest"}}` | Base block to define the inputs for image, secret and configmap env |
| base.image | object | `{"command":[],"pullPolicy":"IfNotPresent","pullSecrets":"","repository":"nginx","tag":"latest"}` | Image block with all image details |
| base.image.command | list | `[]` | Additional command arguments which needs to be passed |
| base.image.pullPolicy | string | `"IfNotPresent"` | Default image pull policy |
| base.image.pullSecrets | string | `""` | Image pull secrets for private repository authentication |
| base.image.repository | string | `"nginx"` | Default image repository |
| base.image.tag | string | `"latest"` | Default image tag |
| replicaCount | int | `2` | Number of replicas for deployment, it will be overridden in case autoscaling is enabled |
| resources | object | `{}` | Kubernetes resource in terms of requests and limits |
| volumes | string | `nil` | Kubernetes volumes definition which needs to be mounted |

View File

@ -1,4 +0,0 @@
{{ include "configmap" . }}
---
{{ include "serviceAccount" . }}
---

View File

@ -1,18 +0,0 @@
{{- if .Values.volumes }}
{{- if .Values.volumes.configMaps }}
{{ range $cm := .Values.volumes.configMaps}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $cm.name }}
labels:
{{- include "base.labels" $ | nindent 4 }}
data:
{{- range $filename, $content := $cm.data }}
{{ $filename }}: |-
{{ $content | toString | indent 4}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,65 +0,0 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "base.fullname" . }}
labels:
{{- include "base.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
{{- with .Values.replicaCount }}
replicas: {{ . }}
{{- end }}
{{- end }}
selector:
matchLabels:
{{- include "base.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "base.selectorLabels" . | nindent 8 }}
spec:
{{- if .Values.base.image.pullSecrets }}
imagePullSecrets:
- name: {{ .Values.base.image.pullSecrets }}
{{- end }}
serviceAccountName: {{ include "base.serviceAccountName" . }}
terminationGracePeriodSeconds: 120
containers:
- name: {{ include "base.fullname" . }}
image: "{{ .Values.base.image.repository }}:{{ .Values.base.image.tag }}"
imagePullPolicy: {{ .Values.base.image.pullPolicy }}
{{- if .Values.base.image.command }}
command:
{{- toYaml .Values.base.image.command | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.base.config }}
envFrom:
- configMapRef:
name: {{ include "base.fullname" . }}
{{- end }}
{{- if .Values.base.secret }}
- secretRef:
name: {{ include "base.fullname" . }}
{{- end }}
{{- if .Values.volumes }}
volumeMounts:
{{- if .Values.volumes.configMaps }}
{{- range $conf := .Values.volumes.configMaps }}
- mountPath: {{ $conf.mountPath }}
name: {{ $conf.name }}-volume
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.volumes }}
volumes:
{{- if .Values.volumes.configMaps }}
{{- range $conf := .Values.volumes.configMaps }}
- name: {{ $conf.name }}-volume
configMap:
name: {{ $conf.name }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,33 +0,0 @@
{{- if .Values.autoscaling.enabled }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "base.fullname" . }}
labels:
{{- include "base.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "base.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

View File

@ -1,12 +0,0 @@
{{- if .Values.base.secret -}}
{{- $top := . -}}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "base.fullname" . }}
labels:
{{- include "base.labels" . | nindent 4 }}
stringData:
{{- toYaml .Values.base.secret | nindent 2 -}}
{{- end -}}

View File

@ -1,43 +0,0 @@
# -- Base block to define the inputs for image, secret and configmap env
base:
# -- Image block with all image details
image:
# -- Default image pull policy
pullPolicy: "IfNotPresent"
# -- Additional command arguments which needs to be passed
command: []
# -- Default image repository
repository: nginx
# -- Default image tag
tag: latest
# -- Image pull secrets for private repository authentication
pullSecrets: ""
# secret:
# FOO_SECRET: BAR
# config:
# FOO_CONFIG: BAR
# -- Autoscaling properties with target CPU and Memory details
autoscaling:
enabled: false
targetCPUUtilizationPercentage: 65
targetMemoryUtilizationPercentage: 65
minReplicas: 10
maxReplicas: 50
# -- Kubernetes resource in terms of requests and limits
resources: {}
# -- Number of replicas for deployment, it will be overridden in case autoscaling is enabled
replicaCount: 2
# -- Kubernetes volumes definition which needs to be mounted
volumes:
# -- List of configmaps with mount path and data
# configMaps:
# - name: web
# mountPath: /test
# data:
# test.txt: |-
# Dummy text