From 6f715cfa9fd9be1a7a100b91c0c483c8617d4384 Mon Sep 17 00:00:00 2001 From: "Waylon S. Walker" Date: Thu, 2 Jan 2025 10:46:55 -0600 Subject: [PATCH] add some redirects --- pages/blog/markata.md | 3 +- pages/blog/thoughts.md | 3 +- pages/blog/trying-n8n.md | 15 ++++ pages/til/kubectl-dash-k.md | 114 ++++++++++++++++++++++++++ static/_redirects | 4 + templates/post-templates/blog-post.md | 15 +++- 6 files changed, 149 insertions(+), 5 deletions(-) create mode 100644 pages/blog/trying-n8n.md create mode 100644 pages/til/kubectl-dash-k.md diff --git a/pages/blog/markata.md b/pages/blog/markata.md index 9c0c6202ae..2b40bbcd88 100644 --- a/pages/blog/markata.md +++ b/pages/blog/markata.md @@ -5,6 +5,7 @@ title: markata tags: - python - markata + - slash published: true --- @@ -36,7 +37,7 @@ thought it would be easier to just build my own than learn how to make one do what I wanted it to. Not invented here syndrome hitting hard. > I really lacked the depth of knowledge in the js ecosystem to really work on -> it (gatsby) effectively. +> it (gatsby) effectively. ## Plugins all the way down diff --git a/pages/blog/thoughts.md b/pages/blog/thoughts.md index b189c2e240..d7e31f8d0e 100644 --- a/pages/blog/thoughts.md +++ b/pages/blog/thoughts.md @@ -5,6 +5,7 @@ title: Thoughts tags: - blog - meta + - slash published: True --- @@ -43,7 +44,7 @@ journey as I learn, lets talk tech. The core of the site is a python web server running fastapi. Most of the endpoints return html via jinja templates to the browser and json to anything else. So you go to the list of posts at -[https://thoughts.waylonwalker.com/posts/waylonwalker/?page_size=9999999999 in](https://thoughts.waylonwalker.com/posts/waylonwalker/?page_size=9999999999 in){.hoverlink} +[https://thoughts.waylonwalker.com/posts/waylonwalker/?page_size=9999999999 in]( in){.hoverlink} a web browser it will be a rendered feed, but from curl you will get json. ### htmx diff --git a/pages/blog/trying-n8n.md b/pages/blog/trying-n8n.md new file mode 100644 index 0000000000..65da9faddf --- /dev/null +++ b/pages/blog/trying-n8n.md @@ -0,0 +1,15 @@ +--- +date: 2024-09-03 11:24 +templateKey: til +title: Trying-n8n +published: true +tags: +--- + +Today I gave n8n a try using podman, their docs gave me docker commands, but it +ran fine on my machine using podman. + +``` +podman volume create n8n_data +podman run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n +``` diff --git a/pages/til/kubectl-dash-k.md b/pages/til/kubectl-dash-k.md new file mode 100644 index 0000000000..553ee2ee52 --- /dev/null +++ b/pages/til/kubectl-dash-k.md @@ -0,0 +1,114 @@ +--- +date: 2024-07-05 20:15:11 +templateKey: blog +title: kubectl dash k +published: true +tags: + - k8s + - kubernetes + +--- + + +Kubernetes ships with a feature called kustomize that allows you to customize +your manifests in a declarative way. It's a bit like helm, but easier to use. +I found this useful. + +## kustomization.yaml + +In order to use kustomize you need to have a kustomization.yaml, +kustomization.yml, or Kustomization file in the directory you are applying. + +``` bash +kubectl apply -k . +error: unable to find one of 'kustomization.yaml', 'kustomization.yml' or 'Kustomization' in directory '/tank/git/kustomize-playground' +``` + +The kustomization.yaml file cannot be empty. + +``` bash +❯ kubectl apply -k pod +error: kustomization.yaml is empty +``` + +## lets make an mvp + +``` bash +mkdir pod +touch pod/pod.yaml +touch pod/kustomization.yaml +``` + +``` yaml +# pod.yaml +``` + +``` yaml +# kustomization.yaml +``` + +## Overlays + +Overlays must point to yaml or a directory with a kustomization.yaml file, and +cannot reside inside the same directory causing a circular reference. + +--- + +## Layout + +``` bash +k8s +├── base +│ ├── deployment.yaml +│ └── kustomization.yaml +├── overlays +│ ├── local +│ │ └── kustomization.yaml +│ ├── dev +│ │ └── kustomization.yaml +│ └── prod +│ ├── special-prod.yaml +│ └── kustomization.yaml +``` + +## base + +Place all of the common k8s manifests here in the base directory along with +kustomization.yaml. You can split them up into separate files or just one +file, I'm keeping it to one for simiplicity. + +## base - kustomization.yaml + +In the base kustomization.yaml file add all of the manifests that you want to +use as a resource. + +``` yaml +resources: + - deployment.yaml +``` + +## overlays + +Now for each separate environment that you want to have create a directory in +overlays with a kustomization.yaml file, and any special manifests that only +apply to a particular environment. + +## overlays - kustomization.yaml + +### resoures + +``` yaml +resources: + - ../../base +# any other specific resources, maybe special ones for prod here + - sealed-dotenv.yaml +``` + +### images + +``` yaml +images: + - name: my-image + newName: docker.io/myrepo/myimage + newTag: 1.0.0 +``` diff --git a/static/_redirects b/static/_redirects index 9d63ec2911..37e3e07959 100644 --- a/static/_redirects +++ b/static/_redirects @@ -3,6 +3,10 @@ /rss /archive/rss.xml /rss.xml /archive/rss.xml +/podroll https://reader.waylonwalker.com/podcast/ +/blogroll https://reader.waylonwalker.com/written/ +/postroll https://thoughts.waylonwalker.com/ + # image upload /upload https://github.com/WaylonWalker/images.waylonwalker.com/upload/main/static /uploads https://github.com/WaylonWalker/images.waylonwalker.com/upload/main/static diff --git a/templates/post-templates/blog-post.md b/templates/post-templates/blog-post.md index e8e69c32e9..4328defdb1 100644 --- a/templates/post-templates/blog-post.md +++ b/templates/post-templates/blog-post.md @@ -1,14 +1,23 @@ --- date: <% tp.file.creation_date() %> -templateKey: blog -title: +templateKey: blog-post +title: <%* + const originalFileName = await tp.system.prompt("Enter file name"); + const toTitleCase = str => str.replace( + /\w\S*/g, + txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase() + ); + const title = toTitleCase(originalFileName); + tR += title + '\n'; // Add the title to the template result +-%> published: true tags: - --- <%* -const originalFileName = await tp.system.prompt("Enter file name"); const fileName = originalFileName.toLowerCase().replace(/\s+/g, '-'); const newFilePath = `pages/blog/${fileName}`; await tp.file.move(newFilePath); -%> + +<% tp.file.cursor() %>