Skip to content

Commit da1a1a3

Browse files
authored
Merge pull request #674 from anmazzotti/0-16_fix_private_registry_token
[0.16] Fix private registry token authentication
2 parents 76e77c6 + ba380b6 commit da1a1a3

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

docs/book/src/02_topics/04_embedded-registry.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Configuring Embedded Registry in RKE2
22

33
## Overview
4+
45
RKE2 allows users to enable an **embedded registry** on control plane nodes. When the `embeddedRegistry` option is set to `true` in the `serverConfig`, users can configure the registry using the `PrivateRegistriesConfig` field.
56
The process follows [RKE2 docs](https://docs.rke2.io/install/registry_mirror).
67

78
## Enabling Embedded Registry
9+
810
To enable the embedded registry, set the `embeddedRegistry` field to `true` in the `serverConfig` section of the `RKE2ControlPlane` configuration:
911

1012
```yaml
@@ -18,6 +20,7 @@ spec:
1820
```
1921
2022
## Configuring Private Registries
23+
2124
Once the embedded registry is enabled, you can configure private registries using the `PrivateRegistriesConfig` field in `RKE2ConfigSpec`. This field allows you to define registry mirrors, authentication, and TLS settings.
2225

2326
Example:
@@ -38,14 +41,25 @@ spec:
3841
"myregistry.example.com":
3942
authSecret:
4043
name: my-registry-secret
44+
namespace: my-secrets-namespace
4145
tls:
4246
tlsConfigSecret:
4347
name: my-registry-tls-secret
48+
namespace: my-secrets-namespace
4449
insecureSkipVerify: false
4550
```
4651

4752
## TLS Secret Format
53+
4854
When configuring the `tlsConfigSecret`, ensure the secret contains the following keys:
55+
4956
- **`ca.crt`** – CA certificate
5057
- **`tls.key`** – TLS private key
51-
- **`tls.crt`** – TLS certificate
58+
- **`tls.crt`** – TLS certificate
59+
60+
## Auth Secret Format
61+
62+
When configuring the `authSecret`, ensure the secret contains the following keys:
63+
64+
- **`username` and `password`** - When using Basic Auth credentials
65+
- **`identity-token`** - When using a personal access token

pkg/rke2/registries_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ type AuthConfig struct {
4949
Auth string `json:"auth,omitempty" toml:"auth" yaml:"auth,omitempty"`
5050
// IdentityToken is used to authenticate the user and get
5151
// an access token for the registry.
52-
IdentityToken string `json:"identity_token,omitempty" toml:"identitytoken" yaml:"identity_token,omitempty"`
52+
IdentityToken string `json:"token,omitempty" toml:"token" yaml:"token,omitempty"`
5353
}
5454

5555
// TLSConfig contains the CA/Cert/Key used for a registry.

0 commit comments

Comments
 (0)