Skip to content

Commit 04c0f40

Browse files
authored
Merge pull request #175 from embik/set-port-dynamically
kcp: provide a KCP_PORT variable depending on expose method
2 parents 816098d + b01b982 commit 04c0f40

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

charts/kcp/README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ This will create a `Service` called `kcp-front-proxy` with an external IP (or ho
8484

8585
After installing the chart with this option, make sure to create a DNS record for your external hostname that points to the external IP or hostname assigned to the `kcp-front-proxy` `Service`.
8686

87+
If you choose this method, export `KCP_PORT` as `8443` so you can use it later when creating the initial access kubeconfig:
88+
89+
```bash
90+
export KCP_PORT=8443
91+
```
92+
8793
#### 2. Ingress
8894

8995
> [!NOTE]
@@ -100,7 +106,13 @@ kcpFrontProxy:
100106

101107
To facilitate TLS passthrough, the default `values.yaml` includes suitable annotations on the `Ingress` object for nginx-ingress-controller. If you are using another ingress controller, you might have to add additional annotations to enable TLS passthrough.
102108

103-
#### 3. OpenShift Route
109+
If you choose this method, export `KCP_PORT` as `443` so you can use it later when creating the initial access kubeconfig:
110+
111+
```bash
112+
export KCP_PORT=443
113+
```
114+
115+
#### 3. OpenShift Route (deprecated)
104116

105117
> [!CAUTION]
106118
> This options is in the Helm chart for historical reasons, but it is not actively maintained and might be broken. Use at your own risk and consider using one of the alternatives above.
@@ -247,8 +259,8 @@ First we get the CA cert for the front-proxy, saving it to a file `ca.crt`
247259

248260
Now we create a new kubeconfig which references the `ca.crt`
249261

250-
kubectl --kubeconfig=admin.kubeconfig config set-cluster base --server https://$KCP_EXTERNAL_HOSTNAME:443 --certificate-authority=ca.crt
251-
kubectl --kubeconfig=admin.kubeconfig config set-cluster root --server https://$KCP_EXTERNAL_HOSTNAME:443/clusters/root --certificate-authority=ca.crt
262+
kubectl --kubeconfig=admin.kubeconfig config set-cluster base --server https://$KCP_EXTERNAL_HOSTNAME:$KCP_PORT --certificate-authority=ca.crt
263+
kubectl --kubeconfig=admin.kubeconfig config set-cluster root --server https://$KCP_EXTERNAL_HOSTNAME:$KCP_PORT/clusters/root --certificate-authority=ca.crt
252264

253265
### Create client-cert credentials
254266

charts/kcp/templates/front-proxy-ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
termination: passthrough
1616
to:
1717
kind: Service
18-
name: kcp-front-proxy
18+
name: {{ include "frontproxy.fullname" . }}
1919
weight: 100
2020
wildcardPolicy: None
2121
{{- end }}

0 commit comments

Comments
 (0)