#random (2024-01)
Non-work banter and water cooler conversation
A place for non-work-related flimflam, faffing, hodge-podge or jibber-jabber you’d prefer to keep out of more focused work-related channels.
Archive: https://archive.sweetops.com/random/
2024-01-01
https://kcl-lang.io/blog/2023-12-25-ten-ways-for-kubernetes-config-management Today’s reading. 《10 Ways for Kubernetes Declarative Configuration Management》. How much do you know about these? Welcome to add more comments.
Kubernetes has become the de facto standard for managing containerized applications. However, with its widespread adoption, the complexity of managing its configuration has also increased. To address this complexity, Kubernetes’ declarative configuration management model has emerged to simplify this process. In this article, we will explore what Kubernetes declarative configuration is, why it is necessary, and the various ways it can be managed.
2024-01-02
If there are any other Vim fans out there, I wrote a little article on configuring autocompletion for Terraform if anyone is interested! https://dev.to/rosesecurity/boost-your-productivity-with-terraform-autocompletion-in-vim-4lik
Pure Vim Every so often, when the struggle of jumping between IDE windows, tabs, and…
Is there an alternative for Neovim or Helix?
Pure Vim Every so often, when the struggle of jumping between IDE windows, tabs, and…
I used vi for >20 years but found Neovim is really good with Lua
There is! The docs here explain how to configure it, but I have not fully explored it
Usage of Terraform Language Server
This guide assumes you have installed the server by following instructions
in the README.md if that is applicable to your client
(i.e. if the client doesn’t download the server itself).
The following filetypes are supported by the Terraform Language Server:
• terraform
- standard *.tf
config files
• terraform-vars
- variable files (*.tfvars
)
NOTE Clients should be configured to follow the above language ID conventions
and do not send *.tf.json
, *.tfvars.json
nor Packer HCL config
nor any other HCL config files as the server is not
equipped to handle these file types.
In most clients with a dedicated Terraform extension/plugin this is
already the default configuration, so you should not need to worry about it.
Instructions for popular IDEs are below and pull requests
for updates or addition of more IDEs are welcomed.
See also settings to understand
how you may configure the settings.
Workspaces / Folders / Files
Most editors support opening folders. Such a root folder is commonly referred to
as “workspace”. Opening folders is always preferred over individual files
as it allows the language server to index the whole folder and keep track
of changes more easily. We do however support “single-file mode” which provides
limited IntelliSense.
Indexing enables IntelliSense related to module
blocks,
such as go-to-definition, completion of module.*
references,
or workspace-wide symbol lookup.
The server will not index any folders or files above the workspace root
initially opened in the editor.
Emacs
If you are using use-package
, you can put this in the init.el
file to install lsp-mode
:
(use-package lsp-mode
:ensure t
:hook ((terraform-mode . lsp-deferred)))
There are various other ways to install lsp-mode
and they are
documented here.
The lsp-mode
language client for Terraform supports various features
like semantic tokens, code lens for references etc. There is more
detailed documentation here.
IntelliJ IDE
• Install LSP Support plugin
• Open Settings
• Go to Languages & Frameworks → Language Server Protocol → Server Definitions
• Pick Executable
• set Extension
to tf
• set Path
to terraform-ls
• set Args
to serve
• Confirm by clicking Apply
Please note that the Terraform plugin
provides overlapping functionality (and more features at the time of writing).
As a result having both enabled at the same time may result in suboptimal UX,
such as duplicate completion candidates.
Sublime Text
• Install the LSP package • Install the LSP-terraform package
Vim / NeoVim coc.nvim
• Install the coc.nvim plugin
• Add the following snippet to the coc-setting.json
file (editable via :CocConfig
in NeoVim)
{
"languageserver": {
"terraform": {
"command": "terraform-ls",
"args": ["serve"],
"filetypes": [
"terraform",
"tf"
],
"initializationOptions": {},
"settings": {}
}
}
}
Make sure to read through the example vim configuration of the plugin, especially key remapping, which is required for completion to work correctly:
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
vim-lsp
• Install the following plugins:
• async.vim plugin
• vim-lsp plugin
• asyncomplete.vim plugin
• asyncomplete-lsp.vim plugin
• Add the following to your .vimrc
:
if executable('terraform-ls')
au User lsp_setup call lsp#register_server({
\ 'name': 'terraform-ls',
\ 'cmd': {server_info->['terraform-ls', 'serve']},
\ 'whitelist': ['terraform'],
\ })
endif
LanguageClient-neovim
• Install the LanguageClient-neovim plugin
• Add the following to your .vimrc
:
let g:LanguageClient_serverCommands = {
\ 'terraform': ['terraform-ls', 'serve'],
\ }
Neovim v0.5.0+
• Install the nvim-lspconfig plugin
• Add the following to your .vimrc
or init.vim
:
lua <<EOF
require'lspconfig'.terraformls.setup{}
EOF
autocmd BufWritePre *.tfvars lua vim.lsp.buf.formatting_sync()
autocmd BufWritePre *.tf lua vim.lsp.buf.formatting_sync()
• If you are using init.lua
:
require'lspconfig'.terraformls.setup{}
vim.api.nvim_create_autocmd({"BufWritePre"}, {
pattern = {"*.tf", "*.tfvars"},
callback = vim.lsp.buf.formatting_sync(),
})
Neovim v0.8.0+
• Install the nvim-lspconfig plugin
• Add the following to your .vimrc
or init.vim
:
lua <<EOF
require'lspconfig'.terraformls.setup{}
EOF
autocmd BufWritePre *.tfvars lua vim.lsp.buf.format()
autocmd BufWritePre *.tf lua vim.lsp.buf.format()
• If you are using init.lua
:
require'lspconfig'.terraformls.setup{}
vim.api.nvim_create_autocmd({"BufWritePre"}, {
pattern = {"*.tf", "*.tfvars"},
callback = function()
vim.lsp.buf.format()
end,
})
Make sure to read through to server_configurations.md#terraformls if you need more detailed settings.
VS Code
• Install Terraform VS Code Extension >=2.24.0
• Latest compatible version of the language server is bundled with the extension
• See Configuration in case you need to tweak anything. Default settings should work for majority of users though.
BBEdit
BBEdit 14 added support for the Language Server Protocol so you’ll need to upgrade to version 14 to use; this won’t work for older versions of BBEdit.
• Open Preferences > Languages
• In Language-specific settings section, add an entry for Terraform
• In the Server tab, Set Command to terraform-ls
and Arguments to serve
• Once you’ve correctly installed terraform-ls
and configured BBEdit, the status indicator on this settings panel will flip to green
• If you’d like to pass any settings to the server you can do so via the Arguments field.
Kate
KDE Kate editor supports LSP and is user configurable.
• Install the terraform-ls
package (or the equivalent package name appropriate to your distro)
• Open Kate configuration (Settings Menu -> Configure
Kate or Kate -> Preferences
on macOS)
• Select LSP Client in the left pane
• Select User Server Settings tab
• Paste the following JSON and Save:
{
"servers": {
"terraform": {
"command": ["terraform-ls", "serve"],
"url": "<https://github.com/hashicorp/terraform-ls>",
"highlightingModeRegex": "^Terraform$",
"rootIndicationFileNames": ["*.tf", "*.tfvars"]
}
}
}
• Restart of the editor should not be necessary.
Neat
Actions were done as root. Prompts are $ instead of # to differenciate between comments in the output.
this is interesting
Actions were done as root. Prompts are $ instead of # to differenciate between comments in the output.
@Erik Osterman (Cloud Posse) (and office hours) inspired me to write a tool that ingests the latest trends in the cybersecurity and cloud technologies from Reddit and a few RSS feeds, outputting the information to markdown files, a basic web app, and even the terminal. I would love to incorporate some AI with the tool to trim down the content and extract the most exciting and impactful news, but here is the first iteration, and I hope it provides some benefits!
A tool to curate compelling news on cloud technologies and cybersecurity. By aggregating information from RSS feeds and Reddit, it identifies the most noteworthy and impactful updates in the tech industry.
there are so many - i did this for security related stuff on https://dstif.io
Please be aware that the feed aggregator is an automated bot, and sometimes duplication happens. We apologise for it in advance. Should you wish to report …
This is a great reference! Thanks!
nice app! the best part for me is the introduction to streamlit. that’s a sweet app builder!
Streamlit is a lifesaver!
2024-01-03
2024-01-04
https://medium.com/@xpf6677/kcl-biweekly-newsletter-crossplane-kcl-integration-905c724b095f KCL Biweekly Newsletter | Crossplane KCL Integration is Out! Welcome to read and provide feedback. |
Use KCL to write Crossplane Composition Functions
I made a version of my TLD flyover script that iterates the top 1000 (depends on input list) subdomains. May be useful to anyone doing any sort of investigatory work against a web property. https://gist.github.com/AlexAtkinson/ba5162a4f945321943f756d398fe6084
2024-01-05
2024-01-09
how’s everyone handling AMIs these days? We use karpenter, and would like to leverage the drift detection feature for seamless patching (seems to work well) , but historically we’ve used a TF managed image builder pipeline to spit out new AMIs on a scheduled basis with our bootstrapping apps and then karpenter picks up the new AMIs via a tf data source lookup. It’s not that efficient
if the AMI changes too often, I don’t think it is good to use golden image, each time recycling images is time-consuming
it changes about once a month
thinking about doing once a week soon though
once a week is not too often, each recycle may take 20-30 minutes or more depending the size of node group
in non-prod env, can automate the recycle
yeah I guess my question is more around the best way for karpenter to “discover” new AMIs
right now it’s a SSM parameter lookup for the AMI id
yeah looks it is a good practice, AWS uses SSM for AMI id
Hello, help a noob out, I’ve been trying to get my head around trunk based development, and I don’t get what’s the perspective of a QA developing new end to end tests for a particular feature in that model, how are devs coordinating with QAs so that feature doesn’t pass without getting properly tested ? If the project is complex for the QAs to run locally they might need a qa environment so they can test their end to end tests right ?
Typically the e2e integration, smoke, and journey tests are placed in the pipeline such that developers (who should ideally have QAs or QEs on their pod/team) get the feedback automatically. I add test creation work to the acceptance criteria of the user story itself and count it as part of the story points.
What tool do you recommend for Database Performance Monitoring?
2024-01-15
2024-01-17
Hey folks, has anyone inquired about or bought a Teleport enterprise license? What pricing can be expected compared to the team version?
Hi Everyone! We’ve built a container orchestration / infra management platform to simplify DevOps and that can replace tools like K8s, Heroku, etc. We know it’s bold, but i’d be happy to chat more or show a demo to anyone who’s struggling with K8s complexity or the Heroku ceiling. Feel free to check out our website below
Cycle is the leading LowOps platform built to streamline hybrid infrastructure management and container orchestration.
2024-01-18
Really stoked to see how dagger progresses in the next year…. Considering cloudposses passion for dockerized “run anywhere” with the toolchains, this will be exciting to you in the future I think.
What it could look like? Have docker installed and dagger cli…. no python, no go, nothing else I think.
• dagger mod install [github.com/sagikazarmark/daggerverse/golangci-lint@529f3851c888078bf519ca7683d48b053f2f0100](http://github.com/sagikazarmark/daggerverse/golangci-lint@529f3851c888078bf519ca7683d48b053f2f0100)
• Then invoke go linting and toolchain simply by dagger call -m "[github.com/sagikazarmark/daggerverse/golangci-lint@main](http://github.com/sagikazarmark/daggerverse/golangci-lint@main)" --help
.
Their early access list https://daggerverse.dev/
Helm, go builds, linting, kafka, trufflehog, apk, and more….
Each one of these could be written in Go, Python, Typescript… etc. You wouldn’t care. The entire experience is wrapped up in the dagger engine (in buildkit) so no dependencies locally other than if you needed to pass in auth (though they have secrets management integrations too).
Anyway, just a fan of where they are going. Love the concept that in the future an huge library of this stuff could all be written in a mix of common languages yet put into any pipeline without worries about environmental setup/conflicts, and other things we all have to deal with.
Might be a while before it’s ready for production use, but cool to see where it’s going
Find modules built by the Dagger community, or publish your own.
My personal win using their SDK was building a Go pipeline that was mage release
and it wrapped up Goreleaser in buildkit with C++ requirements included for CGO_ENABLED=1. It would let you build the same way on windows, mac, or linux, and self contained all the dependencies. Was tricky to work through but pretty cool to see at the end!
Looks really cool
https://medium.com/@xpf6677/kcl-biweekly-newsletter-v0-7-4-released-3b89987d831d KCL Biweekly Newsletter | KCL v0.7.4 Released! All feedback is welcomed and appreciated! |
KCL is a constraint-based record and functional language hosted by Cloud Native Computing Foundation (CNCF) that enhances the writing of…
Does anyone know of a browser plugin that can do spellcheck in a github gist? The Microsoft Editor plugin doesn’t work there.
@Dan Miller (Cloud Posse)
I believe Grammarly would do that. Although now they have limited free tier options
Ah, that’s how it goes. Make a good thing then paywall it after adoption and refinement feedback from a wide audience. More and more I’m missing 1990s internet. :)
Hi folks, we are tuning a product offering around better operational docs (stateful.com). If any platform/sre/devops engineers would be willing to talk to me, I would really appreciate it!
This looks cool. Feel free to send me a DM.
2024-01-19
Check if a cert is pwned, https://www.hezmatt.org/~mpalmer/blog/2024/01/16/pwned-certificates-on-the-fediverse.html
2024-01-23
How many of you distribute a developer experience style cli internally as a dockerized image like how geodesic is distributed? A little story on it?
Something that’s used by multiple teams with different tech stacks?
I love go and cross platform clis. I noticed though that with a mixed diverse toolchain a docker image does give a lot more flexibility especially if a mix of Go, python, or other runtimes.
I like single purpose tools but the cognitive load for folks not living on the terminal is harder than a single tool to call. I’m curious how many distribute more of an interactive/multipurpose tool for platform, company automation, or other actions as a docker image.
Feels like this area gets messy as multipurpose tools like that can sorta start crossing over into an entry level attempt at perhaps PaaS and what might be better as an api service, internal web portal, etc.
Got me thinking and would enjoy hearing about anything that’s been popular where you work.
This relates to Mage and how you use it?
Related but not exactly. Not repo level but more general company/platform stuff.
You could do that in mage but it wouldn’t be the best tool for that as it’s more like repo level make stuff.
Thinking of other general automation folks might have done like geodesic packaged everything up, or single binary platform engineering tools that do more.
Cool to see things like digital oceans cli for example
Ugh. PHP and devtools vs build once deploy many postures. Do people build both the nonprod and prod versions at the same time to mitigate software supply chain issues such as dependency chain drift? Or do people still build at deploy time for php without worrying that it invalidates sdlc investments such as testing against other builds….?
2024-01-24
2024-01-26
Hello folks, I am configuring a greeter bot for new joiners in my Slack community. I would like to know if the one used in this workspace is open-source. Does anyone know?
We use Zapier
Cool
Thanks @Erik Osterman (Cloud Posse)
unfortunately, it doesn’t have a straight way to send messages to new channel joiners. Luckily, there is a nice Go package, and we used that to create a bot on our side. You can see the code here if you find it useful: https://github.com/netbirdio/netbird-slack-greeter
Not sure what to say, other than we use it still
no worries, I was just sharing the code at this point
2024-01-27
2024-01-29
Do I need to report hiring spam DMs somehow? It is in announcements so I guess it is handled already
Hey @Aleksei Khudiakov - really sorry about that. Yes, it’s handled now
Definitely let me know if it happens again. People can sign up under multiple email addresses to abuse the system.
Please be wary of any blockchain companies (e.g., okx online) engaging in hiring spam. This is against our Code of Conduct.
Hypothetically, how difficult would it be to repurpose Geodesic and Atmos with GCP functionality? Thinking about expanding some of those capabilities for some home projects!
Atmos does not know anything about AWS, if you can use the context variables namespace
, tenant
, environment
and stage
with GCP, and you have Terraform components that use GCP resources, you can use Atmos (b/c Atmos generates vars for the TF resources, but Terraform assumes all the roles (to the cloud and to the backend) and provisions all the resources)
Geodesic does not care about AWS as well except for the assume-role
functionality. If you implement that by yourself for GCP in the container (e.g. shell script), you could use Geodesic
I might be missing something, or something else will need to be changed, but that’s what comes to mind
That’s what I figured since Atmos is extensible with the custom commands. I might have to give it a go.
Thanks for that answer!
note that for Atmos to be used with GCP, you don’t need custom commands. You can use custom commands for other things like creating a command to execute a script to assume roles for GCP, etc.
They are being used already for that by @jose.amengual and his team
An opinionated, multi-cloud, multi-region, best-practice accelerator for Terraform.
yes, we have tried this already and used cloudposse null label with Google GCP official modules to create this components
super
you can use our repo as a base
@jose.amengual are you using geodesic
to work with GCP/Azure, or you run another container, or just on the host? (the question is mostly about assuming roles)
we are not using geodesic, we created a geodesic like container that is very basic
The assume role of magic has not been coded in those components, so that will have to be codified
I was playing around with this last night to get the assume role magic coded into the prompt. If you ever want to sync offline, feel free to reach out
2024-01-30
What are folks using for multi-device file syncing these days? Dropbox Offline Folders are paid only now, and pCloud doesn’t have a FS mount in Android (raaage).
I just use iCloud or google drive. But I have heard good things about this: https://syncthing.net/
I use mega.nz for my personal use. It’s great and they have Linux CLI tools that you have setup.
I use syncthing for syncing 2 linux machines and my phone. Pretty handy for my use case: few PDF files, some MP3s and vim-encrypted passwords
NextCloud instance on shared hosting, brings a bunch of other nice features together with file sharing. Many hosters have one click installs and auto-update if you don’t want to spend time on it.
syncthing as well, as my main hub I use my synology at home, then sync different folders as desired/necessary to personal and work devices, and android phone as well. works quite well
Another vote for Syncthing - I use it on multiple Windows, Mac, and Linux machines.
I use Resilio Sync
Ah, Resilio looks so good until reading android reviews from this year. I’ll still check it out though. Syncthing looks good so far.
I use android. Where can I read these reviews?
Btw I mostly use it to sync my Obsidian Vault. Was using it for music but Plexamp got around that.
On the play store. That’s exactly what I’m looking for. Hopefully it works.
Hmm tbh most of those seem like user issues. It works ok but it is not a ‘simple’ product.
I might actually try syncthing soon and compare
It seems Resilio Sync didn’t play well with Obsidian. It seemed to delete a bunch of files when I restructured my folders.
It also couldn’t sync a couple of files and there was no easy way to see which ones they were.
I switched over to syncthing and it seems to be a lot more usable. I’ll see how reliable it is for Obsidian.
I’ve got it all working nicely with Syncthing.
• Mobile: Syncthing >> Local Directory (ie: Documents/Obsidian)
• Linux Host: Syncthing >> pCloud directory. (ie: apps/Obsidian) Shared with the mobile device. With this, changes are reflected in the Obsidian vault within ~10s ish, which is fine. This isn’t a real-time chat app. This is how to get off evernote forever.
Cheers Alex. So far so good with Syncthing and sync time is a few seconds (local network) so not even noticeable for my use.
Are you using pCloud for additional backup/version history?
Not really. Just to have it off-local. If I was getting serious I’d setup a cron to zip the dir and drop it on s3 or some place as a recovery option.
I have mine syncing to google drive and using Synology backup, which saved me when Sync deleted the files.
Ah, synology is good stuff. Their lvm magic that lets you use any size disks together is nice.
That sounds about as good as it gets without Enterprise money
But even Nasa uses synology, so no snickering here. And it’s not like you’d ever use something like Pure Storage all flash array for this. :)
Yep my Synology NAS has been great. Definitely recommend them.
Here’s a GIST on this. https://gist.github.com/AlexAtkinson/5c828d0852c391527ebf3d8f7721cda9