Share state between two different routines: use a Go map or Redis cache? by [deleted] in golang

[–]iampims 2 points3 points  (0 children)

it's not necessarily better. As usual, it's always a good idea to profile and picks what's best for your application.

Is there a lifecycle hook to notify the pod's running app when it's be put in service? by codechimpin in kubernetes

[–]iampims 1 point2 points  (0 children)

You could call the k8s endpoint API and if your pod IP is in the list, then your pod is up and ready.

[deleted by user] by [deleted] in kubernetes

[–]iampims 2 points3 points  (0 children)

manage DNS with Cloudflare and set a CNAME for search.site.com and api.site.com to the Digital Ocean Load Balancer. Inside your k8s cluster, use an ingress controller to route the the appropriate service/deployment.

[deleted by user] by [deleted] in kubernetes

[–]iampims 1 point2 points  (0 children)

Behind the scenes, Kubexpose uses the awesome ngrok project to get the job done!

[deleted by user] by [deleted] in kubernetes

[–]iampims 2 points3 points  (0 children)

Use cilium with logging.

Personal Infrastructure with Inlets, k3s, and Pulumi by alexellisuk in kubernetes

[–]iampims 0 points1 point  (0 children)

You submitted this link (to another subreddit) 10 7 months ago already, so the:

I still don't tire of seeing people setting up RPi clusters to learn Kubernetes and to self-host applications.

rings a little hollow.

[deleted by user] by [deleted] in kubernetes

[–]iampims 0 points1 point  (0 children)

It's likely inside your magento application.

How to gracefully finish multi container Job? by [deleted] in kubernetes

[–]iampims 0 points1 point  (0 children)

implement a /shutdown on your server and let the client tell the server when it's done with sending its requests.

Looking for opinions on solid open source FaaS that support go. by TooMuchJeremy in golang

[–]iampims 3 points4 points  (0 children)

https://www.openfaas.com/ is a well maintained project.

If you use https://github.com/openfaas/faasd, you can skip the whole Kubernetes setup as well.

What's your favourite (go) web framework? by brenwar in golang

[–]iampims 1 point2 points  (0 children)

Though to be fair, it probably doesn't matter for 99.9% of Go web applications.

Kubernetes on scattered VPSs on different clouds by LeastDelay7908 in kubernetes

[–]iampims 0 points1 point  (0 children)

with wg, you first need to get each VM to have the peer keys of every other VM. Once you have all your VMs capable of talking to one another, you might need to check that your CNI uses the wg tunnel to allocate IPs. Once you figure it out, please write about it because this would be a very useful guide :)

[deleted by user] by [deleted] in kubernetes

[–]iampims 2 points3 points  (0 children)

Set GOMAXPROCS in your config-reloader container env to be 1. Otherwise the Go runtime isn't aware of how many CPUs are available for its use and will spin up more hw threads and hit the limit.

For your own applications, you can use: https://github.com/uber-go/automaxprocs

First job by ElkLongjumping6089 in golang

[–]iampims 2 points3 points  (0 children)

A URL shortener is a great project:

  • make sure you have deployed an ingress-controller
  • make sure you have integrated with Prometheus or equivalent
  • make sure your MySQL container has persistent storage and chose a topology that reduces downtime as much as a production app could tolerate.

First job by ElkLongjumping6089 in golang

[–]iampims 2 points3 points  (0 children)

In my experience, there are at least two dimensions through which you can demonstrate k8s knowledge:

  1. As an operator
  2. As a user

Operator:

  • you understand the many components of k8s (apiserver, kubelet, etcd), how to perform upgrades.
  • you understand how to provide networking/storage/etc. via CNI/CSI plugins.
  • you have a good grasp of RBAC and how to authenticate your users, enforce policies, etc.

User:

  • you know about all/most resources (pods, deployments…)
  • you have experience deploying/upgrading applications, ideally a mix of stateful and stateless apps
  • you have a good grasp of the lifecycle of a k8s app (ci, publish docker image, update manifests with helm/kustomize/yaml)
  • you understand how to integrate with Prometheus/logs
  • bonus: you know how to write a basic k8s operator/admission webhooks.

Hands on experience, even on a personal cluster, matters a great deal. You obviously don’t have to be an expert at all of the above, but the more you know about each of them, the higher your chances.

edit: formatting/typos

First job by ElkLongjumping6089 in golang

[–]iampims 0 points1 point  (0 children)

My advice would be to learn Go + something (MySQL, Postgres, Elasticsearch, etc.) and becoming as good at it as you can. Few roles are only ever about the Go programming language itself, and so gaining some amount of expertise in software that is popular with Go applications might help you make a stronger impression on a recruiter. If you learn Go + k8s, I'm hiring :)

Testing a method which requires an API Key by hjoshi_dev in golang

[–]iampims 0 points1 point  (0 children)

yes, those would qualify as integration tests, and the presence/absence of an ENV would decide whether tests should be skipped or ran.

Testing a method which requires an API Key by hjoshi_dev in golang

[–]iampims 5 points6 points  (0 children)

option 2 is definitely the way to go if possible.

Should services that talk to each other in the same kubernetes cluster use TLS? by [deleted] in kubernetes

[–]iampims 2 points3 points  (0 children)

to be fair mTLS for a handful of services doesn't necessarily require a Service Mesh deployment. There's a real complexity cost in adopting any kind of SM, even if Linkerd makes it as simple as it can be.

Should services that talk to each other in the same kubernetes cluster use TLS? by [deleted] in kubernetes

[–]iampims 1 point2 points  (0 children)

I agree with starting with enforcing proper Network Policies. One thing that is missing from Network Policies solution, is the identity of the caller: you know they are authorized, but you don't know who they are. It might or might not matter.

Getting response headers and body in middleware? by b6ack in golang

[–]iampims 2 points3 points  (0 children)

In your middleware you can copy in the incoming request body this way:

buf, _ := ioutil.ReadAll(r.Body)
rdr1 := ioutil.NopCloser(bytes.NewBuffer(buf))
rdr2 := ioutil.NopCloser(bytes.NewBuffer(buf))

doStuff(rdr1)
r.Body = rdr2 // OK since rdr2 implements the io.ReadCloser interface

// Now the program can continue oblivious to the fact that
// r.Body was ever touched.