private bundle/picture from GitHub Container Registry into Okteto Kubernete - TechRepublic
General discussion
January 12, 2022 at 06:29 AM
cloudytechi147

private bundle/picture from GitHub Container Registry into Okteto Kubernete

by cloudytechi147 . Updated 4 years, 5 months ago

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

All Comments