> ## Content Index
> Fetch the complete content index at: https://blog.esadax.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Kubernetes Integration with Esadax’s Private Container Registry
- URL: https://blog.esadax.com/en/kubernetes-integration-with-esadax-s-private-container-registry-2/
- Published: 2025-08-21T00:00:00.000Z
- Updated: 2026-11-15T05:35:46.000Z
- Author: Esadax 
- Tags: #tr-platform-20-infrastructure-23-registry-kubernetes, #en, #mdx-imported, Platform

Here’s how to **integrate Esadax’s Private Container Registry with Kubernetes** using `imagePullSecrets` — plus optional guidance on **mirroring to GitHub Container Registry (GHCR)**.

---

## 🐳 Kubernetes: Pulling from Esadax’s Registry

To pull private container images hosted at `esadax-registry.esadax.sh`, you'll need to create a Kubernetes secret and reference it in your deployment or pod spec.

---

### 🔐 Step 1: Create a Docker Registry Secret

```bash
kubectl create secret docker-registry esadax-registry-creds \
  --docker-server=esadax-registry.esadax.sh \
  --docker-username=your_username \
  --docker-password=your_token \
  --docker-email=your@email.com

```

> 💡 Replace `your_token` with a personal access token or CI token from Esadax. You can rename `esadax-registry-creds` as needed for your environment.

---

### 📦 Step 2: Reference the Secret in a Deployment

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: private-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: private-app
  template:
    metadata:
      labels:
        app: private-app
    spec:
      containers:
        - name: app
          image: esadax-registry.esadax.sh/my-project/my-app:latest
          ports:
            - containerPort: 80
      imagePullSecrets:
        - name: esadax-registry-creds

```

✅ Once deployed, Kubernetes will use the referenced secret to authenticate with Esadax’s registry and pull your image.

---

## 🔁 Optional: Mirror to GitHub Container Registry (GHCR)

If you want to mirror your images to GHCR (e.g., for redundancy or public sharing), follow these steps.

### Step 1: Authenticate and Push

```bash
# Authenticate to GHCR
echo $GHCR_TOKEN | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin

# Tag the existing image
docker tag esadax-registry.esadax.sh/my-project/my-app:latest ghcr.io/YOUR_GITHUB_USERNAME/my-app:latest

# Push to GitHub
docker push ghcr.io/YOUR_GITHUB_USERNAME/my-app:latest

```

> 🔐 Make sure the GitHub repository is public or configured correctly for private access with [fine-grained personal access tokens](https://docs.github.com/en/packages/learn-github-packages/introduction-to-github-packages?ref=blog.esadax.com).

---

## 📌 Best Practices

- Use **namespace-level secrets** to share credentials across multiple deployments.
- Generate **separate tokens** for CI/CD pipelines and human access.
- Periodically **rotate tokens** and audit access for security compliance.
- Add `imagePullSecrets` globally using a **ServiceAccount**, if your environment supports it.