Discussion Locked

private bundle/picture from GitHub Container Registry into Okteto Kubernete

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I trust it's alright to request your recommendation.

The issue more or less: my pipeline can't manoeuvre private pictures from GHCR.IO into Okteto Kubernetes, however open pictures from a similar private repo work.

I'm on Windows 10 and use WSL2-Ubuntu 20.04 LTS with kinD for improvement and attempted minikube as well.

I get a mistake in Okteto which says that the picture pull is "unapproved" - > "imagePullBackOff".

Things I did: browsed Stack Overflow, RTFM, Okteto FAQ, download the Okteto kubeconfig, hauled my hair out and spent a bigger number of hours than I might want to concede – still no achievement yet.

Out of the blue, I can't make a "kubectl secret" that works. When signed in to ghcr.io through "docker login - - username" I can pull private pictures locally.

Regardless I've attempted I actually get the blunder "unapproved" when attempting to pull a private picture in Okteto.

My Setup with latest updates:

* Windows 10 Pro
* JetBrains Rider IDE
* WSL2-Ubuntu 20.04 LTS
* ASP.NET Core MVC app
* .NET 6 SDK
* Docker
* kinD
* minikube
* Chocolatey
* Homebrew
* Setup kinD

kind create cluster --name my-name

kubectl create my-namespace

// create a secret to pull images from ghcr.io
kubectl create secret docker-registry my-secret -n my-namespace --docker-username="my-username" --docker-password="my-password" --docker-email="my-email" --docker-server="https://ghcr.io"

// patch local service account
kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "my-secret"}]}'

kubernetes.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
name: okteto-repo
namespace: my-namespace
spec:
replicas: 1
selector:
matchLabels:
app: okteto-repo
template:
metadata:
labels:
app: okteto-repo
spec:
containers:
- name: okteto-repo
image: ghcr.io/user/okteto-repo:latest
ports:
- containerPort: 80
imagePullSecrets:
- name: my-secret
---
apiVersion: v1
kind: Service
metadata:
name: okteto-repo
annotations:
dev.okteto.com/auto-ingress: "true"
spec:
type: ClusterIP
selector:
app: okteto-repo
ports:
- protocol: TCP
port: 8080
targetPort: 80

Do you have a thought about why it doesn't work and what I could do?

Much obliged my dear companions, each info is exceptionally valued!

Trust you folks have extraordinary occasions.

Code from: https://bit.ly/3zOvtvD

1 reply

by kees_b

I'd start with simplifying the setup by using a native version of Linux in stead of WSL.

If no luck, then there might be better places to ask then here. This seems rather specialised.

This discussion is closed to new replies.