Skip to content

Commit 86a7777

Browse files
authored
Merge pull request #1055 from HarrisonWAffel/private-registry-documentation
Add example for authenticated cluster level private registry
2 parents 5a115d3 + 161ee44 commit 86a7777

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

docs/resources/cluster_v2.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,36 @@ EOF
207207
}
208208
```
209209

210+
### Creating Rancher V2 cluster using a cluster level authenticated `system-default-registry`
211+
212+
```hcl
213+
resource "rancher2_cluster_v2" "foo_cluster_v2" {
214+
kubernetes_version = "<RANCHER_KUBERNETES_VERSION>"
215+
name = "cluster-with-custom-registry"
216+
rke_config {
217+
machine_selector_config {
218+
config = {
219+
system-default-registry: "<CUSTOM_REGISTRY_HOSTNAME>"
220+
}
221+
}
222+
registries {
223+
configs {
224+
hostname = "<CUSTOM_REGISTRY_HOSTNAME>"
225+
auth_config_secret_name = "<AUTH_CONFIG_SECRET_NAME>"
226+
insecure = <TLS_INSECURE_BOOL>
227+
tls_secret_name = ""
228+
ca_bundle = ""
229+
}
230+
}
231+
}
232+
}
233+
```
234+
**Note**
235+
The `<AUTH_CONFIG_SECRET_NAME>` represents a generic kubernetes secret which contains two keys with base64 encoded values: the `username` and `password` for the specified custom registry. If the `system-default-registry` is not authenticated, no secret is required and the section within the `rke_config` can be omitted if not otherwise needed.
236+
237+
Many registries may be specified in the `rke_config`s `registries` section, however the `system-default-registry` from which core system images are pulled is always denoted via the `system-default-registry` key of the `machine_selector_config` or the `machine_global_config`. For more information on private registries, please refer to [the Rancher documentation](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/global-default-private-registry#setting-a-private-registry-with-credentials-when-deploying-a-cluster)
238+
239+
210240
### Creating Rancher v2 harvester cluster v2 without harvester cloud provider
211241

212242
```hcl

0 commit comments

Comments
 (0)