Added snippets for Emacs

This commit is contained in:
Fabio Scotto di Santolo
2025-12-27 13:53:55 +01:00
parent f81fb6d3fe
commit 07dfd8687a
115 changed files with 814 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
#key : k8s/kustomization
# --
resources:
- ${1:deployment}.yaml
- ${2:service}.yaml

View File

@@ -0,0 +1,44 @@
#key : k8s/deployment
# --
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${1:foo}-deploy
spec:
replicas: ${2:1}
selector:
matchLabels:
app: $1
template:
metadata:
labels:
app: $1
${3:webkind}: ${4:colour}
spec:
containers:
- name: $1
image: docker.io/nginx:latest
volumeMounts:
- name: nginx-template-volume
mountPath: /etc/nginx/templates
- name: nginx-confd-volume
mountPath: /etc/nginx/conf.d
ports:
- containerPort: 80
env:
- name: NGINX_ENVSUBST_OUTPUT_DIR
value: /usr/share/nginx/html
- name: COLOUR
valueFrom:
configMapKeyRef:
name: nginx-colour-config
key: $1.colour
volumes:
- name: nginx-template-volume
configMap:
name: nginx-template-config
- name: nginx-confd-volume
configMap:
name: nginx-conf.d-config

View File

@@ -0,0 +1,18 @@
#key : k8s/ingress
# --
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ${1:foo}-ingress
spec:
rules:
- host: $1.`system-name`
http:
paths:
- pathType: Prefix
path: /
backend:
service:
port:
number: 80
name: colour-service

View File

@@ -0,0 +1,14 @@
#key : k8s/service
# --
apiVersion: v1
kind: Service
metadata:
name: ${1:foo}-service
spec:
type: ${2:NodePort}
ports:
- port: ${3:80}
targetPort: ${4:80}
selector:
${5:webkind}: ${6:colour}