-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Add Gearman G2 chart #1421
Add Gearman G2 chart #1421
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
description: G2 by AppsCode - Gearman in Golang | ||
name: g2 | ||
version: 0.1.0 | ||
appVersion: 0.5.0 | ||
home: https://github.com/appscode/g2 | ||
icon: https://cdn.appscode.com/images/icon/g2.png | ||
sources: | ||
- https://github.com/appscode/g2 | ||
maintainers: | ||
- name: appscode | ||
email: [email protected] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# G2 | ||
[G2 by AppsCode](https://github.com/appscode/g2) is a modern implementation of Gearman server in GO. | ||
## TL;DR; | ||
|
||
```bash | ||
$ helm install stable/g2 | ||
``` | ||
|
||
## Introduction | ||
|
||
This chart bootstraps a [Gearman server](https://github.com/appscode/g2) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. | ||
|
||
|
||
## Prerequisites | ||
|
||
- Kubernetes 1.3+ | ||
|
||
## Installing the Chart | ||
To install the chart with the release name `my-release`: | ||
```bash | ||
$ helm install --name my-release stable/g2 | ||
``` | ||
The command deploys G2 Gearman 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`: | ||
|
||
```bash | ||
$ helm delete my-release | ||
``` | ||
|
||
The command removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
## Configuration | ||
|
||
The following tables lists the configurable parameters of the Stash chart and their default values. | ||
|
||
|
||
| Parameter | Description | Default | | ||
| ------------------------ | ----------------------------------------------------------------- | ------------------- | | ||
| `replicaCount` | Number of stash operator replicas to create | `1` | | ||
| `g2.image` | G2 container image | `appscode/gearmand` | | ||
| `g2.tag` | G2 container image tag | `0.5.0` | | ||
| `g2.pullPolicy` | G2 container image pull policy | `IfNotPresent` | | ||
| `g2.serviceType` | G2 service type | `ClusterIP` | | ||
| `rbac.install` | install required rbac service account, roles and rolebindings | `false` | | ||
| `rbac.apiVersion` | rbac api version `v1alpha1|v1beta1` | `v1beta1` | | ||
|
||
|
||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example: | ||
|
||
```bash | ||
$ helm install --name my-release --set image.tag=v0.2.1 stable/g2 | ||
``` | ||
|
||
Alternatively, a YAML file that specifies the values for the parameters can be provided while | ||
installing the chart. For example: | ||
|
||
```bash | ||
$ helm install --name my-release --values values.yaml stable/g2 | ||
``` | ||
|
||
## RBAC | ||
By default the chart will not install the recommended RBAC roles and rolebindings. | ||
|
||
To determine if your cluster supports this running the following: | ||
|
||
```console | ||
$ kubectl api-versions | grep rbac | ||
``` | ||
|
||
You also need to have the following parameter on the api server. See the following document for how to enable [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/) | ||
|
||
``` | ||
--authorization-mode=RBAC | ||
``` | ||
|
||
If the output contains "beta" or both "alpha" and "beta" you can may install with enabling the creating of rbac resources (see below). | ||
|
||
### Enable RBAC role/rolebinding creation | ||
|
||
To enable the creation of RBAC resources (On clusters with RBAC). Do the following: | ||
|
||
```console | ||
$ helm install --name my-release stable/g2 --set rbac.install=true | ||
``` | ||
|
||
### Changing RBAC manifest apiVersion | ||
|
||
By default the RBAC resources are generated with the "v1beta1" apiVersion. To use "v1alpha1" do the following: | ||
|
||
```console | ||
$ helm install --name my-release stable/g2 --set rbac.install=true,rbac.apiVersion=v1alpha1 | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
To verify that G2 has started, run: | ||
|
||
kubectl --namespace={{ .Release.Namespace }} get deployments -l "release={{ .Release.Name }}, app={{ template "name" . }}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
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. This is an outdated version of the file with wrong truncation. Update it from this example: https://github.com/kubernetes/helm/blob/master/docs/examples/nginx/templates/_helpers.tpl |
||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "fullname" -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}} | ||
{{- end -}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "fullname" . }} | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
app: "{{ template "name" . }}" | ||
heritage: "{{ .Release.Service }}" | ||
release: "{{ .Release.Name }}" | ||
spec: | ||
replicas: {{.Values.replicaCount}} | ||
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. Add space after |
||
template: | ||
metadata: | ||
labels: | ||
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.
|
||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
app: "{{ template "name" . }}" | ||
heritage: "{{ .Release.Service }}" | ||
release: "{{ .Release.Name }}" | ||
spec: | ||
{{- if .Values.rbac.install }} | ||
serviceAccountName: {{ template "fullname" . }} | ||
{{- end }} | ||
containers: | ||
- args: | ||
- run | ||
- --storage-dir=/var/db | ||
- --v=5 | ||
image: '{{.Values.g2.image}}:{{.Values.g2.tag}}' | ||
imagePullPolicy: '{{.Values.g2.pullPolicy}}' | ||
name: gearman-server | ||
ports: | ||
- containerPort: 4730 | ||
name: http | ||
protocol: TCP | ||
- containerPort: 3000 | ||
name: restapi | ||
protocol: TCP | ||
volumeMounts: | ||
- mountPath: /var/db | ||
name: data-volume | ||
volumes: | ||
- emptyDir: {} | ||
name: data-volume |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{{ if .Values.rbac.install }} | ||
{{- $serviceName := include "fullname" . -}} | ||
apiVersion: rbac.authorization.k8s.io/{{ required "A valid .Values.rbac.apiVersion entry required!" .Values.rbac.apiVersion }} | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ $serviceName }} | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
app: "{{ template "fullname" . }}" | ||
heritage: "{{ .Release.Service }}" | ||
release: "{{ .Release.Name }}" | ||
rules: | ||
- apiGroups: | ||
- extensions | ||
resources: | ||
- deployments | ||
verbs: ["get", "create", "update"] | ||
- apiGroups: [""] | ||
resources: | ||
- services | ||
verbs: ["create", "update"] | ||
- apiGroups: [""] | ||
resources: | ||
- pods | ||
verbs: ["list", "create", "update", "delete"] | ||
--- | ||
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. Please create separate file. |
||
apiVersion: rbac.authorization.k8s.io/{{ required "A valid .Values.rbac.apiVersion entry required!" .Values.rbac.apiVersion }} | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ $serviceName }} | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
app: "{{ template "fullname" . }}" | ||
heritage: "{{ .Release.Service }}" | ||
release: "{{ .Release.Name }}" | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ $serviceName }} | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ $serviceName }} | ||
{{ end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{ if .Values.rbac.install }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ template "fullname" . }} | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
app: "{{ template "fullname" . }}" | ||
heritage: "{{ .Release.Service }}" | ||
release: "{{ .Release.Name }}" | ||
{{ end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "fullname" . }} | ||
labels: | ||
app: "{{ template "name" . }}" | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: "{{ .Release.Name }}" | ||
heritage: "{{ .Release.Service }}" | ||
spec: | ||
ports: | ||
- name: http | ||
port: 4730 | ||
protocol: TCP | ||
targetPort: http | ||
- name: restapi | ||
port: 3000 | ||
protocol: TCP | ||
targetPort: restapi | ||
selector: | ||
app: "{{ template "name" . }}" | ||
release: "{{ .Release.Name }}" | ||
type: '{{.Values.g2.serviceType}}' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
replicaCount: 1 | ||
g2: | ||
image: appscode/gearmand | ||
pullPolicy: IfNotPresent | ||
tag: 0.5.0 | ||
serviceType: ClusterIP | ||
rbac: | ||
install: false | ||
apiVersion: v1beta1 |
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.
Incorrect grammar. Try to improve the wording.