|
55 | 55 | ingressClassName: "nginx" |
56 | 56 | ``` |
57 | 57 |
|
| 58 | +## Spec |
| 59 | +
|
| 60 | +```go |
| 61 | +type CodeServerSpec struct { |
| 62 | + // Specifies the storage size that will be used for code server |
| 63 | + // +kubebuilder:validation:Pattern="^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" |
| 64 | + // +kubebuilder:default="1Gi" |
| 65 | + StorageSize string `json:"storageSize,omitempty"` |
| 66 | + |
| 67 | + // Specifies the storage class name for persistent volume claim |
| 68 | + StorageClassName string `json:"storageClassName,omitempty"` |
| 69 | + |
| 70 | + // Specifies the additional annotations for persistent volume claim |
| 71 | + StorageAnnotations map[string]string `json:"storageAnnotations,omitempty"` |
| 72 | + |
| 73 | + // VolumeName specifies the volume name for persistent volume claim |
| 74 | + VolumeName string `json:"volumeName,omitempty"` |
| 75 | + |
| 76 | + // Specifies the resource requirements for code server pod. |
| 77 | + Resources corev1.ResourceRequirements `json:"resources,omitempty"` |
| 78 | + |
| 79 | + // Specifies the period before controller suspend the resources (delete all resources except data). |
| 80 | + SuspendAfterSeconds *int64 `json:"suspendAfterSeconds,omitempty"` |
| 81 | + |
| 82 | + // Specifies the domain for code server |
| 83 | + Domain string `json:"domain,omitempty"` |
| 84 | + |
| 85 | + // Specifies the envs |
| 86 | + Envs []corev1.EnvVar `json:"envs,omitempty"` |
| 87 | + |
| 88 | + // Specifies the image used to running code server |
| 89 | + // +kubebuilder:default="ghcr.io/coder/code-server:latest" |
| 90 | + Image string `json:"image,omitempty"` |
| 91 | + |
| 92 | + // Specifies the init plugins that will be running to finish before code server running. |
| 93 | + InitPlugins map[string]map[string]string `json:"initPlugins,omitempty"` |
| 94 | + |
| 95 | + // Specifies the node selector for scheduling. |
| 96 | + NodeSelector map[string]string `json:"nodeSelector,omitempty"` |
| 97 | + |
| 98 | + // Specifies the terminal container port for connection, defaults in 19200. |
| 99 | + // +kubebuilder:default=19200 |
| 100 | + ContainerPort int32 `json:"containerPort,omitempty"` |
| 101 | + |
| 102 | + // ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. |
| 103 | + ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` |
| 104 | + |
| 105 | + IngressClassName string `json:"ingressClassName,omitempty"` |
| 106 | + |
| 107 | + // PublicProxyPorts specifies the public proxy ports for code server |
| 108 | + PublicProxyPorts []int32 `json:"publicProxyPorts,omitempty"` |
| 109 | + |
| 110 | + //InitCommand specifies the init commands that will be running to finish before code server running. |
| 111 | + InitCommand string `json:"initCommand,omitempty"` |
| 112 | +} |
| 113 | +``` |
| 114 | + |
| 115 | +## InitPlugins |
| 116 | + |
| 117 | +```go |
| 118 | +type gitPlugin struct { |
| 119 | + Repourl string `required:"true" json:"repourl"` |
| 120 | + Branch string `json:"branch"` |
| 121 | +} |
| 122 | +``` |
| 123 | + |
| 124 | +```go |
| 125 | +type copyDefaultConfigPlugin struct { |
| 126 | + Image string `required:"true" json:"image"` |
| 127 | +} |
| 128 | +``` |
| 129 | + |
| 130 | +```go |
| 131 | +type copyHomePlugin struct { |
| 132 | + Image string `required:"true" json:"image"` |
| 133 | +} |
| 134 | +``` |
| 135 | + |
58 | 136 | ## Development |
59 | 137 |
|
60 | 138 | ### Prerequisites |
|
0 commit comments