book-of-kubernetes / examples

Examples for The Book of Kubernetes
MIT License
166 stars 76 forks source link

Legacy Google-hosted Repos Unavailable in January 2024 #35

Open lucas-gautier opened 9 months ago

lucas-gautier commented 9 months ago

Hello everyone -

This post is to call awareness to Kubernetes deprecating and taking offline the repos being used for this project. This project will need updates to be able to interface with the new repos. I've only used k8s and never had the pleasure of installing it - so it may take time.

If someone more adept in the install process wants to help, that would be great too.

Changes to the location of Linux packages for Kubernetes The legacy Linux package repositories (apt.kubernetes.io and yum.kubernetes.io AKA packages.cloud.google.com) have been frozen starting from September 13, 2023 and are going away in January 2024, users must migrate. Please read our announcement for more details.

TvarozekRastislav commented 6 months ago

Hello everyone, I would like to point out the fact that the legacy packages repository(https://apt.kubernetes.io/) used is already removed thus examples are not going to work.

herreramaxi commented 6 months ago

Hi guys, I did the migration to pkgs.k8s.io from the legacy Google-hosted repo, so now the k8s role is fixed and tested for chapter-06 and chapter-08. I also upgraded k8s to 1.28.0 and add-ons dependencies. Please find the following PR to be reviewed, thanks so much: PR-37.

Kind Regards, Maxi

jonnykrz commented 3 months ago

(accidentally auto-piloted and commented on PR earlier...oops) Hi All,

When you inevitably crash into this issue while following along in chapter 6, I used the information in these links to resolve:

The second link, though written for setting up 1.28, has been updated to use the new kubernetes community repositories rather than the legacy google ones.

You can of course use the extra scripts to have installation done for you, but for those following along to get used to the install process, the links above should help.

Good luck :v:

ipodcartel commented 4 weeks ago

@herreramaxi Could you post the updated commands for page 93 that address the issue? Much appreciated.

herreramaxi commented 3 weeks ago

Hi @ipodcartel, please find below the commands for chapter-06. I used as reference the following commit: https://github.com/book-of-kubernetes/examples/commit/0a833f9433c05a7ff0458a50b5f7fe47008bf18d Regards,

host01

k8s-all modprobe br_netfilter k8s-all "echo 'br_netfilter' > /etc/modules-load.d/k8s.conf" k8s-all sysctl -w net.ipv4.ip_forward=1 net.bridge.bridge-nf-call-ip6tables=1 net.bridge.bridge-nf-call-iptables=1 k8s-all apt install -y apt-transport-https open-iscsi nfs-common k8s-all "curl -fsSL \ https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | \ gpg --dearmor -o /usr/share/keyrings/google-cloud-keyring.gpg" k8s-all "echo 'deb [arch=amd64' \ 'signed-by=/usr/share/keyrings/google-cloud-keyring.gpg]' \ 'https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' > \ /etc/apt/sources.list.d/kubernetes.list" k8s-all apt update source /opt/k8sver k8s-all apt install -y kubelet=$K8SV kubeadm=$K8SV kubectl=$K8SV systemctl status kubelet k8s-all apt-mark hold kubelet kubeadm kubectl /usr/bin/kubeadm init \

--config /etc/kubernetes/kubeadm-init.yaml --upload-certs

host02

/usr/bin/kubeadm join --config /etc/kubernetes/kubeadm-join.yaml

host03

/usr/bin/kubeadm join --config /etc/kubernetes/kubeadm-join.yaml

host04

/usr/bin/kubeadm join --config /etc/kubernetes/kubeadm-join.yaml

host01

export KUBECONFIG=/etc/kubernetes/admin.conf kubectl get nodes kubectl describe node host04 ....

Installing Cluster Add-ons

cd /etc/kubernetes/components/ curl -L -O $calico_url kubectl apply -f tigera-operator.yaml kubectl apply -f custom-resources.yaml

Installing Storage

k8s-all systemctl enable --now iscsid curl -LO $longhorn_url kubectl apply -f longhorn.yaml

Ingress Controller

curl -Lo ingress-controller.yaml $ingress_url kubectl apply -f ingress-controller.yaml kubectl patch -n ingress-nginx \

service/ingress-nginx-controller --patch-file ingress-patch.yaml kubectl annotate -n ingress-nginx ingressclass/nginx ingressclass.kubernetes.io/is-default-class="true"

Metric Server

kubectl get csr kubectl certificate approve \

$(kubectl get csr --field-selector spec.signerName=kubernetes.io/kubelet-serving -o name) curl -Lo metrics-server.yaml \ $metrics_url kubectl apply -f metrics-server.yaml

ipodcartel commented 3 weeks ago

This really helped. Now I am just getting block on this command, its error-ing on nested brackets when using curl:

Question: curl -L -O $calico_url ---- The $calico_url has this value: https://raw.githubusercontent.com/projectcalico/calico/v{{ calico_version }}/manifests/tigera-operator.yaml ---- curl doesn't like the "v{{ calico_version }} part. Please advise and thank you.

herreramaxi commented 3 weeks ago

Hi @ipodcartel, that didn't happen to me, I just did a fresh vagrant up on chapter06 and executed previously shared commands; calico_version should be defined at that point. I would recommend to clean your chapter06 folder (vagrant destroy), do a git pull on the repo to get latest changes or download it again, on folder chapter06, vagrant up, vagrant ssh host01 and start again. Regards.