-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Kubernetes Helm Chart #2048
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
1b6ddb6
Re-commit 0f1bbc
Matthew-Beckett 85d5858
Remove Kubernetes native manifests
Matthew-Beckett d33df75
Add updated Helm chart
Matthew-Beckett 34f8c77
Change service default to ClusterIP and add helmignore
Matthew-Beckett 341cb34
Patch helm chart to stable with v3.5.0
Matthew-Beckett 559d05b
Update readme and service port
Matthew-Beckett 8fe7986
Add kubeval workflow
Matthew-Beckett 70b73d7
Add kubernetes version environment variable
Matthew-Beckett 96a78c9
Add checkout of repo
Matthew-Beckett e858d11
Merge branch 'master' into feature/helm3
Matthew-Beckett 40b1efa
Add echo command in NOTES to get password
hammady d323f4f
Add missing existingClaim in values.yaml comments
hammady fd241d5
Fix indentation for extra mounts
hammady 3570ff7
Merge pull request #14 from hammady/feature/helm3
Matthew-Beckett b4fd47b
Add support for hostPath volumes
hammady 83465a2
Simplify data volume mount
hammady 30fafc8
Merge pull request #15 from hammady/feature/helm3
Matthew-Beckett d7cba30
Merge branch 'master' into feature/helm3
Matthew-Beckett 7affce5
Merge branch 'v3.6.2' into feature/helm3
Matthew-Beckett f3d7d3f
Merge branch 'master' into feature/helm3
Matthew-Beckett 77c2a72
Bump version and update README
Matthew-Beckett 03aa770
Add maintainers
Matthew-Beckett 0e39bb9
Fix trailing line breaks
Matthew-Beckett 10799aa
Bump chart app version
Matthew-Beckett aa7415a
Update CODEOWNERS file
Matthew-Beckett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
* @code-asher @nhooyr | ||
charts/code-server @Matthew-Beckett @alexgorbatchev | ||
* @code-asher @nhooyr |
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,14 @@ | ||
name: Helm Validation | ||
|
||
on: [pull_request, issues] | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
- name: Kubeval Helm Chart | ||
uses: junior/[email protected] | ||
env: | ||
INPUT_KUBERNETES_VERSION: 1.19 |
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 | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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 @@ | ||
apiVersion: v2 | ||
name: code-server | ||
description: A Helm chart for cdr/code-server | ||
|
||
# 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: 1.0.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. | ||
appVersion: 3.6.2 |
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,114 @@ | ||||||
# code-server | ||||||
Matthew-Beckett marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.6.2](https://img.shields.io/badge/AppVersion-3.6.2-informational?style=flat-square) | ||||||
|
||||||
[code-server](https://github.com/cdr/code-server) code-server is VS Code running | ||||||
on a remote server, accessible through the browser. | ||||||
|
||||||
This chart is community maintained by [@Matthew-Beckett](https://github.com/Matthew-Beckett) and [@alexgorbatchev](https://github.com/alexgorbatchev) | ||||||
|
||||||
## TL;DR; | ||||||
|
||||||
```console | ||||||
$ git clone https://github.com/cdr/code-server.git | ||||||
$ helm install code-server/charts/code-server | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
``` | ||||||
|
||||||
## Introduction | ||||||
|
||||||
This chart bootstraps a code-server deployment on a | ||||||
[Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) | ||||||
package manager. | ||||||
|
||||||
## Prerequisites | ||||||
|
||||||
- Kubernetes 1.6+ | ||||||
|
||||||
## Installing the Chart | ||||||
|
||||||
To install the chart with the release name `my-release`: | ||||||
|
||||||
```console | ||||||
$ helm install --name my-release charts/code-server | ||||||
``` | ||||||
|
||||||
The command deploys code-server on the Kubernetes cluster in the default | ||||||
configuration. The [configuration](#configuration) section lists the parameters | ||||||
that can be configured during installation. | ||||||
|
||||||
> **Tip**: List all releases using `helm list` | ||||||
|
||||||
## Uninstalling the Chart | ||||||
|
||||||
To uninstall/delete the `my-release` deployment: | ||||||
|
||||||
```console | ||||||
$ helm delete my-release | ||||||
``` | ||||||
|
||||||
The command removes all the Kubernetes components associated with the chart and | ||||||
deletes the release. | ||||||
|
||||||
## Configuration | ||||||
|
||||||
The following table lists the configurable parameters of the code-server chart | ||||||
Matthew-Beckett marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
and their default values. | ||||||
|
||||||
## Values | ||||||
|
||||||
| Key | Type | Default | Description | | ||||||
|-----|------|---------|-------------| | ||||||
| affinity | object | `{}` | | | ||||||
| extraArgs | list | `[]` | | | ||||||
| extraConfigmapMounts | list | `[]` | | | ||||||
| extraContainers | string | `""` | | | ||||||
| extraSecretMounts | list | `[]` | | | ||||||
| extraVars | list | `[]` | | | ||||||
| extraVolumeMounts | list | `[]` | | | ||||||
| fullnameOverride | string | `""` | | | ||||||
| hostnameOverride | string | `""` | | | ||||||
| image.pullPolicy | string | `"Always"` | | | ||||||
| image.repository | string | `"codercom/code-server"` | | | ||||||
| image.tag | string | `"3.5.0"` | | | ||||||
| imagePullSecrets | list | `[]` | | | ||||||
| ingress.enabled | bool | `false` | | | ||||||
| nameOverride | string | `""` | | | ||||||
| nodeSelector | object | `{}` | | | ||||||
| persistence.accessMode | string | `"ReadWriteOnce"` | | | ||||||
| persistence.annotations | object | `{}` | | | ||||||
| persistence.enabled | bool | `true` | | | ||||||
| persistence.size | string | `"1Gi"` | | | ||||||
| podAnnotations | object | `{}` | | | ||||||
| podSecurityContext | object | `{}` | | | ||||||
| replicaCount | int | `1` | | | ||||||
| resources | object | `{}` | | | ||||||
| securityContext.enabled | bool | `true` | | | ||||||
| securityContext.fsGroup | int | `1000` | | | ||||||
| securityContext.runAsUser | int | `1000` | | | ||||||
| service.port | int | `8443` | | | ||||||
| service.type | string | `"ClusterIP"` | | | ||||||
| serviceAccount.create | bool | `true` | | | ||||||
| serviceAccount.name | string | `nil` | | | ||||||
| tolerations | list | `[]` | | | ||||||
| volumePermissions.enabled | bool | `true` | | | ||||||
| volumePermissions.securityContext.runAsUser | int | `0` | | | ||||||
|
||||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm | ||||||
install`. For example, | ||||||
|
||||||
```console | ||||||
$ helm install --name my-release \ | ||||||
--set persistence.enabled=false \ | ||||||
deployment/chart | ||||||
``` | ||||||
|
||||||
The above command sets the the persistence storage to false. | ||||||
|
||||||
Alternatively, a YAML file that specifies the values for the above parameters | ||||||
can be provided while installing the chart. For example, | ||||||
|
||||||
```console | ||||||
$ helm install --name my-release -f values.yaml deployment/chart | ||||||
``` | ||||||
|
||||||
> **Tip**: You can use the default [values.yaml](values.yaml) |
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,25 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if .Values.ingress.enabled }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
{{- range .paths }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "code-server.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "code-server.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "code-server.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
echo http://$SERVICE_IP:{{ .Values.service.port }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "code-server.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl port-forward $POD_NAME 8080:80 | ||
{{- end }} | ||
|
||
Administrator credentials: | ||
|
||
Password: echo $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "code-server.fullname" . }} -o jsonpath="{.data.password}" | base64 --decode) |
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,63 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "code-server.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 "code-server.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 "code-server.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "code-server.labels" -}} | ||
helm.sh/chart: {{ include "code-server.chart" . }} | ||
{{ include "code-server.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "code-server.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "code-server.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "code-server.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (include "code-server.fullname" .) .Values.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more automation is better for sure 👍🏼