Skip to content

Commit

Permalink
Add helm charts for lws.
Browse files Browse the repository at this point in the history
Signed-off-by: wqlparallel <[email protected]>
  • Loading branch information
wqlparallel committed Dec 17, 2024
1 parent 8708b2e commit b34b2ce
Show file tree
Hide file tree
Showing 21 changed files with 17,138 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/new-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Please do not remove items from the checklist
- [ ] Add a link to the tagged release in this issue: <!-- example https://github.com/kubernetes-sigs/lws/releases/tag/v0.1.0 -->
- [ ] Send an announcement email to `[email protected]`, `[email protected]` and `[email protected]` with the subject `[ANNOUNCE] LeaderWorkerSet $VERSION is released`
- [ ] Add a link to the release announcement in this issue: <!-- example https://groups.google.com/a/kubernetes.io/g/wg-batch/c/-gZOrSnwDV4 -->
- [ ] For a major or minor release, update `README.md` and `docs/setup/install.md`
- [ ] For a major or minor release, update `README.md`, `docs/setup/install.md`, `charts/lws/Chart.yaml` (`version`,`appVersion`) and `charts/lws/values.yaml`(`image.manager.tag`)
in `main` branch: <!-- example #215 -->
- [ ] For a major or minor release, create an unannotated _devel_ tag in the
`main` branch, on the first commit that gets merged after the release
Expand Down
23 changes: 23 additions & 0 deletions charts/lws/.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/
24 changes: 24 additions & 0 deletions charts/lws/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: lws
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v0.4.2"
68 changes: 68 additions & 0 deletions charts/lws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# lws's helm chart

## Table of Contents

<!-- toc -->
- [Installation](#installation)
- [Prerequisites](#prerequisites)
- [Installing the chart](#installing-the-chart)
- [Install chart using Helm v3.0+](#install-chart-using-helm-v30)
- [Verify that controller pods are running properly.](#verify-that-controller-pods-are-running-properly)
- [Configuration](#configuration)
<!-- /toc -->

### Installation

Quick start instructions for the setup and configuration of lws using Helm.

#### Prerequisites

- [Helm](https://helm.sh/docs/intro/quickstart/#install-helm)
- (Optional) [Cert-manager](https://cert-manager.io/docs/installation/)

#### Installing the chart

##### Install chart using Helm v3.0+

```bash
$ git clone [email protected]:kubernetes-sigs/lws.git
$ cd charts
$ helm install lws lws --create-namespace --namespace lws-system
```

##### Verify that controller pods are running properly.

```bash
$ kubectl get deploy -n lws-system
NAME READY UP-TO-DATE AVAILABLE AGE
lws-system-controller-manager 1/1 1 1 14s
```

### Configuration

The following table lists the configurable parameters of the kueue chart and their default values.

| Parameter | Description | Default |
|---------------------------------------------|------------------------------------------------|--------------------------------------|
| `nameOverride` | nameOverride | `` |
| `fullnameOverride` | fullnameOverride | `` |
| `enablePrometheus` | enable Prometheus | `false` |
| `enableCertManager` | enable CertManager | `false` |
| `imagePullSecrets` | Image pull secrets | `[]` |
| `image.manager.repository` | Repository for manager image | `gcr.io/k8s-staging-lws/lws` |
| `image.manager.tag` | Tag for manager image | `main` |
| `image.manager.pullPolicy` | Pull policy for manager image | `IfNotPresent` |
| `image.kubeRbacProxy.repository` | Repository for kubeRbacProxy image | `gcr.io/kubebuilder/kube-rbac-proxy` |
| `image.kubeRbacProxy.tag` | Tag for kubeRbacProxy image | `v0.15.0` |
| `image.kubeRbacProxy.pullPolicy` | Pull policy for kubeRbacProxy image | `IfNotPresent` |
| `podAnnotations` | Annotations for pods | `{}` |
| `podSecurityContext.runAsNonRoot` | Run pod as non-root user | `true` |
| `securityContext.allowPrivilegeEscalation` | Allow privilege escalation in security context | `false` |
| `securityContext.capabilities.drop` | Drop all capabilities in security context | `["ALL"]` |
| `service.type` | Type of lws controller service | `ClusterIP` |
| `service.port` | Lws controller service port | `9443` |
| `resources.requests.cpu` | CPU request for resources | `1` |
| `resources.requests.memory` | Memory request for resources | `1Gi` |
| `nodeSelector` | Node selector | `{}` |
| `tolerations` | Tolerations | `{}` |
| `affinity` | Affinity | `{}` |
62 changes: 62 additions & 0 deletions charts/lws/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "lws.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 "lws.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 "lws.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

{{/*
Selector labels
*/}}
{{- define "lws.selectorLabels" -}}
app.kubernetes.io/name: {{ include "lws.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "lws.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "lws.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
29 changes: 29 additions & 0 deletions charts/lws/templates/certmanager/certifacate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if .Values.enableCertManager }}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
labels:
app.kubernetes.io/instance: serving-cert
{{- include "lws.labels" . | nindent 4 }}
name: lws-serving-cert
namespace: {{ .Release.Namespace }}
spec:
dnsNames:
- lws-webhook-service.{{ .Release.Namespace }}.svc
- lws-webhook-service.{{ .Release.Namespace }}.svc.cluster.local
issuerRef:
kind: Issuer
name: lws-selfsigned-issuer
secretName: lws-webhook-server-cert
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
labels:
app.kubernetes.io/instance: serving-cert
{{- include "lws.labels" . | nindent 4 }}
name: lws-selfsigned-issuer
namespace: {{ .Release.Namespace }}
spec:
selfSigned: {}
{{- end}}
Loading

0 comments on commit b34b2ce

Please sign in to comment.