Browse Source

Cambio todo a Externo

main
Celestino Rey 2 years ago
parent
commit
d488f53a9f
32 changed files with 98 additions and 540 deletions
  1. +1
    -1
      Firefly/k8s-cluster/pv-local-ff.yaml
  2. +1
    -1
      Firefly/k8s-cluster/pv-local-mysql.yaml
  3. +1
    -1
      Gogs/pv-local-gogs.yaml
  4. +1
    -1
      Gogs/pv-local-mysql-gogs.yaml
  5. +1
    -1
      HelmCharts/kanboard-chart/templates/pv-local-kanboard.yaml
  6. +1
    -1
      HelmCharts/kanboard-chart/templates/pv-local-mysql-kb.yaml
  7. +1
    -1
      HelmCharts/mediawiki-chart/templates/pv-local-mediawiki.yaml
  8. +1
    -1
      HelmCharts/mediawiki-chart/templates/pv-local-mysql-mw.yaml
  9. +0
    -14
      HelmCharts/miweb-chart/templates/miweb-deployment.yaml
  10. +0
    -0
      HelmCharts/pv-local-miweb.yaml
  11. +1
    -1
      HelmCharts/vaultwarden-chart/templates/pv-local-vaultwarden.yaml
  12. +0
    -29
      K8S-dashboard/CrearDashboard.sh
  13. +0
    -1
      K8S-dashboard/EliminaDahsboard.sh
  14. +0
    -1
      K8S-dashboard/Token20220901
  15. +0
    -12
      K8S-dashboard/cluster-role.yaml
  16. +0
    -304
      K8S-dashboard/recommended.yaml
  17. +0
    -5
      K8S-dashboard/service-account.yaml
  18. +3
    -0
      MiRegistry/nohacefalta-step-05.sh
  19. +2
    -1
      MiRegistry/registry-pv.yaml
  20. +0
    -2
      MiRegistry/step-05.sh
  21. +3
    -0
      MiRegistry/step-06-deployment.sh
  22. +0
    -2
      MiRegistry/step-06.sh
  23. +1
    -1
      StorageClass/cluster-storage-class.yaml
  24. +18
    -0
      StorageClass/dirscluster.txt
  25. +6
    -0
      StorageClass/externo-storage-class.yaml
  26. +0
    -152
      StorageClass/portainer.yaml
  27. +6
    -6
      StorageClass/pv-local-miweb.yaml
  28. +11
    -0
      StorageClass/pvc-miweb.yaml
  29. +4
    -1
      borraEvicted.sh
  30. +21
    -0
      borraMal.sh
  31. +7
    -0
      detectadMal
  32. +7
    -0
      pepe

+ 1
- 1
Firefly/k8s-cluster/pv-local-ff.yaml View File

@ -8,4 +8,4 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/cluster/fireflyiii/firefly-uploads"
path: "/mnt/Externo/fireflyiii/firefly-uploads"

+ 1
- 1
Firefly/k8s-cluster/pv-local-mysql.yaml View File

@ -8,4 +8,4 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/cluster/fireflyiii/firefly-db"
path: "/mnt/Externo/fireflyiii/firefly-db"

+ 1
- 1
Gogs/pv-local-gogs.yaml View File

@ -8,4 +8,4 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/cluster/gogs/gogs_data"
path: "/mnt/Externo/gogs/gogs_data"

+ 1
- 1
Gogs/pv-local-mysql-gogs.yaml View File

@ -8,4 +8,4 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/cluster/gogs/gogs_db"
path: "/mnt/Externo/gogs/gogs_db"

+ 1
- 1
HelmCharts/kanboard-chart/templates/pv-local-kanboard.yaml View File

@ -8,5 +8,5 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/cluster/kanboard/kanboard"
path: "/mnt/Externo/kanboard/kanboard"

+ 1
- 1
HelmCharts/kanboard-chart/templates/pv-local-mysql-kb.yaml View File

@ -8,4 +8,4 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/cluster/kanboard/kanboard-db"
path: "/mnt/Externo/kanboard/kanboard-db"

+ 1
- 1
HelmCharts/mediawiki-chart/templates/pv-local-mediawiki.yaml View File

@ -8,5 +8,5 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/cluster/mediawiki/mediawiki"
path: "/mnt/Externo/mediawiki/mediawiki"

+ 1
- 1
HelmCharts/mediawiki-chart/templates/pv-local-mysql-mw.yaml View File

@ -8,4 +8,4 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/cluster/mediawiki/mediawiki-db"
path: "/mnt/Externo/mediawiki/mediawiki-db"

+ 0
- 14
HelmCharts/miweb-chart/templates/miweb-deployment.yaml View File

@ -12,20 +12,6 @@ spec:
selector: selector:
app: miweb app: miweb
--- ---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: miweb-pv-claim
labels:
app: miweb
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:


HelmCharts/miweb-chart/templates/pv-local-miweb.yaml → HelmCharts/pv-local-miweb.yaml View File


+ 1
- 1
HelmCharts/vaultwarden-chart/templates/pv-local-vaultwarden.yaml View File

@ -8,5 +8,5 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/cluster/vaultwarden"
path: "/mnt/Externo/vaultwarden"

+ 0
- 29
K8S-dashboard/CrearDashboard.sh View File

@ -1,29 +0,0 @@
kubectl create -f recommended.yaml
kubectl -n kubernetes-dashboard edit service kubernetes-dashboard
kubectl -n kubernetes-dashboard get service kubernetes-dashboard
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
EOF
cat <<EOF | kubectl apply -f -
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard
EOF
kubectl -n kubernetes-dashboard get secret $(kubectl -n kubernetes-dashboard get sa/admin-user -o jsonpath="{.secrets[0].name}") -o go-template="{{.data.token | base64decode}}"

+ 0
- 1
K8S-dashboard/EliminaDahsboard.sh View File

@ -1 +0,0 @@
kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended.yaml

+ 0
- 1
K8S-dashboard/Token20220901 View File

@ -1 +0,0 @@
eyJhbGciOiJSUzI1NiIsImtpZCI6IkN0QWJncFU0VFl1R01adWJRZk9Ta2xPcm9SRzRkNTdwUmQ0bjVHT0MzaDAifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi11c2VyLXRva2VuLTVnOGIyIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiIyYTFmODI0ZC1lZDg3LTRhMTYtOTcyYS1iNmQ2MzdjZmQ2MGQiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZXJuZXRlcy1kYXNoYm9hcmQ6YWRtaW4tdXNlciJ9.Jaz-cWXY3aAQIwcTK1uD8itirx8F_nS22f-vAV1fggK1lDnwUB6UMLKwgJGpvQ9he0guqZG4ZZMPoDnqhZzpiZbFGo2YRq0OdJwVPPVPm5kj2hiG-zxRZpqbmrbVlxlMYOoUedmcsk_sZjRDWr9NMmu_XDcOa9pIhTM4PzIqDot5PCf0FMZYMHvQ_7sgiNAU1_bdp8i_9EyfVKzKcCUBNrILs-HeIUsWELIGmAglmj0k5TCdaiBCCs0XRvU701DzOkphJgp0B0pjxDEuKvdcDIBQpouoj0z2-Dn8dm4K1Hj1Fp9WIi9UIhXXHMO0ze95kssbbDK2SRmWhWaEt6iyLg

+ 0
- 12
K8S-dashboard/cluster-role.yaml View File

@ -1,12 +0,0 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard

+ 0
- 304
K8S-dashboard/recommended.yaml View File

@ -1,304 +0,0 @@
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: v1
kind: Namespace
metadata:
name: kubernetes-dashboard
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
---
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
spec:
type: NodePort
ports:
- port: 443
nodePort: 30481
targetPort: 8443
selector:
k8s-app: kubernetes-dashboard
---
apiVersion: v1
kind: Secret
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard-certs
namespace: kubernetes-dashboard
type: Opaque
---
apiVersion: v1
kind: Secret
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard-csrf
namespace: kubernetes-dashboard
type: Opaque
data:
csrf: ""
---
apiVersion: v1
kind: Secret
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard-key-holder
namespace: kubernetes-dashboard
type: Opaque
---
kind: ConfigMap
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard-settings
namespace: kubernetes-dashboard
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
rules:
# Allow Dashboard to get, update and delete Dashboard exclusive secrets.
- apiGroups: [""]
resources: ["secrets"]
resourceNames: ["kubernetes-dashboard-key-holder", "kubernetes-dashboard-certs", "kubernetes-dashboard-csrf"]
verbs: ["get", "update", "delete"]
# Allow Dashboard to get and update 'kubernetes-dashboard-settings' config map.
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["kubernetes-dashboard-settings"]
verbs: ["get", "update"]
# Allow Dashboard to get metrics.
- apiGroups: [""]
resources: ["services"]
resourceNames: ["heapster", "dashboard-metrics-scraper"]
verbs: ["proxy"]
- apiGroups: [""]
resources: ["services/proxy"]
resourceNames: ["heapster", "http:heapster:", "https:heapster:", "dashboard-metrics-scraper", "http:dashboard-metrics-scraper"]
verbs: ["get"]
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
rules:
# Allow Metrics Scraper to get metrics from the Metrics server
- apiGroups: ["metrics.k8s.io"]
resources: ["pods", "nodes"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kubernetes-dashboard
subjects:
- kind: ServiceAccount
name: kubernetes-dashboard
namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kubernetes-dashboard
subjects:
- kind: ServiceAccount
name: kubernetes-dashboard
namespace: kubernetes-dashboard
---
kind: Deployment
apiVersion: apps/v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
k8s-app: kubernetes-dashboard
template:
metadata:
labels:
k8s-app: kubernetes-dashboard
spec:
containers:
- name: kubernetes-dashboard
image: kubernetesui/dashboard:v2.2.0
imagePullPolicy: Always
ports:
- containerPort: 8443
protocol: TCP
args:
- --auto-generate-certificates
- --namespace=kubernetes-dashboard
# Uncomment the following line to manually specify Kubernetes API server Host
# If not specified, Dashboard will attempt to auto discover the API server and connect
# to it. Uncomment only if the default does not work.
# - --apiserver-host=http://my-address:port
volumeMounts:
- name: kubernetes-dashboard-certs
mountPath: /certs
# Create on-disk volume to store exec logs
- mountPath: /tmp
name: tmp-volume
livenessProbe:
httpGet:
scheme: HTTPS
path: /
port: 8443
initialDelaySeconds: 30
timeoutSeconds: 30
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsUser: 1001
runAsGroup: 2001
volumes:
- name: kubernetes-dashboard-certs
secret:
secretName: kubernetes-dashboard-certs
- name: tmp-volume
emptyDir: {}
serviceAccountName: kubernetes-dashboard
nodeSelector:
"kubernetes.io/os": linux
# Comment the following tolerations if Dashboard must not be deployed on master
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
---
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: dashboard-metrics-scraper
name: dashboard-metrics-scraper
namespace: kubernetes-dashboard
spec:
ports:
- port: 8000
targetPort: 8000
selector:
k8s-app: dashboard-metrics-scraper
---
kind: Deployment
apiVersion: apps/v1
metadata:
labels:
k8s-app: dashboard-metrics-scraper
name: dashboard-metrics-scraper
namespace: kubernetes-dashboard
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
k8s-app: dashboard-metrics-scraper
template:
metadata:
labels:
k8s-app: dashboard-metrics-scraper
annotations:
seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
spec:
containers:
- name: dashboard-metrics-scraper
image: kubernetesui/metrics-scraper:v1.0.6
ports:
- containerPort: 8000
protocol: TCP
livenessProbe:
httpGet:
scheme: HTTP
path: /
port: 8000
initialDelaySeconds: 30
timeoutSeconds: 30
volumeMounts:
- mountPath: /tmp
name: tmp-volume
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsUser: 1001
runAsGroup: 2001
serviceAccountName: kubernetes-dashboard
nodeSelector:
"kubernetes.io/os": linux
# Comment the following tolerations if Dashboard must not be deployed on master
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
volumes:
- name: tmp-volume
emptyDir: {}

+ 0
- 5
K8S-dashboard/service-account.yaml View File

@ -1,5 +0,0 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard

+ 3
- 0
MiRegistry/nohacefalta-step-05.sh View File

@ -0,0 +1,3 @@
# ya hay una shell específica para esto
# persistent volume
#kubectl apply -f registry-pv.yaml

+ 2
- 1
MiRegistry/registry-pv.yaml View File

@ -9,7 +9,8 @@ spec:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
# Debería de llamarse registry el directorio, pero me equivoqué y por no volver a hacer todo... # Debería de llamarse registry el directorio, pero me equivoqué y por no volver a hacer todo...
path: /mnt/cluster/repository
#path: /mnt/cluster/repository
path: /mnt/Externo/registry
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim


+ 0
- 2
MiRegistry/step-05.sh View File

@ -1,2 +0,0 @@
# persistent volume
kubectl apply -f registry-pv.yaml

+ 3
- 0
MiRegistry/step-06-deployment.sh View File

@ -0,0 +1,3 @@
# ya hay otra shell para esto
# Crea el pod
#kubectl create -f registry-deployment.yaml

+ 0
- 2
MiRegistry/step-06.sh View File

@ -1,2 +0,0 @@
# Crea el pod
kubectl create -f registry-deployment.yaml

StorageClass/local-storage.yaml → StorageClass/cluster-storage-class.yaml View File

@ -1,6 +1,6 @@
kind: StorageClass kind: StorageClass
apiVersion: storage.k8s.io/v1 apiVersion: storage.k8s.io/v1
metadata: metadata:
name: local-storage
name: cluster-storage
provisioner: kubernetes.io/no-provisioner provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer volumeBindingMode: WaitForFirstConsumer

+ 18
- 0
StorageClass/dirscluster.txt View File

@ -0,0 +1,18 @@
fireflyiii
firefly-res
gogs
hello
hmdm
kanboard
knowage
mattermost
mediawiki
miweb
nginx
nginxphp
postgres
registry
repository
vaultwarden
wordpress-ingress
wpcitas

+ 6
- 0
StorageClass/externo-storage-class.yaml View File

@ -0,0 +1,6 @@
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: externo-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer

+ 0
- 152
StorageClass/portainer.yaml View File

@ -1,152 +0,0 @@
---
# Source: portainer/templates/namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: portainer
---
# Source: portainer/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: portainer-sa-clusteradmin
namespace: portainer
labels:
app.kubernetes.io/name: portainer
app.kubernetes.io/instance: portainer
app.kubernetes.io/version: "ce-latest-ee-2.17.1"
---
# Source: portainer/templates/pvc.yaml
kind: "PersistentVolumeClaim"
apiVersion: "v1"
metadata:
name: portainer
namespace: portainer
annotations:
volume.alpha.kubernetes.io/storage-class: "generic"
labels:
io.portainer.kubernetes.application.stack: portainer
app.kubernetes.io/name: portainer
app.kubernetes.io/instance: portainer
app.kubernetes.io/version: "ce-latest-ee-2.17.1"
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "10Gi"
---
# Source: portainer/templates/rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: portainer
labels:
app.kubernetes.io/name: portainer
app.kubernetes.io/instance: portainer
app.kubernetes.io/version: "ce-latest-ee-2.17.1"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
namespace: portainer
name: portainer-sa-clusteradmin
---
# Source: portainer/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: portainer
namespace: portainer
labels:
io.portainer.kubernetes.application.stack: portainer
app.kubernetes.io/name: portainer
app.kubernetes.io/instance: portainer
app.kubernetes.io/version: "ce-latest-ee-2.17.1"
spec:
type: NodePort
ports:
- port: 9000
targetPort: 9000
protocol: TCP
name: http
nodePort: 30777
- port: 9443
targetPort: 9443
protocol: TCP
name: https
nodePort: 30779
- port: 30776
targetPort: 30776
protocol: TCP
name: edge
nodePort: 30776
selector:
app.kubernetes.io/name: portainer
app.kubernetes.io/instance: portainer
---
# Source: portainer/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: portainer
namespace: portainer
labels:
io.portainer.kubernetes.application.stack: portainer
app.kubernetes.io/name: portainer
app.kubernetes.io/instance: portainer
app.kubernetes.io/version: "ce-latest-ee-2.17.1"
spec:
replicas: 1
strategy:
type: "Recreate"
selector:
matchLabels:
app.kubernetes.io/name: portainer
app.kubernetes.io/instance: portainer
template:
metadata:
labels:
app.kubernetes.io/name: portainer
app.kubernetes.io/instance: portainer
spec:
nodeSelector:
{}
serviceAccountName: portainer-sa-clusteradmin
volumes:
- name: "data"
persistentVolumeClaim:
claimName: portainer
containers:
- name: portainer
image: "portainer/portainer-ee:2.17.1"
imagePullPolicy: Always
args:
- '--tunnel-port=30776'
volumeMounts:
- name: data
mountPath: /data
ports:
- name: http
containerPort: 9000
protocol: TCP
- name: https
containerPort: 9443
protocol: TCP
- name: tcp-edge
containerPort: 8000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: 9443
scheme: HTTPS
readinessProbe:
httpGet:
path: /
port: 9443
scheme: HTTPS
resources:
{}

StorageClass/pv-local.yaml → StorageClass/pv-local-miweb.yaml View File

@ -1,16 +1,16 @@
apiVersion: v1 apiVersion: v1
kind: PersistentVolume kind: PersistentVolume
metadata: metadata:
name: test-local-pv
name: miweb-www-folder
spec: spec:
capacity: capacity:
storage: 10Gi
storage: 2Gi
accessModes: accessModes:
- ReadWriteOnce
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain persistentVolumeReclaimPolicy: Retain
storageClassName: local-storage
local:
path: /mnt/Externo/volumenes/pv1
storageClassName: cluster-storage
hostPath:
path: "/mnt/cluster/nginx"
nodeAffinity: nodeAffinity:
required: required:
nodeSelectorTerms: nodeSelectorTerms:

+ 11
- 0
StorageClass/pvc-miweb.yaml View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: miweb-pv-claim
spec:
accessModes:
- ReadWriteOnce
storageClassName: "cluster-storage"
resources:
requests:
storage: 2Gi

+ 4
- 1
borraEvicted.sh View File

@ -1,2 +1,5 @@
kubectl get pod -n $1 | grep Evicted | awk '{print $1}' | xargs kubectl delete pod -n $1
for i in `kubectl get pod -A | grep Evicted | cut -f1 -d' '|uniq`
do
kubectl get pod -n $i | grep Evicted | awk '{print $1}' | xargs kubectl delete pod -n $i
done

+ 21
- 0
borraMal.sh View File

@ -0,0 +1,21 @@
for i in `kubectl get pod -A | grep Evicted | cut -f1 -d' '|uniq`
do
kubectl get pod -n $i | grep Evicted | awk '{print $1}' | xargs kubectl delete pod -n $i
done
for i in `kubectl get pod -A | grep Completed | cut -f1 -d' '|uniq`
do
kubectl get pod -n $i | grep Completed | awk '{print $1}' | xargs kubectl delete pod -n $i
done
for i in `kubectl get pod -A | grep ContainerStatusUnknown | cut -f1 -d' '|uniq`
do
kubectl get pod -n $i | grep ContainerStatusUnknown | awk '{print $1}' | xargs kubectl delete pod -n $i
done
for i in `kubectl get pod -A | grep Error | cut -f1 -d' '|uniq`
do
kubectl get pod -n $i | grep Error | awk '{print $1}' | xargs kubectl delete pod -n $i
done
for i in `kubectl get pod -A | grep ImagePullBackOff | cut -f1 -d' '|uniq`
do
kubectl get pod -n $i | grep ImagePullBackOff | awk '{print $1}' | xargs kubectl delete pod -n $i
done

+ 7
- 0
detectadMal View File

@ -0,0 +1,7 @@
kubectl get pod -A |grep -v Running |grep -v NAMESPACE > /tmp/podsmal
if [ $? -eq 0 ]; then
# hay algo que no es Running, por lo tanto, está mal
df | grep sd >> /tmp/podsmal
sudo -u creylopez cat /tmp/podsmal | mail -s "Algunos pod están funcionando mal" "creylopez@yahoo.es"
fi

+ 7
- 0
pepe
File diff suppressed because it is too large
View File


Loading…
Cancel
Save