-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Waylon S. Walker
committed
Jan 2, 2025
1 parent
f3b7881
commit 6f715cf
Showing
6 changed files
with
149 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() %> |