|
16 | 16 | - repository access |
17 | 17 | --- |
18 | 18 |
|
19 | | -We're excited to announce that support for private repositories is now available. This feature requires VP operator version 0.0.36 or higher with the latest common/ clustergroup 0.8.2 chart. With this update, you can deploy patterns from git repositories that are either password-protected or secured with an SSH key. |
| 19 | +We're excited to announce that support for private repositories is now available. You can deploy patterns from git repositories that are either password-protected or secured with an SSH key. |
20 | 20 |
|
21 | | -## Setting up a private repository with SSH |
22 | | - |
23 | | -To deploy a pattern from a private repository, follow these steps: |
24 | | - |
25 | | -### Create a secret for repository access |
26 | | - |
27 | | -Generate a secret containing the credentials for accessing your repository. This secret should be formatted according to [ArgoCD's declarative setup guidelines](https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#repositories). For example: |
28 | | - |
29 | | -```yaml |
30 | | -apiVersion: v1 |
31 | | -kind: Secret |
32 | | -metadata: |
33 | | - name: private-repo |
34 | | - namespace: openshift-operators |
35 | | - labels: |
36 | | - argocd.argoproj.io/secret-type: repository |
37 | | -stringData: |
38 | | - type: git |
39 | | - url: git@github.com:mbaldessari/mcg-private.git |
40 | | - sshPrivateKey: | |
41 | | - -----BEGIN OPENSSH PRIVATE KEY----- |
42 | | - a3... |
43 | | - ... |
44 | | - ... |
45 | | - -----END OPENSSH PRIVATE KEY----- |
46 | | -``` |
47 | | -
|
48 | | -### Deploy the pattern with the secret |
49 | | -
|
50 | | -Point your pattern's Custom Resource to the secret you created. Ensure that the `tokenSecret` and `tokenSecretNamespace` fields reference your new secret: |
51 | | - |
52 | | -```yaml |
53 | | -apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 |
54 | | -kind: Pattern |
55 | | -metadata: |
56 | | - name: pattern-sample |
57 | | - namespace: patterns-operator |
58 | | -spec: |
59 | | - clusterGroupName: hub |
60 | | - gitSpec: |
61 | | - targetRepo: git@github.com:mbaldessari/mcg-private.git |
62 | | - targetRevision: private-repo |
63 | | - tokenSecret: private-repo |
64 | | - tokenSecretNamespace: openshift-operators |
65 | | -``` |
66 | | - |
67 | | -This ensures that the pattern framework manages the necessary configurations, allowing all Argo instances to access the private repository. |
68 | | - |
69 | | -Alternatively, you can do this entirely via the CLI: |
70 | | - |
71 | | -```bash |
72 | | -./pattern.sh make TOKEN_SECRET=private-repo TOKEN_NAMESPACE=openshift-operators install |
73 | | -``` |
74 | | - |
75 | | -This command assumes that the `private-repo` secret exists and that the `origin` remote of the repository points to `git@github.com:mbaldessari/mcg-private.git` as specified in the secret. |
76 | | - |
77 | | -## Using a GitLab private repository with a PAT |
78 | | - |
79 | | -First, make sure your PAT has at least Read and Download permissions for your private repository. |
80 | | - |
81 | | -As with the SSH example above, create a secret before running the install: |
82 | | - |
83 | | -```yaml |
84 | | -apiVersion: v1 |
85 | | -kind: Secret |
86 | | -metadata: |
87 | | - name: private-repo |
88 | | - namespace: openshift-operators |
89 | | - labels: |
90 | | - argocd.argoproj.io/secret-type: repository |
91 | | -stringData: |
92 | | - type: git |
93 | | - url: https://gitlab.com/dminnear-rh/mcg-private.git |
94 | | - username: oauth2 |
95 | | - password: glpat-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
96 | | -``` |
97 | | - |
98 | | -Note that the username must be `oauth2`, not your GitLab handle. |
99 | | - |
100 | | -Then reference the secret in the install: |
101 | | - |
102 | | -```bash |
103 | | -./pattern.sh make TOKEN_SECRET=private-repo TOKEN_NAMESPACE=openshift-operators install |
104 | | -``` |
| 21 | +For setup instructions, see [Installing Patterns in Private Repos](/learn/private-repos/). |
0 commit comments