mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 22:12:56 +00:00
vim kubernetes snippets
This commit is contained in:
parent
b04e8387c3
commit
511f0b808a
@ -83,6 +83,10 @@ set undofile " Keeps undos after quit
|
||||
set backupdir=~/.config/nvim/dirs/backup
|
||||
set undodir=~/.config/nvim/dirs/undo
|
||||
|
||||
" Keep selection when tabbing
|
||||
vnoremap < <gv
|
||||
vnoremap > >gv
|
||||
|
||||
" Create backup directories if they don't exist
|
||||
if !isdirectory(&backupdir)
|
||||
call mkdir(&backupdir, "p")
|
||||
@ -94,8 +98,8 @@ endif
|
||||
" Custom Commands
|
||||
"----------------
|
||||
|
||||
command! Vimrc edit ~/.config/nvim/init.vim " Edit .vimrc (this file)
|
||||
command! Refresh source ~/.config/nvim/init.vim " Refresh from .vimrc (this file)
|
||||
command! Vimrc edit $MYVIMRC " Edit .vimrc (this file)
|
||||
command! Refresh source $MYVIMRC " Refresh from .vimrc (this file)
|
||||
|
||||
" Custom Keybinds
|
||||
"----------------
|
||||
@ -168,12 +172,29 @@ nnoremap <Leader>rp :Refresh<cr> :PlugInstall<cr>
|
||||
" Open file tree
|
||||
noremap <silent> <Leader>ft :Fern . -drawer -width=35 -toggle<CR><C-w>=
|
||||
|
||||
" Tabularize
|
||||
nnoremap <Leader>ta :Tabularize /
|
||||
nnoremap <Leader>t# :Tabularize /#<CR>
|
||||
nnoremap <Leader>t" :Tabularize /"<CR>
|
||||
|
||||
" Snippets
|
||||
"---------
|
||||
|
||||
" Basic programming files
|
||||
nnoremap ,sh :-1read $DOTS/shell/templates/skeleton.sh<CR>Gdd03kC
|
||||
nnoremap ,py :-1read $DOTS/shell/templates/skeleton.py<CR>Gdd08kC
|
||||
|
||||
" Kubernetes
|
||||
nnoremap ,cm :-1read $DOTS/shell/templates/configmap.yaml<CR>Gdd0gg
|
||||
nnoremap ,sec :-1read $DOTS/shell/templates/secret.yaml<CR>Gdd0gg
|
||||
nnoremap ,dep :-1read $DOTS/shell/templates/deployment.yaml<CR>Gdd0gg
|
||||
nnoremap ,svc :-1read $DOTS/shell/templates/service.yaml<CR>Gdd0gg
|
||||
nnoremap ,cro :-1read $DOTS/shell/templates/clusterrole.yaml<CR>Gdd0gg
|
||||
nnoremap ,crb :-1read $DOTS/shell/templates/clusterrolebinding.yaml<CR>Gdd0gg
|
||||
nnoremap ,ro :-1read $DOTS/shell/templates/role.yaml<CR>Gdd0gg
|
||||
nnoremap ,rb :-1read $DOTS/shell/templates/rolebinding.yaml<CR>Gdd0gg
|
||||
nnoremap ,sa :-1read $DOTS/shell/templates/serviceaccount.yaml<CR>Gdd0gg
|
||||
|
||||
" LaTeX Settings
|
||||
"---------------
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# Set $PATH for finding programs
|
||||
set -U FISH_DIR (readlink ~/.config/fish)
|
||||
set -Ux DOTS (dirname $FISH_DIR)
|
||||
set -U CDPATH . $HOME
|
||||
set -U EDITOR nvim
|
||||
set -U PROJ $HOME/dev/work
|
||||
set -Ux NOTES_PATH $HOME/notes
|
||||
set -U FISH_DIR (readlink ~/.config/fish) # Used for getting to this repo
|
||||
set -Ux DOTS (dirname $FISH_DIR) # Directory of this config repo
|
||||
set -U CDPATH . $HOME # Directories available for immediate cd
|
||||
set -U EDITOR nvim # Preferred text editor
|
||||
set -U PROJ $HOME/dev/work # Projects directory
|
||||
set -Ux NOTES_PATH $HOME/notes # Notes directory
|
||||
set -Ux MANPAGER "nvim +Man!" # Used for reading man pages
|
||||
|
||||
# Load abbreviations
|
||||
abbrs
|
||||
|
8
shell/templates/clusterrole.yaml
Normal file
8
shell/templates/clusterrole.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name:
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
verbs: []
|
12
shell/templates/clusterrolebinding.yaml
Normal file
12
shell/templates/clusterrolebinding.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name:
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name:
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name:
|
||||
namespace: default
|
8
shell/templates/configmap.yaml
Normal file
8
shell/templates/configmap.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
||||
annotations:
|
||||
replicator.v1.mittwald.de/replicate-to: ".*"
|
||||
data:
|
33
shell/templates/deployment.yaml
Normal file
33
shell/templates/deployment.yaml
Normal file
@ -0,0 +1,33 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app:
|
||||
spec:
|
||||
serviceAccountName:
|
||||
containers:
|
||||
- name:
|
||||
image:
|
||||
imagePullPolicy: Always
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name:
|
||||
- secretRef:
|
||||
name:
|
||||
ports:
|
||||
- containerPort:
|
||||
protocol: TCP
|
||||
resources:
|
||||
limits:
|
||||
cpu:
|
||||
requests:
|
||||
cpu:
|
10
shell/templates/role.yaml
Normal file
10
shell/templates/role.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resourceNames:
|
||||
resources:
|
||||
verbs:
|
13
shell/templates/rolebinding.yaml
Normal file
13
shell/templates/rolebinding.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
||||
roleRef:
|
||||
kind:
|
||||
name:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
subjects:
|
||||
- kind:
|
||||
name:
|
||||
apiGroup: rbac.authorization.k8s.io
|
8
shell/templates/secret.yaml
Normal file
8
shell/templates/secret.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
||||
annotations:
|
||||
replicator.v1.mittwald.de/replicate-to: ".*"
|
||||
data:
|
15
shell/templates/service.yaml
Normal file
15
shell/templates/service.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
annotations:
|
||||
alb.ingress.kubernetes.io/healthcheck-path:
|
||||
name:
|
||||
namespace: default
|
||||
spec:
|
||||
ports:
|
||||
- port: 443
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
selector:
|
||||
app:
|
||||
type: NodePort
|
5
shell/templates/serviceaccount.yaml
Normal file
5
shell/templates/serviceaccount.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
Loading…
Reference in New Issue
Block a user