This commit is contained in:
Toby
2026-01-27 17:35:45 -05:00
commit 2639af6531
176 changed files with 27104 additions and 0 deletions
@@ -0,0 +1,63 @@
---
name: backup-recovery
description: Implement backup and recovery strategies. Configure rsync, Restic, and cloud backups. Use when designing data protection solutions.
license: MIT
metadata:
author: devops-skills
version: "1.0"
---
# Backup and Recovery
Implement comprehensive backup strategies.
## rsync Backups
```bash
# Basic sync
rsync -avz --delete /source/ /backup/
# Remote backup
rsync -avz -e ssh /data/ user@backup:/backups/
# Incremental with hard links
rsync -avz --delete --link-dest=/backup/latest /source/ /backup/$(date +%Y%m%d)/
```
## Restic Backup
```bash
# Initialize repository
restic init --repo /backups
# Backup
restic backup /data --repo /backups
# List snapshots
restic snapshots --repo /backups
# Restore
restic restore latest --target /restore --repo /backups
# Prune old backups
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune
```
## Cloud Backup
```bash
# AWS S3 with restic
restic init --repo s3:s3.amazonaws.com/bucket-name
restic backup /data --repo s3:s3.amazonaws.com/bucket-name
# GCS
restic init --repo gs:bucket-name:/
```
## Best Practices
- Follow 3-2-1 rule
- Test recovery regularly
- Encrypt backups
- Document procedures
- Monitor backup success
@@ -0,0 +1,56 @@
---
name: block-storage
description: Manage block storage volumes and LVM. Configure cloud block storage and local disks. Use when managing disk storage.
license: MIT
metadata:
author: devops-skills
version: "1.0"
---
# Block Storage
Manage block storage volumes and LVM.
## LVM Management
```bash
# Create physical volume
pvcreate /dev/sdb
# Create volume group
vgcreate data_vg /dev/sdb
# Create logical volume
lvcreate -L 50G -n app_lv data_vg
# Format and mount
mkfs.ext4 /dev/data_vg/app_lv
mount /dev/data_vg/app_lv /data
# Extend volume
lvextend -L +10G /dev/data_vg/app_lv
resize2fs /dev/data_vg/app_lv
```
## AWS EBS
```bash
# Create volume
aws ec2 create-volume \
--availability-zone us-east-1a \
--size 100 \
--volume-type gp3
# Attach to instance
aws ec2 attach-volume \
--volume-id vol-xxx \
--instance-id i-xxx \
--device /dev/xvdf
```
## Best Practices
- Use LVM for flexibility
- Implement RAID for redundancy
- Monitor disk I/O
- Regular disk health checks
@@ -0,0 +1,67 @@
---
name: nfs-storage
description: Configure NFS servers and clients. Implement network file sharing for Linux systems. Use when setting up shared storage.
license: MIT
metadata:
author: devops-skills
version: "1.0"
---
# NFS Storage
Configure NFS for network file sharing.
## Server Configuration
```bash
# Install
apt install nfs-kernel-server
# Configure exports
# /etc/exports
/data 10.0.0.0/24(rw,sync,no_subtree_check,no_root_squash)
/shared *(ro,sync,no_subtree_check)
# Apply changes
exportfs -ra
# Start service
systemctl enable --now nfs-kernel-server
```
## Client Configuration
```bash
# Install
apt install nfs-common
# Mount
mount -t nfs server:/data /mnt/data
# /etc/fstab
server:/data /mnt/data nfs defaults,_netdev 0 0
```
## Kubernetes NFS
```yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: nfs-pv
spec:
capacity:
storage: 100Gi
accessModes:
- ReadWriteMany
nfs:
server: nfs-server.example.com
path: /data
```
## Best Practices
- Use proper export options
- Implement firewall rules
- Monitor NFS performance
- Use NFSv4 for security
@@ -0,0 +1,52 @@
---
name: object-storage
description: Configure object storage with S3, GCS, and MinIO. Implement lifecycle policies and access controls. Use when managing object storage.
license: MIT
metadata:
author: devops-skills
version: "1.0"
---
# Object Storage
Configure and manage object storage solutions.
## AWS S3
```bash
# Create bucket
aws s3 mb s3://my-bucket
# Upload/Download
aws s3 cp file.txt s3://my-bucket/
aws s3 sync ./local s3://my-bucket/remote
# Configure lifecycle
aws s3api put-bucket-lifecycle-configuration \
--bucket my-bucket \
--lifecycle-configuration file://lifecycle.json
```
## MinIO (Self-Hosted)
```bash
# Deploy
docker run -d \
-p 9000:9000 -p 9001:9001 \
-e MINIO_ROOT_USER=admin \
-e MINIO_ROOT_PASSWORD=password \
-v /data:/data \
minio/minio server /data --console-address ":9001"
# Configure mc client
mc alias set myminio http://localhost:9000 admin password
mc mb myminio/mybucket
```
## Best Practices
- Enable versioning
- Implement lifecycle policies
- Use server-side encryption
- Configure access logging
- Implement bucket policies