| @ -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}}" | |||||
| @ -1 +0,0 @@ | |||||
| kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended.yaml | |||||
| @ -1 +0,0 @@ | |||||
| eyJhbGciOiJSUzI1NiIsImtpZCI6IkN0QWJncFU0VFl1R01adWJRZk9Ta2xPcm9SRzRkNTdwUmQ0bjVHT0MzaDAifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi11c2VyLXRva2VuLTVnOGIyIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiIyYTFmODI0ZC1lZDg3LTRhMTYtOTcyYS1iNmQ2MzdjZmQ2MGQiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZXJuZXRlcy1kYXNoYm9hcmQ6YWRtaW4tdXNlciJ9.Jaz-cWXY3aAQIwcTK1uD8itirx8F_nS22f-vAV1fggK1lDnwUB6UMLKwgJGpvQ9he0guqZG4ZZMPoDnqhZzpiZbFGo2YRq0OdJwVPPVPm5kj2hiG-zxRZpqbmrbVlxlMYOoUedmcsk_sZjRDWr9NMmu_XDcOa9pIhTM4PzIqDot5PCf0FMZYMHvQ_7sgiNAU1_bdp8i_9EyfVKzKcCUBNrILs-HeIUsWELIGmAglmj0k5TCdaiBCCs0XRvU701DzOkphJgp0B0pjxDEuKvdcDIBQpouoj0z2-Dn8dm4K1Hj1Fp9WIi9UIhXXHMO0ze95kssbbDK2SRmWhWaEt6iyLg | |||||
| @ -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 | |||||
| @ -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: {} | |||||
| @ -1,5 +0,0 @@ | |||||
| apiVersion: v1 | |||||
| kind: ServiceAccount | |||||
| metadata: | |||||
| name: admin-user | |||||
| namespace: kubernetes-dashboard | |||||
| @ -0,0 +1,3 @@ | |||||
| # ya hay una shell específica para esto | |||||
| # persistent volume | |||||
| #kubectl apply -f registry-pv.yaml | |||||
| @ -1,2 +0,0 @@ | |||||
| # persistent volume | |||||
| kubectl apply -f registry-pv.yaml | |||||
| @ -0,0 +1,3 @@ | |||||
| # ya hay otra shell para esto | |||||
| # Crea el pod | |||||
| #kubectl create -f registry-deployment.yaml | |||||
| @ -1,2 +0,0 @@ | |||||
| # Crea el pod | |||||
| kubectl create -f registry-deployment.yaml | |||||
| @ -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 | ||||
| @ -0,0 +1,18 @@ | |||||
| fireflyiii | |||||
| firefly-res | |||||
| gogs | |||||
| hello | |||||
| hmdm | |||||
| kanboard | |||||
| knowage | |||||
| mattermost | |||||
| mediawiki | |||||
| miweb | |||||
| nginx | |||||
| nginxphp | |||||
| postgres | |||||
| registry | |||||
| repository | |||||
| vaultwarden | |||||
| wordpress-ingress | |||||
| wpcitas | |||||
| @ -0,0 +1,6 @@ | |||||
| kind: StorageClass | |||||
| apiVersion: storage.k8s.io/v1 | |||||
| metadata: | |||||
| name: externo-storage | |||||
| provisioner: kubernetes.io/no-provisioner | |||||
| volumeBindingMode: WaitForFirstConsumer | |||||
| @ -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: | |||||
| {} | |||||
| @ -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: | ||||
| @ -0,0 +1,11 @@ | |||||
| apiVersion: v1 | |||||
| kind: PersistentVolumeClaim | |||||
| metadata: | |||||
| name: miweb-pv-claim | |||||
| spec: | |||||
| accessModes: | |||||
| - ReadWriteOnce | |||||
| storageClassName: "cluster-storage" | |||||
| resources: | |||||
| requests: | |||||
| storage: 2Gi | |||||
| @ -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 | |||||
| @ -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 | |||||
| @ -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 | |||||