Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm Chart #46

Merged
merged 10 commits into from
Feb 26, 2020
Merged

Helm Chart #46

merged 10 commits into from
Feb 26, 2020

Conversation

tri-adam
Copy link
Member

@tri-adam tri-adam commented Feb 25, 2020

Add initial Helm chart.

It is possible to test using Docker Desktop. First, build a server container locally. This needs to be tagged with appVersion, which is currently set to 0.1.0:

docker build -t server:0.1.0 -f build/docker/server/Dockerfile .

Next, fetch deps with helm:

helm dep build deployments/helm/fuzzball/

Then run the install. In my environment, setting image.pullPolicy=Never is enough for Docker Desktop to pull the image built above:

helm install --set image.pullPolicy=Never fb deployments/helm/fuzzball/

A minute or so later, you should have six pods running:

$ kubectl get po 
NAME                          READY   STATUS    RESTARTS   AGE
fb-fuzzball-5bffcdb8d-wck9m   1/1     Running   1          54s
fb-mongodb-6bbfbb797d-sbzlh   1/1     Running   0          54s
fb-nats-0                     1/1     Running   0          53s
fb-redis-master-0             1/1     Running   0          53s
fb-redis-slave-0              1/1     Running   0          53s
fb-redis-slave-1              1/1     Running   0          14s

At the moment, the service is not functional, as I haven't yet wired up the services to the server binary, which you can see from the logs:

$ kubectl logs deploy/fb-fuzzball
time="2020-02-25T21:49:09Z" level=info msg=starting name="Compute Server" org=Sylabs version=539a2ab
time="2020-02-25T21:49:09Z" level=info msg="connecting to database"
time="2020-02-25T21:49:39Z" level=error msg="failed to connect to database" error="server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection() : dial tcp 127.0.0.1:27017: connect: connection refused }, ] }"
time="2020-02-25T21:49:39Z" level=info msg=stopped name="Compute Server" org=Sylabs version=539a2ab

I will fix this once #47 is implemented.

@tri-adam tri-adam force-pushed the helm-chart branch 15 times, most recently from 00c7118 to 120aaa5 Compare February 25, 2020 21:27
@tri-adam tri-adam marked this pull request as ready for review February 25, 2020 21:51
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "fuzzball.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see service.port in values.yaml however this is hard-coded

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is OK, as its just referencing the first port in the kubectl port-forward command.

{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "fuzzball.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see service.port in values.yaml however this is hard-coded

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. And actually, I don't know why I'm using the pod here and not the service... will switch!

Copy link

@SylabsJess SylabsJess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tri-adam tri-adam merged commit 59177b0 into master Feb 26, 2020
@tri-adam tri-adam deleted the helm-chart branch February 26, 2020 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants