-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update demoapp-backend and demoapp-frontend charts to support openshift
- Loading branch information
1 parent
9a7c56e
commit 4de0b90
Showing
12 changed files
with
234 additions
and
9 deletions.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Charts | ||
charts/**/Chart.lock | ||
charts/**/*.tgz |
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,2 +1,30 @@ | ||
# demoapp-helm-charts | ||
Helm Charts for deploying demoapp to Kubernetes and OpenShift | ||
|
||
## Deployment to OpenShift Local | ||
Prerequisites: | ||
1. [Red Hat OpenShift Local](https://developers.redhat.com/products/openshift-local/overview) | ||
|
||
Steps: | ||
1. Create `demo` project | ||
```sh | ||
# Login to OpenShift Local | ||
oc login -u kubeadmin https://api.crc.testing:6443 | ||
|
||
# Create project | ||
oc new-project demo | ||
``` | ||
2. Deploy `demoapp-backend` | ||
```sh | ||
cd charts/demoapp-backend | ||
helm dependency update . | ||
helm upgrade -i demoapp-backend . \ | ||
--values values-openshift-local.yaml | ||
``` | ||
3. Deploy `demoapp-frontend` | ||
```sh | ||
cd charts/demoapp-frontend | ||
helm dependency update . | ||
helm upgrade -i demoapp-frontend . \ | ||
--values values-openshift-local.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
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
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
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,29 @@ | ||
{{- if .Values.openshift.route.enabled }} | ||
# Expose application via OpenShift route | ||
apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
metadata: | ||
name: {{ include "demoapp-backend.fullname" . }} | ||
{{- with .Values.openshift.route.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
labels: | ||
{{- include "demoapp-backend.labels" . | nindent 4 }} | ||
spec: | ||
{{- if .Values.openshift.route.host }} | ||
host: {{ .Values.openshift.route.host }} | ||
{{- end }} | ||
path: {{ .Values.openshift.route.path }} | ||
port: | ||
targetPort: http | ||
to: | ||
kind: Service | ||
name: {{ include "demoapp-backend.fullname" . }} | ||
weight: 100 | ||
{{- with .Values.openshift.route.tls }} | ||
tls: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
wildcardPolicy: None | ||
{{- end }} |
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,15 @@ | ||
{{- if and .Values.openshift.enabled .Values.mysql.enabled }} | ||
# Binds `{{ .Values.openshift.scc.mysql }}` securitycontextconstraints to service account | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: scc-{{ .Values.openshift.scc.mysql }}-{{ .Release.Namespace }}-{{ .Values.mysql.fullnameOverride }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: system:openshift:scc:{{ .Values.openshift.scc.mysql }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ .Values.mysql.fullnameOverride }} | ||
namespace: {{ .Release.Namespace }} | ||
{{- end }} |
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,35 @@ | ||
--- | ||
# Values for deploying demoapp-frontend to OpenShift Local | ||
|
||
openshift: | ||
enabled: true # Is this deployment for OpenShift? | ||
# OpenShift route | ||
route: | ||
enabled: true # Create OpenShift route? | ||
annotations: | ||
# Forward route /api to to container / | ||
haproxy.router.openshift.io/rewrite-target: / | ||
host: demoapp.apps-crc.testing # Route host, autogenerated by cluster when unspecified | ||
path: /api | ||
tls: | ||
termination: edge | ||
# OpenShift SCC | ||
scc: | ||
mysql: privileged | ||
|
||
# Values for mysql: https://artifacthub.io/packages/helm/bitnami/mysql | ||
mysql: | ||
enabled: true | ||
# global | ||
global: | ||
storageClass: "" | ||
image: | ||
registry: docker.io | ||
repository: mysql | ||
ta: "8.0" | ||
auth: | ||
rootPassword: openshift-local | ||
# primary database | ||
primary: | ||
persistence: | ||
enabled: true |
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
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
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,12 +1,19 @@ | ||
--- | ||
# Values for deploying demoapp-frontend to OpenShift Local | ||
|
||
# Deployment container environment variables | ||
# https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#environment-variables | ||
env: | ||
- name: REACT_APP_DEMOAPP_BACKEND_URL | ||
value: https://demoapp.apps-crc.testing/api # URL should be accessible from the web browser | ||
|
||
openshift: | ||
enabled: true # Is this deployment for OpenShift? | ||
# OpenShift route | ||
route: | ||
enabled: true # Create OpenShift route? | ||
annotations: {} | ||
host: '' # Route host, autogenerated by cluster when unspecified | ||
host: demoapp.apps-crc.testing # Route host, autogenerated by cluster when unspecified | ||
path: / | ||
tls: | ||
termination: edge |
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