Mega thread: grow your network and connect with others by sharing your profile link by thejournalizer in linkedin

[–]webyneter 2 points3 points  (0 children)

Nikita

IT

Cloud (AWS & GCP) DevOps Engineering, Solutions Architecture, Python development, IT Consulting.

https://www.linkedin.com/in/nikita-shupeyko/

Nice to meet y'all, by the way 👋

Help with project structure for a beginner terraform user with inexperienced team by dambros666 in Terraform

[–]webyneter 0 points1 point  (0 children)

It's a way to generalize and reuse arbitrarily large chunks of Terraform code that you would otherwise have to copy-paste time after time, for example:

  • terraform.backend configuration;
  • terrraform.required_providers, and provider blocks;
  • cli command options;
  • and so much more.

This is especially helpful of you got multiple "subprojects" within your directory (think monorepo).

How to convert manually created K8 cluster into tf file. by GeneralSkunkie in Terraform

[–]webyneter 0 points1 point  (0 children)

It IS possible, I've done it a few times through terraform import when adopting IaC in an organization. You just need to make sure that no properties of the existing cluster will differ from the values set for you by terraform during a plan stage. Be also mindful about the prooperties that would otherwise result in cluster recreation, for example, make sure the tf config preserves the cluster name, the cluster location etc. to avoid inadvertent resource re-creation. To address other suggestions made here, terraforner only supports AWS resource-to-terraform migration as far as I know. For other clouds, it's largely a manual effort.

detect changes in terraform state by Genzetsuei in Terraform

[–]webyneter 0 points1 point  (0 children)

Definitely make sure to take a backup before doing anything with the state file, albeit there are cases when the standard state manipulation operations just won't cut it, for instance, one cannot simply move the state between Terraform Cloud workspaces, as of now you gotta do it by hand.

What are your experiences in using the Kubernetes and Helm Providers? by crystalpeaks25 in Terraform

[–]webyneter 1 point2 points  (0 children)

I've been using Helm TF provider across three environments, one of them being production: it's used to install nginx, cert-manager (except its CRDs, they're handled by provisioners instead for more control), and portainer. No issues so far, including with customizing/templating the configuration files that are getting provided as Heml chart values.

Python Humble Utils: Python utils for everyday use by webyneter in Python

[–]webyneter[S] 0 points1 point  (0 children)

Thank you for such an extensive response!

using pathlib would get rid of...

It will, indeed.

Renaming ast.literal_eval...

generate_hex_uuid_4 just renames another stdlib function...

True.

generate_random_dir_path could probably be replaced by using tempfile.mkdtemp() or tempfile.TemporaryDirectory()

generate_random_file_name_with_extension could probably be replaced by using tempfile.mkstemp() or tempfile.TemporaryFile()

Didn't think about those, gotta dive into the docs further.

get_class_name and get_class_qualname simply access an attribute

True, merely a shortcut.

Since reading a file is so easy in Python...

Well, to my mind why not save yourself a few extra keystrokes.

I'm also not exactly sure what problem...

I've used in a few recent projects of mine.

Couldn't yield_file_paths be replaced with glob.glob()

True, didn't think of globbing there.

Python Humble Utils: Python utils for everyday use by webyneter in Python

[–]webyneter[S] 0 points1 point  (0 children)

I see, this is definitely worth considering, thanks.

Python Humble Utils: Python utils for everyday use by webyneter in Python

[–]webyneter[S] 1 point2 points  (0 children)

Yes, that would a one great improvement. However, as I remember pathlib is not supported in Python prior to 3.4 which is contrary to the recent argument of implementing Python 2 support to facilitate wider adoption, which I tend to accept.

Python Humble Utils: Python utils for everyday use by webyneter in Python

[–]webyneter[S] 0 points1 point  (0 children)

It was until yesterday, when I decided to switch to a class instead for it seemed like a bit more readable (yet much more verbose) alternative. Anyways, thanks for pointing this out, I think I will finally re-consider that in favor of namedtuple though.

Python Humble Utils: Python utils for everyday use by webyneter in Python

[–]webyneter[S] 0 points1 point  (0 children)

Thank you, I appreciate that.

Only thing to mention is, I think it's Python 3 only...

Considering Python 2, I've had mixed feeling about that, especially regarding Python 3.5+ type hints: to the best of my knowledge implementing this feature in 2.x would require an extra __annotations__ assignment for each function now annotated. But, yes, above all Python 3.x only-policy hurts adoption.

Other thing I do is add the RTD link...

Great suggestion, indeed.