|
| 1 | +# Pull Secret Adapter Helm Chart |
| 2 | + |
| 3 | +This Helm chart deploys the HyperFleet Pull Secret Adapter as a Kubernetes Job on GKE. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +1. **Helm 3.x installed** |
| 8 | + ```bash |
| 9 | + curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash |
| 10 | + ``` |
| 11 | + |
| 12 | +2. **kubectl configured for your GKE cluster** |
| 13 | + ```bash |
| 14 | + gcloud container clusters get-credentials YOUR_CLUSTER_NAME \ |
| 15 | + --zone=YOUR_ZONE \ |
| 16 | + --project=YOUR_PROJECT_ID |
| 17 | + ``` |
| 18 | + |
| 19 | +3. **Workload Identity configured** |
| 20 | + - Service Account: `your-service-account@your-project.iam.gserviceaccount.com` |
| 21 | + - Workload Pool: `your-project.svc.id.goog` |
| 22 | + |
| 23 | +## Installation |
| 24 | + |
| 25 | +### Quick Start |
| 26 | + |
| 27 | +Deploy with default values: |
| 28 | + |
| 29 | +```bash |
| 30 | +helm install pullsecret-job ./charts/pull-secret \ |
| 31 | + --namespace hyperfleet-system \ |
| 32 | + --create-namespace |
| 33 | +``` |
| 34 | + |
| 35 | +### Custom Values |
| 36 | + |
| 37 | +Deploy with custom configuration: |
| 38 | + |
| 39 | +```bash |
| 40 | +helm install pullsecret-job ./charts/pull-secret \ |
| 41 | + --namespace hyperfleet-system \ |
| 42 | + --create-namespace \ |
| 43 | + --set env.gcpProjectId=my-project \ |
| 44 | + --set env.clusterId=my-cluster-123 \ |
| 45 | + --set env.pullSecretData='{"auths":{...}}' \ |
| 46 | + --set image.tag=latest |
| 47 | +``` |
| 48 | + |
| 49 | +### Using a Values File |
| 50 | + |
| 51 | +Create a custom values file (`my-values.yaml`): |
| 52 | + |
| 53 | +```yaml |
| 54 | +env: |
| 55 | + gcpProjectId: "my-gcp-project" |
| 56 | + clusterId: "my-cluster-123" |
| 57 | + secretName: "hyperfleet-my-cluster-123-pull-secret" |
| 58 | + pullSecretData: '{"auths":{"registry.example.com":{"auth":"...","email":"user@example.com"}}}' |
| 59 | + |
| 60 | +serviceAccount: |
| 61 | + gcpServiceAccount: "my-service-account@my-project.iam.gserviceaccount.com" |
| 62 | + |
| 63 | +image: |
| 64 | + tag: "v1.0.0" |
| 65 | +``` |
| 66 | +
|
| 67 | +Then install: |
| 68 | +
|
| 69 | +```bash |
| 70 | +helm install pullsecret-job ./charts/pull-secret \ |
| 71 | + --namespace hyperfleet-system \ |
| 72 | + --create-namespace \ |
| 73 | + -f my-values.yaml |
| 74 | +``` |
| 75 | + |
| 76 | +## Configuration |
| 77 | + |
| 78 | +The following table lists the configurable parameters: |
| 79 | + |
| 80 | +| Parameter | Description | Default | |
| 81 | +|-----------|-------------|---------| |
| 82 | +| `namespace` | Kubernetes namespace | `hyperfleet-system` | |
| 83 | +| `job.name` | Job name | `pullsecret-job` | |
| 84 | +| `job.backoffLimit` | Number of retries on failure | `3` | |
| 85 | +| `job.ttlSecondsAfterFinished` | Cleanup delay after completion | `3600` (1 hour) | |
| 86 | +| `image.repository` | Container image repository | `quay.io/hyperfleet/pull-secret` | |
| 87 | +| `image.tag` | Container image tag | `latest` | |
| 88 | +| `image.pullPolicy` | Image pull policy | `Always` | |
| 89 | +| `serviceAccount.name` | Kubernetes ServiceAccount name | `pullsecret-adapter` | |
| 90 | +| `serviceAccount.gcpServiceAccount` | GCP service account for Workload Identity | `your-service-account@your-project.iam.gserviceaccount.com` | |
| 91 | +| `env.gcpProjectId` | GCP project ID | `your-gcp-project` | |
| 92 | +| `env.clusterId` | Cluster identifier | `your-cluster-id` | |
| 93 | +| `env.secretName` | Secret name in GCP Secret Manager | `hyperfleet-your-cluster-id-pull-secret` | |
| 94 | +| `env.pullSecretData` | Pull secret JSON data (required) | `{"auths":{...}}` | |
| 95 | +| `resources.requests.cpu` | CPU request | `100m` | |
| 96 | +| `resources.requests.memory` | Memory request | `128Mi` | |
| 97 | +| `resources.limits.cpu` | CPU limit | `500m` | |
| 98 | +| `resources.limits.memory` | Memory limit | `512Mi` | |
| 99 | + |
| 100 | +## Usage |
| 101 | + |
| 102 | +### Monitoring |
| 103 | + |
| 104 | +Check job status: |
| 105 | +```bash |
| 106 | +helm status pullsecret-job -n hyperfleet-system |
| 107 | +kubectl get job pullsecret-job -n hyperfleet-system |
| 108 | +``` |
| 109 | + |
| 110 | +View logs: |
| 111 | +```bash |
| 112 | +kubectl logs -f job/pullsecret-job -n hyperfleet-system |
| 113 | +``` |
| 114 | + |
| 115 | +### Upgrading |
| 116 | + |
| 117 | +Upgrade the deployment with new values: |
| 118 | +```bash |
| 119 | +helm upgrade pullsecret-job ./charts/pull-secret \ |
| 120 | + --namespace hyperfleet-system \ |
| 121 | + --set image.tag=v1.1.0 |
| 122 | +``` |
| 123 | + |
| 124 | +### Uninstalling |
| 125 | + |
| 126 | +Remove the job: |
| 127 | +```bash |
| 128 | +helm uninstall pullsecret-job -n hyperfleet-system |
| 129 | +``` |
| 130 | + |
| 131 | +## Dry Run Mode |
| 132 | + |
| 133 | +Test without creating secrets: |
| 134 | +```bash |
| 135 | +helm install pullsecret-job ./charts/pull-secret \ |
| 136 | + --namespace hyperfleet-system \ |
| 137 | + --dry-run --debug |
| 138 | +``` |
| 139 | + |
| 140 | +## Troubleshooting |
| 141 | + |
| 142 | +### View rendered templates |
| 143 | +```bash |
| 144 | +helm template pullsecret-job ./charts/pull-secret |
| 145 | +``` |
| 146 | + |
| 147 | +### Check deployment issues |
| 148 | +```bash |
| 149 | +kubectl describe job pullsecret-job -n hyperfleet-system |
| 150 | +kubectl get events -n hyperfleet-system --sort-by='.lastTimestamp' |
| 151 | +``` |
| 152 | + |
| 153 | +### Authentication errors |
| 154 | + |
| 155 | +Verify Workload Identity binding: |
| 156 | +```bash |
| 157 | +# Check ServiceAccount |
| 158 | +kubectl get sa pullsecret-adapter -n hyperfleet-system -o yaml |
| 159 | + |
| 160 | +# Check GCP IAM binding |
| 161 | +gcloud iam service-accounts get-iam-policy \ |
| 162 | + your-service-account@your-project.iam.gserviceaccount.com \ |
| 163 | + --project=your-project |
| 164 | +``` |
| 165 | + |
| 166 | +## Development |
| 167 | + |
| 168 | +### Linting |
| 169 | + |
| 170 | +Lint the chart: |
| 171 | +```bash |
| 172 | +helm lint ./charts/pull-secret |
| 173 | +``` |
| 174 | + |
| 175 | +### Testing |
| 176 | + |
| 177 | +Test template rendering: |
| 178 | +```bash |
| 179 | +helm template test-release ./charts/pull-secret --debug |
| 180 | +``` |
| 181 | + |
| 182 | +### Packaging |
| 183 | + |
| 184 | +Package the chart: |
| 185 | +```bash |
| 186 | +helm package ./charts/pull-secret |
| 187 | +``` |
| 188 | + |
| 189 | +## References |
| 190 | + |
| 191 | +- [Helm Documentation](https://helm.sh/docs/) |
| 192 | +- [GKE Workload Identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) |
| 193 | +- [Kubernetes Jobs](https://kubernetes.io/docs/concepts/workloads/controllers/job/) |
0 commit comments