Skip to content

Commit

Permalink
Fix minikube example
Browse files Browse the repository at this point in the history
  • Loading branch information
HenningCash committed Nov 4, 2021
1 parent 4cdfab8 commit 3721bc2
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/codefreak/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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: 0.1.0
version: 0.1.1

# 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
Expand Down
4 changes: 4 additions & 0 deletions charts/codefreak/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "codefreak.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
Expand Down
3 changes: 2 additions & 1 deletion charts/codefreak/templates/serviceaccount-rb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "codefreak.serviceAccountName" . }}-rb
namespace: {{ .Release.Namespace }}
# We create a role-bindung for our service account in another namespace
namespace: {{ default .Release.Namespace .Values.workspaces.namespace }}
subjects:
- kind: ServiceAccount
name: {{ include "codefreak.serviceAccountName" . }}
Expand Down
5 changes: 3 additions & 2 deletions charts/codefreak/templates/serviceaccount-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "codefreak.serviceAccountRoleName" . }}
namespace: {{ .Release.Namespace }}
# We create a role for our service account in another namespace
namespace: {{ default .Release.Namespace .Values.workspaces.namespace }}
rules:
- apiGroups: [""]
resources: ["pods", "configmaps", "services"]
resources: ["pods", "configmaps", "services", "pods/log"]
verbs: ["get", "watch", "list", "create", "delete"]
- apiGroups: ["networking.k8s.io"]
resources: ["ingresses"]
Expand Down
2 changes: 1 addition & 1 deletion charts/codefreak/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "codefreak.serviceAccountName" . }}
namespace: {{ default .Release.Namespace .Values.workspaces.namespace }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "codefreak.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
Expand Down
5 changes: 3 additions & 2 deletions charts/codefreak/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ image:
# Overrides the image tag whose default is the chart appVersion.
tag: ""

imagePullSecrets: [ ]
imagePullSecrets: []
hostAliases: []
nameOverride: ""
fullnameOverride: ""

Expand Down Expand Up @@ -106,7 +107,7 @@ workspaces:
# the Code FREAK server (which is not recommended)
namespace:
# If the above namespace is not empty the helm chart will create it
createNamespace: true
createNamespace: false
# Template that will be used to create workspace-URLs. If empty this will be "{{publicUrl}}/{workspaceIdentifier}"
baseUrlTemplate:
# CPU limit for workspaces. Must be a valid value for Pod's resource.limits[].cpu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,37 @@ Check that opening `http://codefreak` and `http://codefreak-workspaces` in your

## Install Code FREAK on minikube

1.
Please create a `cf-minikube-values.yml` file with the following contents and adjust the value of `hostAliases[0].ip`.

```yml
ingress:
enabled: true
hosts:
- host: codefreak
paths:
- path: /
pathType: Prefix

hostAliases:
# Please set this IP to the value of `minikube ip`
- ip: "192.168.49.2"
hostnames:
- "codefreak-workspaces"

workspaces:
baseUrlTemplate: http://codefreak-workspaces/{workspaceIdentifier}
createNamespace: true
namespace: my-workspace-namespace

```

Afterwards you can start the app using the following commands:

```
helm repo add codefreak https://codefreak.github.io/charts
helm repo update codefreak
helm install -f cf-minikube-values.yml my-codefreak-install codefreak/codefreak
```

You can check the progress using `kubectl -n default get pods --selector app.kubernetes.io/instance=my-codefreak-install`.
If the application is `Ready` the UI should be reachable at `http://codefreak` in your browser.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ ingress:
- path: /
pathType: Prefix

hostAliases:
- ip: "192.168.49.2"
hostnames:
- "codefreak-workspaces"

workspaces:
baseUrlTemplate: http://codefreak-workspaces/{workspaceIdentifier}
createNamespace: true
namespace: my-workspace-namespace

0 comments on commit 3721bc2

Please sign in to comment.