Deploying go https servers

314 views
Skip to first unread message

Sankar

unread,
Mar 8, 2017, 2:02:50 PM3/8/17
to golang-nuts
Hi

I have written a golang REST API server and a react webapp that talks to this REST server. There is a mysql server that the golang server talks to. There is an init script with a bunch of SQL statements to create a few tables and indexes. Everything works fine in my local machine. I have bought a domain name too. I have a VM on cloud with ssh access. 

I wanted to find out if there are any good blog posts or talks or tutorials or "checklists" documenting the process to deploy such a golang server + a web front end behind a domain name (example.com for the react webapp and api.example.com for the golang) and both accessible only via HTTPS, with the API Server probably behind a load balancer, and all certificates being valid, etc.

I understand that I can use kubernetes for such orchestration. But I wanted to find out a deploy solution which could work reliably and easily (without depending on too many third party projects) on AWS. GKE does not exist in my region (India) and so cannot use Kube. Any pointers ?

Thanks.

Sankar

Shawn Milochik

unread,
Mar 8, 2017, 2:09:13 PM3/8/17
to golang-nuts
That sounds a good use-case for Ansible to me. It's pretty easy to use and get started. 

Sankar P

unread,
Mar 8, 2017, 10:49:37 PM3/8/17
to Sh...@milochik.com, golang-nuts
I am looking more for a checklist of things to do, rather than a set of tools.

2017-03-09 0:38 GMT+05:30 Shawn Milochik <shawn...@gmail.com>:
That sounds a good use-case for Ansible to me. It's pretty easy to use and get started. 

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/sTsDhJLKTqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Dragos Harabor

unread,
Mar 9, 2017, 11:43:44 PM3/9/17
to golang-nuts, Sh...@milochik.com


On Wednesday, March 8, 2017 at 7:49:37 PM UTC-8, Sankar wrote:
I am looking more for a checklist of things to do, rather than a set of tools.
2017-03-09 0:38 GMT+05:30 Shawn Milochik <shawn...@gmail.com>:
That sounds a good use-case for Ansible to me. It's pretty easy to use and get started. 

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/sTsDhJLKTqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sankar P

unread,
Mar 9, 2017, 11:48:30 PM3/9/17
to Dragos Harabor, golang-nuts, Sh...@milochik.com
Wow. This is a fantastic post. Thanks for sharing. I was expecting something like this only. 

To unsubscribe from this group and all its topics, send an email to golang-nuts+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Manlio Perillo

unread,
Mar 10, 2017, 2:46:51 AM3/10/17
to golang-nuts, Sh...@milochik.com
Il giorno venerdì 10 marzo 2017 05:43:44 UTC+1, Dragos Harabor ha scritto:

Nginx will do much more things for you, in addition of providing additional "security":

1) Serve custom pages in case of Go server out of service, as an example during an upgrade
2) Will server static files better, compared to Go standard HTTP server
3) Will provide a load balancing

When I deploy a web application written in Go I always use:
- Nginx as frontend
- Systemd as process manager
- Logrotate for log rotation


Manlio

Kevin Powick

unread,
Mar 10, 2017, 10:16:00 AM3/10/17
to golang-nuts
I know you're just looking for a checklist, but we found it better to use Caddy (built in Go) as our web, and then have our Go API service proxied via that.  It's pretty awesome because it's so easy to use Caddy in that way.

For example :

http://mydomain/mypage will serve up your page, but you can tell Caddy to route requests for http://mydomain/api/dosomething to the port behind your firewall that your Go service is running on.

Caddy also allows gives you http2 and automatic security via https


For us, the big advantage is that we could focus on our Go API service being only that, and not a web page server as well.

--
Kevin Powick

Sankar P

unread,
Mar 10, 2017, 10:33:29 PM3/10/17
to Kevin Powick, golang-nuts
Just curios to know if I am going to use kubernetes for deployment, would choosing Caddie make any difference (either good or bad) ? I will investigate myself later, but wanted to know your opinion, incase you have already done that. Thanks.

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/sTsDhJLKTqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Powick

unread,
Mar 10, 2017, 11:08:34 PM3/10/17
to golang-nuts, kpo...@gmail.com

I haven't done that, but with what little I do know about that type of deployment, I cannot see how choosing Caddy would make any difference.

If you do go that route, I would appreciate hearing about any success or problems that you have.

--
Kevin Powick
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages