updated chart to support random manager password, pvcs, etc

This commit is contained in:
Sameer Naik
2016-12-20 11:09:31 +05:30
parent c0602becc2
commit 4ece922355
8 changed files with 124 additions and 81 deletions
+2 -1
View File
@@ -1,5 +1,5 @@
name: wildfly
version: 0.3.6
version: 0.4.0
description: Chart for Wildfly
keywords:
- wildfly
@@ -15,3 +15,4 @@ maintainers:
- name: Bitnami
email: containers@bitnami.com
engine: gotpl
icon: https://bitnami.com/assets/stacks/wildfly/img/wildfly-stack-110x117.png
+31 -67
View File
@@ -1,40 +1,31 @@
# Wildfly
# WildFly
[Wildfly](http://wildfly.org/) formerly known as JBoss AS, or simply JBoss, is an application server authored by JBoss, now developed by Red Hat. WildFly is written in Java, and implements the Java Platform, Enterprise Edition (Java EE) specification.
## TL;DR;
```bash
$ helm install wildfly-x.x.x.tgz
```console
$ helm install incubator/wildfly
```
## Introduction
Bitnami charts for Helm are carefully engineered, actively maintained and are the quickest and easiest way to deploy containers on a Kubernetes cluster that are ready to handle production workloads.
This chart bootstraps a [WildFly](https://github.com/bitnami/bitnami-docker-wildfly) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
This chart bootstraps a [Wildfly](https://github.com/bitnami/bitnami-docker-wildfly) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
## Prerequisites
## Get this chart
Download the latest release of the chart from the [releases](../../../releases) page.
Alternatively, clone the repo if you wish to use the development snapshot:
```bash
$ git clone https://github.com/bitnami/charts.git
```
- Kubernetes 1.4+ with Beta APIs enabled
- PV provisioner support in the underlying infrastructure
## Installing the Chart
To install the chart with the release name `my-release`:
```bash
$ helm install --name my-release wildfly-x.x.x.tgz
```console
$ helm install --name my-release incubator/wildfly
```
*Replace the `x.x.x` placeholder with the chart release version.*
The command deploys Wildfly on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
The command deploys WildFly 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`
@@ -42,7 +33,7 @@ The command deploys Wildfly on the Kubernetes cluster in the default configurati
To uninstall/delete the `my-release` deployment:
```bash
```console
$ helm delete my-release
```
@@ -50,71 +41,44 @@ The command removes all the Kubernetes components associated with the chart and
## Configuration
The following tables lists the configurable parameters of the Wildfly chart and their default values.
The following tables lists the configurable parameters of the WildFly chart and their default values.
| Parameter | Description | Default |
|-------------------|-----------------------------|---------------------------------------------------------|
| `imageTag` | `bitnami/wildfly` image tag | Wildfly image version |
| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` |
| `wildflyUsername` | Admin user | `user` |
| `wildflyPassword` | Admin password | `nil` |
| Parameter | Description | Default |
|----------------------------|----------------------------------------|----------------------------------------------------------|
| `image` | WildFly image | `bitnami/wildfly:{VERSION}` |
| `imagePullPolicy` | Image pull policy | `Always` if `image` tag is `latest`, else `IfNotPresent` |
| `wildflyUsername` | WildFly admin user | `user` |
| `wildflyPassword` | WildFly admin password | _random 10 character alphanumeric string_ |
| `serviceType` | Kubernetes Service type | `LoadBalancer` |
| `persistence.enabled` | Enable persistence using PVC | `true` |
| `persistence.storageClass` | PVC Storage Class for WildFly volume | `generic` |
| `persistence.accessMode` | PVC Access Mode for WildFly volume | `ReadWriteOnce` |
| `persistence.size` | PVC Storage Request for WildFly volume | `8Gi` |
| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` |
The above parameters map to the env variables defined in [bitnami/wildfly](http://github.com/bitnami/bitnami-docker-wildfly). For more information please refer to the [bitnami/wildfly](http://github.com/bitnami/bitnami-docker-wildfly) image documentation.
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```bash
```console
$ helm install --name my-release \
--set wildflyUser=manager,wildflyPassword=password \
wildfly-x.x.x.tgz
```
The above command sets the Wildfly management username and password to `manager` and `password` respectively.
The above command sets the WildFly management username and password to `manager` and `password` respectively.
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 -f values.yaml wildfly-x.x.x.tgz
```console
$ helm install --name my-release -f values.yaml incubator/wildfly
```
> **Tip**: You can use the default [values.yaml](values.yaml)
## Persistence
The [Bitnami Wildfly](https://github.com/bitnami/bitnami-docker-wildfly) image stores the Wildfly data and configurations at the `/bitnami/wildfly` path of the container.
The [Bitnami WildFly](https://github.com/bitnami/bitnami-docker-wildfly) image stores the WildFly data and configurations at the `/bitnami/wildfly` path of the container.
As a placeholder, the chart mounts an [emptyDir](http://kubernetes.io/docs/user-guide/volumes/#emptydir) volume at this location.
> *"An emptyDir volume is first created when a Pod is assigned to a Node, and exists as long as that Pod is running on that node. When a Pod is removed from a node for any reason, the data in the emptyDir is deleted forever."*
For persistence of the data you should replace the `emptyDir` volume with a persistent [storage volume](http://kubernetes.io/docs/user-guide/volumes/), else the data will be lost if the Pod is shutdown.
### Step 1: Create a persistent disk
You first need to create a persistent disk in the cloud platform your cluster is running. For example, on GCE you can use the `gcloud` tool to create a [gcePersistentDisk](http://kubernetes.io/docs/user-guide/volumes/#gcepersistentdisk):
```bash
$ gcloud compute disks create --size=500GB --zone=us-central1-a wildfly-data-disk
```
### Step 2: Update `templates/deployment.yaml`
Replace:
```yaml
volumes:
- name: wildfly-data
emptyDir: {}
```
with
```yaml
volumes:
- name: wildfly-data
gcePersistentDisk:
pdName: wildfly-data-disk
fsType: ext4
```
[Install](#installing-the-chart) the chart after making these changes.
Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube.
See the [Configuration](#configuration) section to configure the PVC or to disable persistence.
+30
View File
@@ -0,0 +1,30 @@
** Please be patient while the chart is being deployed **
1. Get the WildFly URL by running:
{{- if contains "NodePort" .Values.serviceType }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "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.serviceType }}
** Please ensure an external IP is associated to the {{ template "fullname" . }} service before proceeding **
** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }} **
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo URL : http://$SERVICE_IP/
echo Management Url : http://$SERVICE_IP:9990/
{{- else if contains "ClusterIP" .Values.serviceType }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo URL : http://127.0.0.1:8080/
echo Management URL : http://127.0.0.1:9990/
kubectl port-forward $POD_NAME 8080:8080 9990:9990
{{- end }}
2. Login with the following credentials
echo Username: {{ .Values.wildflyUsername }}
echo Password: $(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.wildfly-password[*]}"`))
+10 -7
View File
@@ -8,18 +8,14 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
replicas: 1
template:
metadata:
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
containers:
- name: {{ template "fullname" . }}
image: "bitnami/wildfly:{{ .Values.imageTag }}"
image: "{{ .Values.image }}"
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
env:
- name: WILDFLY_USERNAME
@@ -38,17 +34,24 @@ spec:
httpGet:
path: /
port: http
initialDelaySeconds: 60
initialDelaySeconds: 120
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
initialDelaySeconds: 30
timeoutSeconds: 1
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- name: wildfly-data
mountPath: /bitnami/wildfly
volumes:
- name: wildfly-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}
{{- else }}
emptyDir: {}
{{- end -}}
+19
View File
@@ -0,0 +1,19 @@
{{- if .Values.persistence.enabled -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- end -}}
+4
View File
@@ -9,4 +9,8 @@ metadata:
heritage: "{{ .Release.Service }}"
type: Opaque
data:
{{ if .Values.wildflyPassword }}
wildfly-password: {{ default "" .Values.wildflyPassword | b64enc | quote }}
{{ else }}
wildfly-password: {{ randAlphaNum 10 | b64enc | quote }}
{{ end }}
+2 -2
View File
@@ -8,11 +8,11 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
type: LoadBalancer
type: {{ .Values.serviceType }}
ports:
- name: http
port: 80
targetPort: 8080
targetPort: http
- name: mgmt
port: 9990
targetPort: mgmt
+26 -4
View File
@@ -1,10 +1,10 @@
## Bitnami Wildfly image version
## Bitnami WildFly image version
## ref: https://hub.docker.com/r/bitnami/wildfly/tags/
##
imageTag: 10.1.0-r3
image: bitnami/wildfly:10.1.0-r3
## Specify a imagePullPolicy
## 'Always' if imageTag is 'latest', else set to 'IfNotPresent'
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
# imagePullPolicy:
@@ -17,4 +17,26 @@ wildflyUsername: user
## Admin password
## ref: https://github.com/bitnami/bitnami-docker-wildfly#creating-a-custom-user
##
wildflyPassword: password
# wildflyPassword:
## Kubernetes configuration
## For minikube, set this to NodePort, elsewhere use LoadBalancer
##
serviceType: LoadBalancer
## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
persistence:
enabled: true
storageClass: generic
accessMode: ReadWriteOnce
size: 8Gi
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources:
requests:
memory: 512Mi
cpu: 300m