Skip to content

Commit

Permalink
Update chart readme
Browse files Browse the repository at this point in the history
  • Loading branch information
WSMathias committed Jul 15, 2020
1 parent d34c460 commit 54ef448
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 64 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
name: drupal
version: 1.1.0
appVersion: 1.1.0
description: drupal helm charts.
version: 1.0.0
appVersion: 1.0.0
description: drupal helm charts .
keywords:
- drupal
- php
Expand Down
26 changes: 15 additions & 11 deletions starterkits/ezcontent8-php-fpm-apache/charts/drupal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,25 @@ The following table lists the configurable parameters of the drupal chart and th

| Parameter | Description | Default |
| --------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------- |
| `global.imageRegistry` | Global Docker image registry | `nil` |
| `global.storageClass` | Global storage class for dynamic provisioning | `nil` |
| `image.registry` | drupal image registry | `501705404328.dkr.ecr.ap-southeast-1.amazonaws.com` |
| `image.repository` | drupal image name | `drupal-dev` |
| `image.tag` | drupal image tag | `{TAG_NAME}` |
| `image.pullPolicy` | drupal image pull policy | `IfNotPresent` |
| `global.imageRegistry` | Global Docker image registry | `docker.io` |
| `phpfpm.registry` | PHP-FPM image registry | `nil` |
| `phpfpm.repository` | PHP-FPM image name | `drupal:8` |
| `phpfpm.pullPolicy` | PHP-FPM image pull policy | `IfNotPresent` |
| `phpfpm.extraEnv` | PHP-FPM container environment variables | `nill` |
| `phpfpm.command` | PHP-FPM container entry point | from image |
| `phpfpm.arg` | PHP-FPM container arguments | from image |
| `phpfpm.port` | PHP-FPM container listing port | 9000 |
| `webserver.registry` | Web Server image registry | `nil` |
| `webserver.repository` | Web Server image name | `drupal:8` |
| `webserver.pullPolicy` | Web Server image pull policy | `IfNotPresent` |
| `webserver.extraEnv` | Web Server container environment variables | `nill` |
| `webserver.command` | Web Server container entry point | from image |
| `webserver.arg` | Web Server container arguments | from image |
| `webserver.port` | Web Server container listing port | 8080 |
| `nameOverride` | String to partially override drupal.fullname template | `nil` |
| `fullnameOverride` | String to fully override drupal.fullname template | `nil` |
| `initSecret.registry` | initSecret image registry | `501705404328.dkr.ecr.ap-southeast-1.amazonaws.com` |
| `initSecret.repository` | initSecret image name | `init-secret` |
| `initSecret.tag` | initSecret image tag | `{TAG_NAME}` |
| `initSecret.pullPolicy` | initSecret image pull policy | `IfNotPresent` |
| `applicationKind` | Deployment or ReplicaSet | `Deployment` |
| `replicas` | Number of replicas for the application | `1` |
| `applicationPort` | Port where the application will be running | `3000` |
| `extraEnv` | Any extra environment variables to be pass to the pods | `{}` |
| `affinity` | Map of drupal/pod affinities | `{}` (The value is evaluated as a template) |
| `drupalSelector` | drupal labels for pod assignment | `{}` (The value is evaluated as a template) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "drupal.name" -}}
{{- define "drupal.appName" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

Expand Down Expand Up @@ -34,7 +34,7 @@ Create chart name and version as used by the chart label.
Common labels
*/}}
{{- define "drupal.labels" -}}
app: {{ include "drupal.name" . }}
app: {{ include "drupal.appName" . }}
chart: {{ include "drupal.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
Expand All @@ -44,7 +44,7 @@ heritage: {{ .Release.Service }}
Common labels for cron-jobs to be used for deletion
*/}}
{{- define "drupal.cronLabels" -}}
app: {{ include "drupal.name" . }}
app: {{ include "drupal.appName" . }}
chart: {{ include "drupal.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
Expand All @@ -55,17 +55,16 @@ workload: cronjob
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
*/}}
{{- define "drupal.matchLabels" -}}
app: {{ include "drupal.name" . }}
app: {{ include "drupal.appName" . }}
release: {{ .Release.Name }}
{{- end -}}

{{/*
Return the proper Apache image name
Return the proper Web Server image name
*/}}
{{- define "apache.image" -}}
{{- $registryName := .Values.apache.image.registry -}}
{{- $repositoryName := .Values.apache.image.repository -}}
{{- $tag := .Values.apache.image.tag | toString -}}
{{- define "webserver.image" -}}
{{- $registryName := .Values.webserver.image.registry -}}
{{- $repositoryName := .Values.webserver.image.repository -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,43 @@ spec:
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }}
containers:
- name: apache
image: {{ template "apache.image" . }}
imagePullPolicy: {{ .Values.apache.image.pullPolicy | quote }}
workingDir: /app
# command: ["/bin/sh", "-c"]
# args:
# - "/start.sh"
- name: webserver
image: {{ template "webserver.image" . }}
imagePullPolicy: {{ .Values.webserver.image.pullPolicy | quote }}
{{- if .Values.webserver.command }}
command: {{- toYaml .Values.webserver.command | nindent 12 }}
{{- end }}
{{- if .Values.webserver.args }}
args: {{- toYaml .Values.webserver.args | nindent 12 }}
{{- end }}
ports:
- name: apache
containerPort: {{ .Values.apache.applicationPort }}
- name: webserver
containerPort: {{ .Values.webserver.port }}
livenessProbe:
{{ toYaml .Values.apache.livenessProbe | indent 12 }}
{{ toYaml .Values.webserver.livenessProbe | indent 12 }}
readinessProbe:
{{ toYaml .Values.apache.readinessProbe | indent 12 }}
{{- if .Values.apache.resources }}
resources: {{- toYaml .Values.apache.resources | nindent 12 }}
{{ toYaml .Values.webserver.readinessProbe | indent 12 }}
{{- if .Values.webserver.resources }}
resources: {{- toYaml .Values.webserver.resources | nindent 12 }}
{{- end }}
- name: php
image: {{ template "phpfpm.image" . }}
imagePullPolicy: {{ .Values.phpfpm.image.pullPolicy | quote }}
envFrom:
- secretRef:
name: {{ template "drupal.fullname" . }}
workingDir: /app
# command: ["/bin/sh", "-c"]
# args:
# - "/start.sh"
{{- if .Values.phpfpm.extraEnv }}
env: {{- toYaml .Values.phpfpm.extraEnv | nindent 12 }}
{{- end }}
{{- if .Values.phpfpm.command }}
command: {{- toYaml .Values.phpfpm.command | nindent 12 }}
{{- end }}
{{- if .Values.phpfpm.args }}
args: {{- toYaml .Values.phpfpm.args | nindent 12 }}
{{- end }}
ports:
- name: phpfpm
containerPort: {{ .Values.phpfpm.applicationPort }}
containerPort: {{ .Values.phpfpm.port }}
livenessProbe:
{{ toYaml .Values.phpfpm.livenessProbe | indent 12 }}
readinessProbe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
kind: {{ .Values.applicationKind }}
name: {{ template "drupal.fullname" . }}
minReplicas: {{ .Values.HPA.minReplicas }}
maxReplicas: {{ .Values.HPA.maxReplicas }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
ports:
- name: http
port: {{ .Values.service.port }}
targetPort: apache
targetPort: webserver
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePort)) }}
nodePort: {{ .Values.service.nodePort }}
{{- else if eq .Values.service.type "ClusterIP" }}
Expand Down
55 changes: 34 additions & 21 deletions starterkits/ezcontent8-php-fpm-apache/charts/drupal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
# global:
# imageRegistry: myRegistryName
global:
imageRegistry: docker.io

phpfpm:
image:
registry: docker.io
repository: srijanlabs/drupal
# registry: docker.io
repository: srijanlabs/drupal:8
## tag:
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
Expand All @@ -23,7 +24,19 @@ phpfpm:

## Specify the port where your application will be running
##
applicationPort: 9000
port: 9000


## Container Entrypoint
# command: ["/bin/sh", "-c"]

## Container Command
# args: ["/start.sh"]

## Envinronment variable to be passed to phpfpm container
extraEnv:
# - name: key
# value: value

## Node conatiners' resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
Expand Down Expand Up @@ -57,11 +70,11 @@ phpfpm:
initialDelaySeconds: 15
periodSeconds: 20


apache:
## Apache or Nginx web server container
webserver:
image:
registry: docker.io
repository: srijanlabs/drupal
# registry: docker.io
repository: srijanlabs/drupal:8
## tag:
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
Expand All @@ -77,7 +90,13 @@ apache:

## Specify the port where your application will be running
##
applicationPort: 8080
port: 8080

## Container Entrypoint
# command: ["/bin/sh", "-c"]

## Container Command
# args: ["/start.sh"]

## Node conatiners' resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
Expand All @@ -100,31 +119,25 @@ apache:
## module that alters that route, or an image that does not auto-install Drupal.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
#
# livenessProbe:
livenessProbe:
httpGet:
path: /user/login
port: apache
port: webserver
initialDelaySeconds: 120
readinessProbe:
httpGet:
path: /user/login
port: apache
port: webserver
initialDelaySeconds: 30

## String to partially override node.fullname template (will maintain the release name)
## String to partially override drupal.fullname template (will maintain the release name)
##
# nameOverride:

## String to fully override node.fullname template
## String to fully override drupal.fullname template
##
# fullnameOverride:

## Application password
## Defaults to a random 10-character alphanumeric string if not set
## ref: https://github.com/bitnami/bitnami-docker-drupal#configuration
##
# drupalPassword:

## K8S Object type
## Supported values are ReplicaSet and Deployment
applicationKind: Deployment
Expand Down

0 comments on commit 54ef448

Please sign in to comment.