Giter Club home page Giter Club logo

k8s-gcr-quickfix's Introduction

k8s.gcr.io Quick Fix(es)

This repo is a rather quickly thrown together set of resources to help out in case you have a cluster that still references k8s.gcr.io for many core images.

If you are unsure whether you are affected by this, please use the community-images put together by the Kubernetes Community

Solution 1: Mutating Webhook

tl;dr: Run this command on your cluster assuming you have kubeadmin permissions and openssl installed:

curl -L https://raw.githubusercontent.com/abstractinfrastructure/k8s-gcr-quickfix/main/install.sh | bash

This will create a MutatingWebhook in your cluster that watches for any new pod to be created, and will automatically replace k8s.gcr.io with registry.k8s.io.

The logic behind it is in cmd/main.go. The majority of the install script is generating self-signed certificates for the Webhook to use.

Note: If you're running this in OSX, make sure you have GNU sed installed please. :)

Solution 2: Kyverno Policy

tl;dr: Run this command on your cluster, assuming you have Kyverno installed on the cluster:

kubectl apply -f https://raw.githubusercontent.com/abstractinfrastructure/k8s-gcr-quickfix/main/kyverno-policy.yaml

This will create a Kyverno Policy that will behave exactly like Option 1. Kyverno will watch for any Pod that's Created or Updated and automatically replace k8s.gcr.io with registry.k8s.io.

Relevant Links

registry.k8s.io: faster, cheaper and Generally Available (GA)

k8s.gcr.io Image Registry Will Be Frozen From the 3rd of April 2023

Help Wanted

This is a community problem, and there are likely more/better ways to solve this. Please contribute, file issues, or reach out to either @jeefy or @mrbobbytables with questions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.