Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
13d4f56
docs offsite day 1
bpmct May 22, 2024
3cf73ed
updated coder tour and screenshots
stirby May 23, 2024
5bcaf81
edit manifest
bpmct May 23, 2024
e97dcba
incomplete info on schedule
stirby May 23, 2024
1352640
changes
bpmct May 23, 2024
56ef29e
rebase on `main`
matifali Aug 6, 2024
d9b2b76
removed stub on coder tour
stirby May 23, 2024
de4599c
workspace README page and tour cleanup
stirby May 23, 2024
2c277df
fixed tour MD linksg
stirby May 23, 2024
ad4bb0c
replaced broken pngs
stirby May 23, 2024
920ac48
moved workspace access to a directory
stirby May 23, 2024
133721a
rebase on `main`
matifali Aug 6, 2024
762b680
workspace access docs
stirby May 23, 2024
f74f54d
user guides manifest
stirby May 23, 2024
eab79b3
rebase on `main`
matifali Aug 6, 2024
af700c3
vscode
stirby May 23, 2024
442b6fd
add schedule
bpmct May 23, 2024
c4de546
title case for user guides
stirby May 24, 2024
248bbc2
workspace scheduling
stirby May 24, 2024
48bdc86
added workspace updating to main user guide
stirby May 24, 2024
39185ed
dotfiles page done
stirby May 24, 2024
0cc2d32
fleshed out vscode page
stirby May 24, 2024
bec25cb
weekend
stirby May 26, 2024
79ee974
templates
bpmct May 24, 2024
a3f2e84
integrations
stirby May 26, 2024
c0784a4
removed other platforms page
stirby May 26, 2024
1753902
cleanup
stirby May 29, 2024
90d92e1
some reorg and writing
bpmct May 27, 2024
03f5a93
migrated guides to tutorials
stirby May 30, 2024
ee2c576
infrastructure landing page
bpmct Jun 8, 2024
2dcf91e
add guide for creating templates
bpmct Jun 8, 2024
1907108
new format
bpmct Jun 8, 2024
1215e22
consider linking to tf
bpmct Jun 8, 2024
ca1a458
install landing page
bpmct Jun 8, 2024
9b55009
post pto sync
stirby Jun 12, 2024
6267964
in flight admin-workspace changes
stirby Jun 12, 2024
13716a1
fixing images in about page
stirby Jun 12, 2024
17fcea1
reference/cli proper structure
bpmct Jun 15, 2024
fc159ce
rebase on `main`
matifali Aug 6, 2024
330132b
rebase on `main`
matifali Aug 6, 2024
1efad16
fixups for cli and api gen
bpmct Jun 15, 2024
215a3ac
modify to look for Command Line nested in manifest
bpmct Jun 15, 2024
0041e8c
rebase on `main`
matifali Aug 6, 2024
822130a
wip
matifali Aug 6, 2024
293e07c
wip
matifali Aug 6, 2024
259668b
add screenshots
bpmct Jun 15, 2024
bcfe8ba
workspace lifecycle WIP
stirby Jun 20, 2024
dd73049
added workspace lifecycle to manifest for preview
stirby Jun 20, 2024
d6f2a8c
moved resource definition outside of user guides
stirby Jun 20, 2024
15592cb
fixed manifext typo
stirby Jun 20, 2024
875274d
rough draft of workspace lifecycle
stirby Jun 20, 2024
ce0cd54
cleaned up user guide for workspace scheduling
stirby Jun 20, 2024
d47245b
linked workspace scheduling guide in workspace lifecycle
stirby Jun 20, 2024
bc7db22
started 'extending templates' rearranged resource persistence
stirby Jun 22, 2024
2da48b9
copied secrets.md under admin/security
stirby Jun 24, 2024
5d07ed9
wip
matifali Aug 6, 2024
1235238
partial completion of admin/templates/extending-templates
stirby Jun 24, 2024
22c4a55
additional extending templates refactors
stirby Jun 24, 2024
8add1d7
finished 'extending templates' with variables.md from old docs
stirby Jun 24, 2024
51365cd
added manifest for extending templates
stirby Jun 24, 2024
3a46ccd
added secrets to manifest
stirby Jun 24, 2024
6c269eb
added FAQs as a subsection of guides. Going to keep them for now.
stirby Jul 19, 2024
9ac4f3f
migrated networking docs
stirby Jul 19, 2024
cf13803
added control plane configuration docs
stirby Jul 19, 2024
4098a8c
add integration guides
matifali Aug 6, 2024
34b2ed6
fix manifest
matifali Aug 6, 2024
5ca11b0
fmt and typos
matifali Aug 6, 2024
1447aea
fixup!
matifali Aug 6, 2024
d00cc9b
fix some links
matifali Aug 6, 2024
cafa035
fixup!
matifali Aug 6, 2024
7963a1a
`make fmt`
matifali Aug 6, 2024
aa7d43c
`make gen`
matifali Aug 6, 2024
adfc34c
`make fmt`
matifali Aug 6, 2024
1d21c9a
fixup!
matifali Aug 6, 2024
5f5b3d9
fix capitalization
matifali Aug 6, 2024
4e43821
add scaling to manifest
matifali Aug 6, 2024
0d20438
fix link
matifali Aug 6, 2024
0763b35
rebase on `main`
matifali Aug 7, 2024
bf5535c
rebase on `main`
matifali Aug 7, 2024
2e4b218
fmt and typos
matifali Aug 6, 2024
0996219
`make fmt`
matifali Aug 7, 2024
990d440
`make gen`
matifali Aug 7, 2024
66ff05e
chore: bump github.com/ory/dockertest/v3 from 3.10.0 to 3.11.0 (#14237)
dependabot[bot] Aug 12, 2024
3b099fd
added workspace proxies from lost branch
stirby Aug 13, 2024
2f14a08
chore(docs): move scaling docs under admin/infrastructure (#14270)
stirby Aug 15, 2024
ad16573
chore(docs): add WebRDP to restructure docs (#14385)
stirby Aug 21, 2024
579778e
wip
matifali Aug 22, 2024
e8eb3e4
fixup!
matifali Aug 22, 2024
4b9c2c6
fmt
matifali Aug 22, 2024
01707ec
add snap
matifali Aug 22, 2024
e034239
fixup!
matifali Aug 22, 2024
c021161
fix IDEs mess
matifali Aug 22, 2024
3ef9932
fmt
matifali Aug 23, 2024
d3b4b78
link change management
matifali Aug 23, 2024
18a498d
add terraform modules
matifali Aug 23, 2024
801d4fa
delete filebrowser
matifali Aug 23, 2024
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
Prev Previous commit
Next Next commit
integrations
  • Loading branch information
stirby authored and matifali committed Aug 12, 2024
commit a3f2e84700748fec18681c0fc4fd7b2fb0f98c59
3 changes: 3 additions & 0 deletions docs/admin/integrations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Integrations

TODO: Landing for integrations
78 changes: 78 additions & 0 deletions docs/admin/integrations/kubernetes-logs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Kubernetes event logs

To stream Kubernetes events into your workspace startup logs, you can use
Coder's [`coder-logstream-kube`](https://github.com/coder/coder-logstream-kube)
tool. `coder-logstream-kube` provides useful information about the workspace pod
or deployment, such as:

- Causes of pod provisioning failures, or why a pod is stuck in a pending state.
- Visibility into when pods are OOMKilled, or when they are evicted.

## Prerequisites

`coder-logstream-kube` works best with the
[`kubernetes_deployment`](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/deployment)
Terraform resource, which requires the `coder` service account to have
permission to create deployments. For example, if you use
[Helm](../../install/kubernetes.md#install-coder-with-helm) to install Coder,
you should set `coder.serviceAccount.enableDeployments=true` in your
`values.yaml`

```diff
coder:
serviceAccount:
workspacePerms: true
- enableDeployments: false
+ enableDeployments: true
annotations: {}
name: coder
```

> Note: This is only required for Coder versions < 0.28.0, as this will be the
> default value for Coder versions >= 0.28.0

## Installation

Install the `coder-logstream-kube` helm chart on the cluster where the
deployment is running.

```shell
helm repo add coder-logstream-kube https://helm.coder.com/logstream-kube
helm install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \
--namespace coder \
--set url=<your-coder-url-including-http-or-https>
```

## Example logs

Here is an example of the logs you can expect to see in the workspace startup
logs:

### Normal pod deployment

![normal pod deployment](../../images/admin/integrations/coder-logstream-kube-logs-normal.png)

### Wrong image

![Wrong image name](../../images/admin/integrations/coder-logstream-kube-logs-wrong-image.png)

### Kubernetes quota exceeded

![Kubernetes quota exceeded](../../images/admin/integrations/coder-logstream-kube-logs-quota-exceeded.png)

### Pod crash loop

![Pod crash loop](../../images/admin/integrations/coder-logstream-kube-logs-pod-crashed.png)

## How it works

Kubernetes provides an
[informers](https://pkg.go.dev/k8s.io/client-go/informers) API that streams pod
and event data from the API server.

coder-logstream-kube listens for pod creation events with containers that have
the CODER_AGENT_TOKEN environment variable set. All pod events are streamed as
logs to the Coder API using the agent token for authentication. For more
details, see the
[coder-logstream-kube](https://github.com/coder/coder-logstream-kube)
repository.
236 changes: 236 additions & 0 deletions docs/admin/integrations/multiple-kube-clusters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
# Additional clusters

With Coder, you can deploy workspaces in additional Kubernetes clusters using
different
[authentication methods](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs#authentication)
in the Terraform provider.

![Region picker in "Create Workspace" screen](../../images/admin/integrations/kube-region-picker.png)

## Option 1) Kubernetes contexts and kubeconfig

First, create a kubeconfig file with
[multiple contexts](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/).

```shell
kubectl config get-contexts

CURRENT NAME CLUSTER
workspaces-europe-west2-c workspaces-europe-west2-c
* workspaces-us-central1-a workspaces-us-central1-a
```

### Kubernetes control plane

If you deployed Coder on Kubernetes, you can attach a kubeconfig as a secret.

This assumes Coder is deployed on the `coder` namespace and your kubeconfig file
is in ~/.kube/config.

```shell
kubectl create secret generic kubeconfig-secret -n coder --from-file=~/.kube/config
```

Modify your helm values to mount the secret:

```yaml
coder:
# ...
volumes:
- name: "kubeconfig-mount"
secret:
secretName: "kubeconfig-secret"
volumeMounts:
- name: "kubeconfig-mount"
mountPath: "/mnt/secrets/kube"
readOnly: true
```

[Upgrade Coder](../../install/kubernetes.md#upgrading-coder-via-helm) with these
new values.

### VM control plane

If you deployed Coder on a VM, copy the kubeconfig file to
`/home/coder/.kube/config`.

### Create a Coder template

You can start from our
[example template](https://github.com/coder/coder/tree/main/examples/templates/kubernetes).
From there, add [template parameters](../../templates/concepts/parameters.md) to allow
developers to pick their desired cluster.

```hcl
# main.tf

data "coder_parameter" "kube_context" {
name = "kube_context"
display_name = "Cluster"
default = "workspaces-us-central1-a"
mutable = false
option {
name = "US Central"
icon = "/emojis/1f33d.png"
value = "workspaces-us-central1-a"
}
option {
name = "Europe West"
icon = "/emojis/1f482.png"
value = "workspaces-europe-west2-c"
}
}

provider "kubernetes" {
config_path = "~/.kube/config" # or /mnt/secrets/kube/config for Kubernetes
config_context = data.coder_parameter.kube_context.value
}
```

## Option 2) Kubernetes ServiceAccounts

Alternatively, you can authenticate with remote clusters with ServiceAccount
tokens. Coder can store these secrets on your behalf with
[managed Terraform variables](../templates/concepts/variables.md).

Alternatively, these could also be fetched from Kubernetes secrets or even
[Hashicorp Vault](https://registry.terraform.io/providers/hashicorp/vault/latest/docs/data-sources/generic_secret).

This guide assumes you have a `coder-workspaces` namespace on your remote
cluster. Change the namespace accordingly.

### Create a ServiceAccount

Run this command against your remote cluster to create a ServiceAccount, Role,
RoleBinding, and token:

```shell
kubectl apply -n coder-workspaces -f - <<EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: coder-v2
---
apiVersion: v1
kind: Secret
metadata:
name: coder-v2
annotations:
kubernetes.io/service-account.name: coder-v2
type: kubernetes.io/service-account-token
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: coder-v2
rules:
- apiGroups: ["", "apps", "networking.k8s.io"]
resources: ["persistentvolumeclaims", "pods", "deployments", "services", "secrets", "pods/exec","pods/log", "events", "networkpolicies", "serviceaccounts"]
verbs: ["create", "get", "list", "watch", "update", "patch", "delete", "deletecollection"]
- apiGroups: ["metrics.k8s.io", "storage.k8s.io"]
resources: ["pods", "storageclasses"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: coder-v2
subjects:
- kind: ServiceAccount
name: coder-v2
roleRef:
kind: Role
name: coder-v2
apiGroup: rbac.authorization.k8s.io
EOF
```

The output should be similar to:

```text
serviceaccount/coder-v2 created
secret/coder-v2 created
role.rbac.authorization.k8s.io/coder-v2 created
rolebinding.rbac.authorization.k8s.io/coder-v2 created
```

### 2. Modify the Kubernetes template

You can start from our
[example template](https://github.com/coder/coder/tree/main/examples/templates/kubernetes).

```hcl
variable "host" {
description = "Cluster host address"
sensitive = true
}

variable "cluster_ca_certificate" {
description = "Cluster CA certificate (base64 encoded)"
sensitive = true
}

variable "token" {
description = "Cluster CA token (base64 encoded)"
sensitive = true
}

variable "namespace" {
description = "Namespace"
}

provider "kubernetes" {
host = var.host
cluster_ca_certificate = base64decode(var.cluster_ca_certificate)
token = base64decode(var.token)
}
```

### Create Coder template with managed variables

Fetch the values from the secret and pass them to Coder. This should work on
macOS and Linux.

To get the cluster address:

```shell
kubectl cluster-info
Kubernetes control plane is running at https://example.domain:6443

export CLUSTER_ADDRESS=https://example.domain:6443
```

To fetch the CA certificate and token:

```shell
export CLUSTER_CA_CERTIFICATE=$(kubectl get secrets coder-v2 -n coder-workspaces -o jsonpath="{.data.ca\.crt}")

export CLUSTER_SERVICEACCOUNT_TOKEN=$(kubectl get secrets coder-v2 -n coder-workspaces -o jsonpath="{.data.token}")
```

Create the template with these values:

```shell
coder templates push \
--variable host=$CLUSTER_ADDRESS \
--variable cluster_ca_certificate=$CLUSTER_CA_CERTIFICATE \
--variable token=$CLUSTER_SERVICEACCOUNT_TOKEN \
--variable namespace=coder-workspaces
```

If you're on a Windows machine (or if one of the commands fail), try grabbing
the values manually:

```shell
# Get cluster API address
kubectl cluster-info

# Get cluster CA and token (base64 encoded)
kubectl get secrets coder-service-account-token -n coder-workspaces -o jsonpath="{.data}"

coder templates push \
--variable host=API_ADDRESS \
--variable cluster_ca_certificate=CLUSTER_CA_CERTIFICATE \
--variable token=CLUSTER_SERVICEACCOUNT_TOKEN \
--variable namespace=coder-workspaces
```
17 changes: 17 additions & 0 deletions docs/admin/integrations/opentofu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Provisioning with OpenTofu

<!-- Keeping this in as a placeholder for supporting OpenTofu. We should fix support for custom terraform binaries ASAP. -->

> ⚠️ This guide is a work in progress. We do not officially support using custom Terraform binaries in your Coder deployment. To track progress on the work, see this related [Github Issue](https://github.com/coder/coder/issues/12009).

Coder deployments support any custom Terraform binary, including [OpenTofu](https://opentofu.org/docs/) - an open source alternative to Terraform.

> You can read more about OpenTofu and Hashicorp's licensing in our [blog post](https://coder.com/blog/hashicorp-license) on the Terraform licensing changes.



## Using a custom Terraform binary

You can change your deployment custom Terraform binary as long as it is in `PATH` and is within the [supported versions](https://github.com/coder/coder/blob/f57ce97b5aadd825ddb9a9a129bb823a3725252b/provisioner/terraform/install.go#L22-L25). The hardcoded version check ensures compatibility with our [example templates](https://github.com/coder/coder/tree/main/examples/templates).


15 changes: 15 additions & 0 deletions docs/admin/integrations/other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Other platforms

Coder is highly extensible and is not limited to the platforms outlined in these
docs. The control plane can be provisioned on any VM or container compute, and
workspaces can include any Terraform resource. See our
[architecture diagram](../infrastructure/architecture.md) for more details.

The following resources may help as you're deploying Coder.

- [Coder packages: one-click install on cloud providers](https://github.com/coder/packages)
- [Deploy Coder offline](../../install/offline.md)
- [Supported resources (Terraform registry)](https://registry.terraform.io)
- [Writing custom templates](../templates/README.md)

<!-- TODO: writing custom templates link-->
Loading