mirror of
https://github.com/wahyd4/home-docker.git
synced 2026-08-08 20:15:03 +10:00
Archive mysql
This commit is contained in:
+59
-1
@@ -1,3 +1,61 @@
|
|||||||
temp.yaml
|
temp.yaml
|
||||||
**/.terraform
|
**/.terraform
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
|
|
||||||
|
|
||||||
|
# Local .terraform directories
|
||||||
|
**/.terraform/*
|
||||||
|
|
||||||
|
# .tfstate files
|
||||||
|
*.tfstate
|
||||||
|
*.tfstate.*
|
||||||
|
|
||||||
|
# Crash log files
|
||||||
|
crash.log
|
||||||
|
crash.*.log
|
||||||
|
|
||||||
|
# Exclude all .tfvars files, which are likely to contain sensitive data
|
||||||
|
*.tfvars
|
||||||
|
*.tfvars.json
|
||||||
|
|
||||||
|
# Ignore override files as they are usually used for local development
|
||||||
|
override.tf
|
||||||
|
override.tf.json
|
||||||
|
*_override.tf
|
||||||
|
*_override.tf.json
|
||||||
|
|
||||||
|
# Ignore CLI configuration files
|
||||||
|
.terraformrc
|
||||||
|
terraform.rc
|
||||||
|
|
||||||
|
# Ignore lock files
|
||||||
|
.terraform.lock.hcl
|
||||||
|
|
||||||
|
# Ignore generated scripts
|
||||||
|
scripts/*.sh
|
||||||
|
|
||||||
|
# Ignore temporary files
|
||||||
|
*.tmp
|
||||||
|
*.bak
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
# Ignore log files
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Ignore local environment files
|
||||||
|
.env
|
||||||
|
.envrc
|
||||||
|
|
||||||
|
# Ignore any local kubeconfig files
|
||||||
|
kubeconfig*
|
||||||
|
|
||||||
|
# Ignore any generated YAML files
|
||||||
|
*.yaml
|
||||||
|
*.yml
|
||||||
|
|
||||||
|
# Ignore any SSH keys or sensitive files
|
||||||
|
*.pem
|
||||||
|
*.key
|
||||||
|
*.pub
|
||||||
|
|
||||||
|
**/tmp/
|
||||||
-102
@@ -1,102 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: mysql
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: mysql
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: mysql
|
|
||||||
spec:
|
|
||||||
nodeSelector:
|
|
||||||
kubernetes.io/hostname: server-3
|
|
||||||
tolerations:
|
|
||||||
- key: "node"
|
|
||||||
operator: "Equal"
|
|
||||||
value: "special"
|
|
||||||
effect: "NoSchedule"
|
|
||||||
- key: node-role.kubernetes.io/master
|
|
||||||
operator: Equal
|
|
||||||
value: ""
|
|
||||||
effect: NoSchedule
|
|
||||||
- key: node-role.kubernetes.io/control-plane
|
|
||||||
operator: Equal
|
|
||||||
value: ""
|
|
||||||
effect: NoSchedule
|
|
||||||
containers:
|
|
||||||
- name: mysql
|
|
||||||
image: mirror.gcr.io/mysql:8.2
|
|
||||||
ports:
|
|
||||||
- containerPort: 3306
|
|
||||||
env:
|
|
||||||
- name: TZ
|
|
||||||
value: "Australia/Melbourne"
|
|
||||||
- name: MYSQL_DATABASE
|
|
||||||
value: home
|
|
||||||
- name: MYSQL_USER
|
|
||||||
value: junv
|
|
||||||
- name: MYSQL_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: mysql-password-junv
|
|
||||||
key: password
|
|
||||||
- name: MYSQL_ROOT_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: mysql-root-password
|
|
||||||
key: password
|
|
||||||
volumeMounts:
|
|
||||||
- name: data
|
|
||||||
mountPath: "/var/lib/mysql"
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu: "1"
|
|
||||||
memory: "1Gi"
|
|
||||||
requests:
|
|
||||||
cpu: "400m"
|
|
||||||
memory: "256Mi"
|
|
||||||
securityContext:
|
|
||||||
privileged: false
|
|
||||||
runAsGroup: 1000
|
|
||||||
# fsGroup: 1000
|
|
||||||
runAsUser: 1000
|
|
||||||
volumes:
|
|
||||||
- name: data
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: mysql-local-pvc
|
|
||||||
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: mysql-adguard
|
|
||||||
namespace: db
|
|
||||||
annotations:
|
|
||||||
metallb.universe.tf/loadBalancerIPs: 192.168.1.201
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app: mysql
|
|
||||||
ports:
|
|
||||||
- protocol: TCP
|
|
||||||
port: 3306
|
|
||||||
targetPort: 3306
|
|
||||||
type: LoadBalancer
|
|
||||||
externalIPs:
|
|
||||||
- 192.168.1.201
|
|
||||||
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: mysql
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app: mysql
|
|
||||||
ports:
|
|
||||||
- protocol: TCP
|
|
||||||
port: 3306
|
|
||||||
targetPort: 3306
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# NFS client storageclass provisioner
|
||||||
|
|
||||||
|
helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
|
||||||
|
|
||||||
|
helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
|
||||||
|
--set nfs.server=192.168.1.4 --set nfs.path=/k8s
|
||||||
+7
-7
@@ -14,13 +14,13 @@ tar -xzf "$BACKUP_FILE"
|
|||||||
BACKUP_DIR=$(tar -tzf "$BACKUP_FILE" | head -1 | cut -f1 -d"/")
|
BACKUP_DIR=$(tar -tzf "$BACKUP_FILE" | head -1 | cut -f1 -d"/")
|
||||||
|
|
||||||
# Install k3s if not present
|
# Install k3s if not present
|
||||||
if ! command -v k3s >/dev/null 2>&1; then
|
# if ! command -v k3s >/dev/null 2>&1; then
|
||||||
echo "Installing k3s..."
|
# echo "Installing k3s..."
|
||||||
curl -sfL https://get.k3s.io | sh -
|
# curl -sfL https://get.k3s.io | sh -
|
||||||
mkdir -p ~/.kube
|
# mkdir -p ~/.kube
|
||||||
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
|
# sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
|
||||||
sudo chown $(id -u):$(id -g) ~/.kube/config
|
# sudo chown $(id -u):$(id -g) ~/.kube/config
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
# Wait for k3s to be ready
|
# Wait for k3s to be ready
|
||||||
echo "Waiting for k3s to be ready..."
|
echo "Waiting for k3s to be ready..."
|
||||||
|
|||||||
Reference in New Issue
Block a user