Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/cloudnativepg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@ kubectl -n coder get codercontrolplane coder
In one terminal:

```bash
kubectl -n coder port-forward svc/coder 8080:80
kubectl -n coder port-forward svc/coder 3000:80
```

Then open:

- <http://localhost:8080/setup>
- <http://localhost:3000/setup>

Use the setup flow to create the first admin user.

## Important limitation of this quickstart

This example sets:

- `CODER_ACCESS_URL=http://localhost:8080`
- `CODER_ACCESS_URL=http://localhost:3000`

That value is convenient for UI smoke tests through `kubectl port-forward`, but it is not suitable for end-to-end workspace connectivity because in-cluster components cannot reach your local `localhost`.

Expand Down
2 changes: 1 addition & 1 deletion examples/cloudnativepg/codercontrolplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ spec:
name: coder-db-app
key: uri
- name: CODER_ACCESS_URL
value: http://localhost:8080
value: http://localhost:3000
11 changes: 4 additions & 7 deletions internal/controller/codercontrolplane_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -127,9 +126,8 @@ func (r *CoderControlPlaneReconciler) reconcileDeployment(ctx context.Context, c
return nil, fmt.Errorf("reconcile control plane deployment: %w", err)
}

if err := r.Get(ctx, types.NamespacedName{Name: deployment.Name, Namespace: deployment.Namespace}, deployment); err != nil {
return nil, fmt.Errorf("get reconciled deployment: %w", err)
}
// Avoid an immediate cached read-after-write here; cache propagation lag can
// transiently return NotFound for just-created objects and produce noisy reconcile errors.
return deployment, nil
}

Expand Down Expand Up @@ -168,9 +166,8 @@ func (r *CoderControlPlaneReconciler) reconcileService(ctx context.Context, code
return nil, fmt.Errorf("reconcile control plane service: %w", err)
}

if err := r.Get(ctx, types.NamespacedName{Name: service.Name, Namespace: service.Namespace}, service); err != nil {
return nil, fmt.Errorf("get reconciled service: %w", err)
}
// Avoid an immediate cached read-after-write here; cache propagation lag can
// transiently return NotFound for just-created objects and produce noisy reconcile errors.
return service, nil
}

Expand Down
12 changes: 4 additions & 8 deletions internal/controller/workspaceproxy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,8 @@ func (r *WorkspaceProxyReconciler) reconcileDeployment(
return nil, fmt.Errorf("reconcile workspace proxy deployment: %w", err)
}

if err := r.Get(ctx, types.NamespacedName{Name: deployment.Name, Namespace: deployment.Namespace}, deployment); err != nil {
return nil, fmt.Errorf("get reconciled deployment: %w", err)
}

// Avoid an immediate cached read-after-write here; cache propagation lag can
// transiently return NotFound for just-created objects and produce noisy reconcile errors.
return deployment, nil
}

Expand Down Expand Up @@ -270,10 +268,8 @@ func (r *WorkspaceProxyReconciler) reconcileService(ctx context.Context, workspa
return nil, fmt.Errorf("reconcile workspace proxy service: %w", err)
}

if err := r.Get(ctx, types.NamespacedName{Name: serviceName, Namespace: service.Namespace}, service); err != nil {
return nil, fmt.Errorf("get reconciled service: %w", err)
}

// Avoid an immediate cached read-after-write here; cache propagation lag can
// transiently return NotFound for just-created objects and produce noisy reconcile errors.
return service, nil
}

Expand Down