diff --git a/CreaCluster/00-borraCluster.sh b/CreaCluster/00-borraCluster.sh new file mode 100755 index 00000000..7a17c896 --- /dev/null +++ b/CreaCluster/00-borraCluster.sh @@ -0,0 +1,11 @@ +kubeadm reset -f --cri-socket unix:///run/containerd/containerd.sock +rm -rf /etc/cni /etc/kubernetes /var/lib/dockershim /var/lib/etcd /var/lib/kubelet /var/run/kubernetes ~/.kube/* + + + +sudo iptables -F && sudo iptables -X +sudo iptables -t nat -F && sudo iptables -t nat -X +sudo iptables -t raw -F && sudo iptables -t raw -X +sudo iptables -t mangle -F && sudo iptables -t mangle -X + +systemctl restart containerd diff --git a/CreaCluster/01-inicializaCluster.sh b/CreaCluster/01-inicializaCluster.sh new file mode 100755 index 00000000..9855d63b --- /dev/null +++ b/CreaCluster/01-inicializaCluster.sh @@ -0,0 +1,3 @@ +sudo kubeadm init --pod-network-cidr=10.34.0.0/16 --upload-certs --control-plane-endpoint=k8s-server --cri-socket unix:///run/containerd/containerd.sock + +#sudo kubeadm init --pod-network-cidr=10.34.0.0/16 --cri-socket unix:///run/containerd/containerd.sock --upload-certs --control-plane-endpoint=k8s-server diff --git a/CreaCluster/creaConfigCluster.sh b/CreaCluster/02-creaConfigCluster.sh old mode 100644 new mode 100755 similarity index 100% rename from CreaCluster/creaConfigCluster.sh rename to CreaCluster/02-creaConfigCluster.sh diff --git a/CreaCluster/creaCalico.sh b/CreaCluster/03-creaCalico.sh old mode 100644 new mode 100755 similarity index 50% rename from CreaCluster/creaCalico.sh rename to CreaCluster/03-creaCalico.sh index aab0b0b0..c7dd2da8 --- a/CreaCluster/creaCalico.sh +++ b/CreaCluster/03-creaCalico.sh @@ -1,3 +1,3 @@ kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yaml -kubectl create -f https://docs.projectcalico.org/manifests/custom-resources.yaml +kubectl create -f ./custom-resources.yaml diff --git a/CreaCluster/04-masterEsWorker.sh b/CreaCluster/04-masterEsWorker.sh new file mode 100755 index 00000000..600e8e93 --- /dev/null +++ b/CreaCluster/04-masterEsWorker.sh @@ -0,0 +1,2 @@ +#kubectl taint nodes --all node-role.kubernetes.io/master- +kubectl taint nodes --all node-role.kubernetes.io/control-plane- diff --git a/CreaCluster/confirmaRunning.sh b/CreaCluster/05-confirmaRunning.sh old mode 100644 new mode 100755 similarity index 100% rename from CreaCluster/confirmaRunning.sh rename to CreaCluster/05-confirmaRunning.sh diff --git a/CreaCluster/99-borraCalico.sh b/CreaCluster/99-borraCalico.sh new file mode 100755 index 00000000..7ce3de8a --- /dev/null +++ b/CreaCluster/99-borraCalico.sh @@ -0,0 +1,3 @@ +kubectl delete -f https://docs.projectcalico.org/manifests/tigera-operator.yaml +kubectl delete -f https://docs.projectcalico.org/manifests/custom-resources.yaml + diff --git a/CreaCluster/README.md b/CreaCluster/README.md index 0e38770e..967ca959 100644 --- a/CreaCluster/README.md +++ b/CreaCluster/README.md @@ -2,6 +2,9 @@ https://computingforgeeks.com/deploy-kubernetes-cluster-on-ubuntu-with-kubeadm/ +## Configuración de Calico + +https://blog.radwell.codes/2021/05/provisioning-single-node-kubernetes-cluster-using-kubeadm-on-ubuntu-20-04/ ## Como resetearlo https://www.techrunnr.com/how-to-reset-kubernetes-cluster/ diff --git a/CreaCluster/borraCluster.sh b/CreaCluster/borraCluster.sh deleted file mode 100644 index 6a29d357..00000000 --- a/CreaCluster/borraCluster.sh +++ /dev/null @@ -1,11 +0,0 @@ -kubeadm reset -f -rm -rf /etc/cni /etc/kubernetes /var/lib/dockershim /var/lib/etcd /var/lib/kubelet /var/run/kubernetes ~/.kube/* - - - -iptables -F && iptables -X -iptables -t nat -F && iptables -t nat -X -iptables -t raw -F && iptables -t raw -X -iptables -t mangle -F && iptables -t mangle -X - -systemctl restart docker diff --git a/CreaCluster/config.toml b/CreaCluster/config.toml new file mode 100644 index 00000000..f9db5d9c --- /dev/null +++ b/CreaCluster/config.toml @@ -0,0 +1,250 @@ +disabled_plugins = [] +imports = [] +oom_score = 0 +plugin_dir = "" +required_plugins = [] +root = "/var/lib/containerd" +state = "/run/containerd" +temp = "" +version = 2 + +[cgroup] + path = "" + +[debug] + address = "" + format = "" + gid = 0 + level = "" + uid = 0 + +[grpc] + address = "/run/containerd/containerd.sock" + gid = 0 + max_recv_message_size = 16777216 + max_send_message_size = 16777216 + tcp_address = "" + tcp_tls_ca = "" + tcp_tls_cert = "" + tcp_tls_key = "" + uid = 0 + +[metrics] + address = "" + grpc_histogram = false + +[plugins] + + [plugins."io.containerd.gc.v1.scheduler"] + deletion_threshold = 0 + mutation_threshold = 100 + pause_threshold = 0.02 + schedule_delay = "0s" + startup_delay = "100ms" + + [plugins."io.containerd.grpc.v1.cri"] + device_ownership_from_security_context = false + disable_apparmor = false + disable_cgroup = false + disable_hugetlb_controller = true + disable_proc_mount = false + disable_tcp_service = true + enable_selinux = false + enable_tls_streaming = false + enable_unprivileged_icmp = false + enable_unprivileged_ports = false + ignore_image_defined_volumes = false + max_concurrent_downloads = 3 + max_container_log_line_size = 16384 + netns_mounts_under_state_dir = false + restrict_oom_score_adj = false + sandbox_image = "k8s.gcr.io/pause:3.6" + selinux_category_range = 1024 + stats_collect_period = 10 + stream_idle_timeout = "4h0m0s" + stream_server_address = "127.0.0.1" + stream_server_port = "0" + systemd_cgroup = false + tolerate_missing_hugetlb_controller = true + unset_seccomp_profile = "" + + [plugins."io.containerd.grpc.v1.cri".cni] + bin_dir = "/opt/cni/bin" + conf_dir = "/etc/cni/net.d" + conf_template = "" + ip_pref = "" + max_conf_num = 1 + + [plugins."io.containerd.grpc.v1.cri".containerd] + default_runtime_name = "runc" + disable_snapshot_annotations = true + discard_unpacked_layers = false + ignore_rdt_not_enabled_errors = false + no_pivot = false + snapshotter = "overlayfs" + + [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime] + base_runtime_spec = "" + cni_conf_dir = "" + cni_max_conf_num = 0 + container_annotations = [] + pod_annotations = [] + privileged_without_host_devices = false + runtime_engine = "" + runtime_path = "" + runtime_root = "" + runtime_type = "" + + [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime.options] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] + base_runtime_spec = "" + cni_conf_dir = "" + cni_max_conf_num = 0 + container_annotations = [] + pod_annotations = [] + privileged_without_host_devices = false + runtime_engine = "" + runtime_path = "" + runtime_root = "" + runtime_type = "io.containerd.runc.v2" + + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] + BinaryName = "" + CriuImagePath = "" + CriuPath = "" + CriuWorkPath = "" + IoGid = 0 + IoUid = 0 + NoNewKeyring = false + NoPivotRoot = false + Root = "" + ShimCgroup = "" + SystemdCgroup = false + + [plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime] + base_runtime_spec = "" + cni_conf_dir = "" + cni_max_conf_num = 0 + container_annotations = [] + pod_annotations = [] + privileged_without_host_devices = false + runtime_engine = "" + runtime_path = "" + runtime_root = "" + runtime_type = "" + + [plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime.options] + + [plugins."io.containerd.grpc.v1.cri".image_decryption] + key_model = "node" + + [plugins."io.containerd.grpc.v1.cri".registry] + config_path = "" + + [plugins."io.containerd.grpc.v1.cri".registry.auths] + + [plugins."io.containerd.grpc.v1.cri".registry.configs] + + [plugins."io.containerd.grpc.v1.cri".registry.headers] + + [plugins."io.containerd.grpc.v1.cri".registry.mirrors] + + [plugins."io.containerd.grpc.v1.cri".x509_key_pair_streaming] + tls_cert_file = "" + tls_key_file = "" + + [plugins."io.containerd.internal.v1.opt"] + path = "/opt/containerd" + + [plugins."io.containerd.internal.v1.restart"] + interval = "10s" + + [plugins."io.containerd.internal.v1.tracing"] + sampling_ratio = 1.0 + service_name = "containerd" + + [plugins."io.containerd.metadata.v1.bolt"] + content_sharing_policy = "shared" + + [plugins."io.containerd.monitor.v1.cgroups"] + no_prometheus = false + + [plugins."io.containerd.runtime.v1.linux"] + no_shim = false + runtime = "runc" + runtime_root = "" + shim = "containerd-shim" + shim_debug = false + + [plugins."io.containerd.runtime.v2.task"] + platforms = ["linux/amd64"] + sched_core = false + + [plugins."io.containerd.service.v1.diff-service"] + default = ["walking"] + + [plugins."io.containerd.service.v1.tasks-service"] + rdt_config_file = "" + + [plugins."io.containerd.snapshotter.v1.aufs"] + root_path = "" + + [plugins."io.containerd.snapshotter.v1.btrfs"] + root_path = "" + + [plugins."io.containerd.snapshotter.v1.devmapper"] + async_remove = false + base_image_size = "" + discard_blocks = false + fs_options = "" + fs_type = "" + pool_name = "" + root_path = "" + + [plugins."io.containerd.snapshotter.v1.native"] + root_path = "" + + [plugins."io.containerd.snapshotter.v1.overlayfs"] + root_path = "" + upperdir_label = false + + [plugins."io.containerd.snapshotter.v1.zfs"] + root_path = "" + + [plugins."io.containerd.tracing.processor.v1.otlp"] + endpoint = "" + insecure = false + protocol = "" + +[proxy_plugins] + +[stream_processors] + + [stream_processors."io.containerd.ocicrypt.decoder.v1.tar"] + accepts = ["application/vnd.oci.image.layer.v1.tar+encrypted"] + args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"] + env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"] + path = "ctd-decoder" + returns = "application/vnd.oci.image.layer.v1.tar" + + [stream_processors."io.containerd.ocicrypt.decoder.v1.tar.gzip"] + accepts = ["application/vnd.oci.image.layer.v1.tar+gzip+encrypted"] + args = ["--decryption-keys-path", "/etc/containerd/ocicrypt/keys"] + env = ["OCICRYPT_KEYPROVIDER_CONFIG=/etc/containerd/ocicrypt/ocicrypt_keyprovider.conf"] + path = "ctd-decoder" + returns = "application/vnd.oci.image.layer.v1.tar+gzip" + +[timeouts] + "io.containerd.timeout.bolt.open" = "0s" + "io.containerd.timeout.shim.cleanup" = "5s" + "io.containerd.timeout.shim.load" = "5s" + "io.containerd.timeout.shim.shutdown" = "3s" + "io.containerd.timeout.task.state" = "2s" + +[ttrpc] + address = "" + gid = 0 + uid = 0 diff --git a/CreaCluster/cri-dockerd-0.2.6.amd64.tgz b/CreaCluster/cri-dockerd-0.2.6.amd64.tgz new file mode 100644 index 00000000..d793ba1c Binary files /dev/null and b/CreaCluster/cri-dockerd-0.2.6.amd64.tgz differ diff --git a/CreaCluster/custom-resources.yaml b/CreaCluster/custom-resources.yaml new file mode 100644 index 00000000..fe39c4d5 --- /dev/null +++ b/CreaCluster/custom-resources.yaml @@ -0,0 +1,27 @@ +# This section includes base Calico installation configuration. +# For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.Installation +apiVersion: operator.tigera.io/v1 +kind: Installation +metadata: + name: default +spec: + # Configures Calico networking. + calicoNetwork: + # Note: The ipPools section cannot be modified post-install. + ipPools: + - blockSize: 26 + cidr: 10.34.0.0/16 + encapsulation: VXLANCrossSubnet + natOutgoing: Enabled + nodeSelector: all() + +--- + +# This section configures the Calico API server. +# For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.APIServer +apiVersion: operator.tigera.io/v1 +kind: APIServer +metadata: + name: default +spec: {} + diff --git a/CreaCluster/inicializaCluster.sh b/CreaCluster/inicializaCluster.sh deleted file mode 100644 index 213d611e..00000000 --- a/CreaCluster/inicializaCluster.sh +++ /dev/null @@ -1 +0,0 @@ -sudo kubeadm init --pod-network-cidr=10.168.0.0/16 --upload-certs --control-plane-endpoint=k8s-server diff --git a/CreaCluster/kubelet.crt b/CreaCluster/kubelet.crt new file mode 100644 index 00000000..93fa922a --- /dev/null +++ b/CreaCluster/kubelet.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDJTCCAg2gAwIBAgIIFNmhjj6FEvEwDQYJKoZIhvcNAQELBQAwFTETMBEGA1UE +AxMKa3ViZXJuZXRlczAeFw0yMjEwMTcxMzA0MjdaFw0yMzEwMTcxMzA0MzJaMDgx +FTATBgNVBAoTDHN5c3RlbTpub2RlczEfMB0GA1UEAxMWc3lzdGVtOm5vZGU6azhz +LXNlcnZlcjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKtDpRHyAt7k +nWxGqaLSp2upnWfewe7r/yOXg9LV9X655dTfh6LuaD2mYiIhl+0baWIae+126gDT +guIfRupPq62J1QRolNJDeS2Okol4o9gYt2AzyJnhq6GUc3Nku859rkGZlujRx+CX +tbTSO+mIYphpZ0KE7oai+SP1rn+kH0RLk3agfTujXUQ0Wa1bejoCtzYPfEblXBQ8 +0EZcutbSm0dbM5fGWJDJLDSXY0990sorm6jzlaf47QZAE4JVjxfd+kfsAJTkdKZX +5HTa1IgHIS1D7I9eZ+JzzcF3d5yTnbAdFzrxnxS3/FIw0emcyA5bVba6gxBkF+xX +4RNNPK5gGdMCAwEAAaNWMFQwDgYDVR0PAQH/BAQDAgWgMBMGA1UdJQQMMAoGCCsG +AQUFBwMCMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUjj2w6/MOwvY0AEVsau5t +K48TXhIwDQYJKoZIhvcNAQELBQADggEBAEsVsLc1qtatF3vYHOkBW6R6uBqWoKjt +wEWVjWjRpqz4jj4bx0e9McNF1J/Me8MXjxFFXBvE4m2lbCWmUGYpsK55k0mLEerX +gby2mML/yRY6VNff9yzJbvVPMGndi0e/W6WO1KldNDN/sDYcM/2FZg5JTOikr0yH +VBPrOq2oCy60Dr9VP+qIDbRi3CIko/X/t915WCLXdGXCRi10StgcynzbU7sRdqsh +vNLNECGY50pLXgZyUOoRFnJuN75oZ0S5ANp9PfOtAqDdLgiFN1qNrR/2mumi0v0U +Z+5/aupTK1jCSC/u6c2+IfOdf8wXBqLLvorAMfRr36PzDztsfqBgFwI= +-----END CERTIFICATE----- diff --git a/CreaCluster/masterEsWorker.sh b/CreaCluster/masterEsWorker.sh deleted file mode 100644 index 7c22f235..00000000 --- a/CreaCluster/masterEsWorker.sh +++ /dev/null @@ -1 +0,0 @@ -kubectl taint nodes --all node-role.kubernetes.io/master- diff --git a/Drupal/drupal-deployment.yaml b/Drupal/drupal-deployment.yaml index 4d3fde19..5f3cdfea 100644 --- a/Drupal/drupal-deployment.yaml +++ b/Drupal/drupal-deployment.yaml @@ -53,14 +53,14 @@ spec: initContainers: - name: init-sites-volume - image: docker-registry:32000/midrupal:v1 + image: drupal:latest command: ['/bin/bash', '-c'] args: ['cp -r /var/www/html/sites/ /data/; chown www-data:www-data /data/ -R'] volumeMounts: - mountPath: /data name: drupal-persistent-storage containers: - - image: docker-registry:32000/midrupal:v1 + - image: drupal:latest name: drupal env: - name: DB_TYPE diff --git a/Nginx/paraTodo.sh b/Nginx/paraTodo.sh new file mode 100644 index 00000000..4a810059 --- /dev/null +++ b/Nginx/paraTodo.sh @@ -0,0 +1,2 @@ +kubectl delete -k ./ +kubectl delete -f pv-local-nginx.yaml