Added snippets for Emacs
This commit is contained in:
5
emacs/.emacs.d/snippets/yaml-mode/k8-kustom
Normal file
5
emacs/.emacs.d/snippets/yaml-mode/k8-kustom
Normal file
@@ -0,0 +1,5 @@
|
||||
#key : k8s/kustomization
|
||||
# --
|
||||
resources:
|
||||
- ${1:deployment}.yaml
|
||||
- ${2:service}.yaml
|
||||
44
emacs/.emacs.d/snippets/yaml-mode/k8deployment
Normal file
44
emacs/.emacs.d/snippets/yaml-mode/k8deployment
Normal 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
|
||||
18
emacs/.emacs.d/snippets/yaml-mode/k8ingress
Normal file
18
emacs/.emacs.d/snippets/yaml-mode/k8ingress
Normal 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
|
||||
14
emacs/.emacs.d/snippets/yaml-mode/k8service
Normal file
14
emacs/.emacs.d/snippets/yaml-mode/k8service
Normal 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}
|
||||
Reference in New Issue
Block a user