
Bringing Serverless to a Web Page Near You with Hugo and Kubernetes - alexellisuk
https://www.openfaas.com/blog/serverless-static-sites/
======
born2discover
While the article is a bit informative, it is hard to take it seriously. It
claims to bring "serverless" to a webpage near you, yet one of its
prerequisites is: "You need to have a Kubernetes cluster up & running.", which
implies a server (actually several), so not so "serverless" in the end.

The entire "serverless" movement seems to preach something that is impossible.
You can't have internet without a server. You can offload server management
and maintenance onto a provider, that is true, but you can't remove it
entirely from your stack. So preaching "serverless" architecture is
disingenuous and IMHO rather ignorant.

~~~
zzh8829
I agree the kubernetes part in the article is an overkill, but the serverless
movement is here to stay. I used to be a serverless skeptic like you. However,
after playing around with "serverless"[1] and AWS CDK[2], I truly believe
serverless architecture is not only possible but preferred in many real use
cases.

For example, API powered by traditional web cserver + database can be replaced
with lambda/function + dynamo/s3/firestore. Cron jobs can be replaced by cloud
scheduler + lambda/fargate/cloud run. As a serverless user, you really don't
interact with "servers", but instead a highly-available and scalable managed
task execution environment.

The only downside is each layer of compute abstraction comes at the cost of
spending more and more money.

[1]
[https://github.com/serverless/serverless](https://github.com/serverless/serverless)

[2]
[https://docs.aws.amazon.com/cdk/latest/guide/home.html](https://docs.aws.amazon.com/cdk/latest/guide/home.html)

~~~
collyw
And when you want to change from AWS, you are completely locked in, no?

~~~
octopoc
If you use one of the open serverless frameworks such as OpenFaaS (which is
what this article is about) then no you're not locked in.

BTW my team has investigated OpenFaaS to be able to share code between the
cloud and local installations, and if we do OpenFaaS looks promising. The
architecture is well documented and makes sense.

~~~
windexh8er
Using OpenFaaS on AWS doesn't exactly alleviate all of the lock-in. It locks
you in to a larger spend. This is because OpenFaaS is heavily dependent on,
generally, a k8s cluster that is going to be chewing through bill time 24/7\.
I think that's the trade-off: you pay to not be locked into Lambda. Personally
I don't think that's a bad thing, but I've seen plenty of times where
customers would balk because their initial serverless trials cost $5, $10, $15
a month but when running something that would be better for them longer term
it would initially be 4-8x that in opex. So they go the "easier" (cheaper)
path and build everything around that lock-in tooling.

------
xgulfie
Article might be a good intro to openFaas but please do not do this in
production.

Gitlab Pages and GitHub Pages will gladly host a git branch for you as a
static site. Gitlab has built in support for building static sites with any
command you want. They have more than enough infrastructure to host a static
site for you and it will take <1hr to set it up.

------
softwarelimits
This is one brilliant piece of modern technical humoristic literature, a genre
that is still rare and should get much more attention!

The author has written that really well, simulating a style that some cloud
marketing guys still will take serious. Of course every developer with some
background in webdev will start to chuckle after a few sentences, but he keeps
the flow on a very high level, great!

I wonder if some kind of NLP was involved and a second article with sources
attached will follow.

Very good piece of parody!

------
thomasedwards
Or you could just use Netlify with one click ;)

~~~
cameronbrown
Netlify is one of those services that just makes perfect sense. Perfect
vertical integration across the web stack.

------
ed_blackburn
Am loving the innovation and appreciate that the assumption here is if you've
already got Kubernetes then this can be useful. Otherwise, a Kubernetes
cluster is quite the pre-req for a static site generator that can run on the
command line or on a build server.

~~~
alexellisuk
So if you're new to OpenFaaS, it is a platform for building and shipping
applications on Kubernetes. We're talking about the big picture here, if you
have Kubernetes, you can now deploy static sites, blogs, micro services,
functions and lift+shift just about any other code.

~~~
saiyam911
Yes it's true, OpenFaas is something everyone should try even if they are a
beginner. Alex and the community have tons of blogs, workshops that you can
help you learn and implement production-ready solutions. Openfaas is making
Kubernetes development Easy. For static blogs, websites its really simple with
Openfaas.
[https://twitter.com/openfaas/status/1162414762652835841](https://twitter.com/openfaas/status/1162414762652835841)

------
tekkk
Looks like a major pain in the ass to manage. Why not use AWS Lambda or other
FAAS? And wait, the whole site is hosted with k8s using some Nginx server?
Where's the CDN and frankly, object storage like S3 would seem a much better
fit for the static assets.

If the point of using this is to learn how to use k8s for FAAS, great. If the
point is to save pennies and create a hassle-free deployment, I would rethink
the approach. I've heard good things about Netlify, although as a tinkerer
myself I used AWS and CloudFormation with Sceptre to create my site. As
unrelated note, if you are familiar with React you should probably consider
using Gatsby. It's much easier to extend and customize which happens quite
often once you start adding your own little cool widgets.

------
zeveb
I've used Hugo static pages, and I've used Kubernetes. Replacing the former
with the latter is _not_ a win for simplicity.

Static pages can easily be maintained well by a single person; Kubernetes is a
nasty king rat of pain and complexity which requires a team of highly-skilled
engineers and architects to do well. Its complexity _is_ worth it, in many
circumstances, but it is _not_ — repeat, _not_ — the first thing one should
reach for. Or the second, even.

------
ldoughty
There are a lot better options of you like Hugo or other static site
generators...

I have GitHub set up to push my merge requests to AWS Lambda. The lambda
downloads the specific Hugo release I deemed to run on, generates my pages, an
pushes to S3 + Cloudfront. Takes less than 10 seconds from merge to publish.
No servers. No services fees. Costs $13/year (95% domain fee). Truly
"serverless".

At some point I want to retry this on Gitlab, it seems to support the same
flow

~~~
icebraining
On Gitlab the flow is simpler, you can just add a configuration file to run
Hugo on the integrated CI and pass the generated files to the hosting:

[https://gohugo.io/hosting-and-deployment/hosting-on-
gitlab/](https://gohugo.io/hosting-and-deployment/hosting-on-gitlab/)

------
m90
I would honestly be interested in what the author(s) consider to be the
advantage of such a setup over things like for example GitHub Pages, Netlify,
S3 + Cloudfront, a plain Apache Server?

~~~
athorax
There is a note near the beginning:

"The goal of this tutorial is not to show you that you need a Kubernetes
cluster to run a static website, it’s to show what can be done with OpenFaaS
and Kubernetes."

I don't think it is being advocated that you should make this switch, just an
informative article showing the steps required to do so.

------
bhartzer
I’ve seen where someone has “hosted” an entire site on a router. Would that
qualify as serverless?

~~~
giancarlostoro
Serverless is purely a cloud marketing term for the next rendition of a web
CGI like solution we all used to do to make any programming language run
behind a web server, e.g. C, Python, and so on.

You can trigger it by other means, such as if a file is added to a cloud based
file storage (think Azure Blob Storage, not Google Drive, though it wouldn't
surprise me if that's a hook too) or something happens in your cloud based
database. Or old school: someone visits a URL.

The whole web aspect of serverless is just the most popular.

------
hn23
Have not looked into it but I feel that the headline qualifies for tech bs
bingo...

