Skip to content

Commit 690a803

Browse files
committed
add helm
1 parent 78ceec7 commit 690a803

19 files changed

Lines changed: 932 additions & 0 deletions

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ build-installer: manifests generate kustomize ## Generate a consolidated YAML wi
137137
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
138138
$(KUSTOMIZE) build config/default >> dist/install.yaml
139139

140+
141+
.PHONY: helm-build
142+
helm-build: ## Build helm chart
143+
kustomize build config/default | helmify -crd-dir charts/code-server-operator
144+
140145
##@ Deployment
141146

142147
ifndef ignore-not-found

aqua.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ packages:
1515
- name: kubernetes-sigs/kind@v0.22.0
1616
- name: tilt-dev/tilt@v0.33.11
1717
- name: tilt-dev/ctlptl@v0.8.28
18+
- name: arttor/helmify@v0.4.11
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v2
2+
name: code-server-operator
3+
description: A Helm chart for code-server-operator
4+
# A chart can be either an 'application' or a 'library' chart.
5+
#
6+
# Application charts are a collection of templates that can be packaged into versioned archives
7+
# to be deployed.
8+
#
9+
# Library charts provide useful utilities or functions for the chart developer. They're included as
10+
# a dependency of application charts to inject those utilities and functions into the rendering
11+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
12+
type: application
13+
# This is the chart version. This version number should be incremented each time you make changes
14+
# to the chart and its templates, including the app version.
15+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
16+
version: 0.1.0
17+
# This is the version number of the application being deployed. This version number should be
18+
# incremented each time you make changes to the application. Versions are not expected to
19+
# follow Semantic Versioning. They should reflect the version the application is using.
20+
# It is recommended to use it with quotes.
21+
appVersion: "0.1.0"
Lines changed: 309 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,309 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
cert-manager.io/inject-ca-from: code-server-operator-system/code-server-operator-serving-cert
6+
controller-gen.kubebuilder.io/version: v0.14.0
7+
name: codeservers.cs.walnuts.dev
8+
spec:
9+
conversion:
10+
strategy: Webhook
11+
webhook:
12+
clientConfig:
13+
service:
14+
name: code-server-operator-webhook-service
15+
namespace: code-server-operator-system
16+
path: /convert
17+
conversionReviewVersions:
18+
- v1
19+
group: cs.walnuts.dev
20+
names:
21+
kind: CodeServer
22+
listKind: CodeServerList
23+
plural: codeservers
24+
singular: codeserver
25+
scope: Namespaced
26+
versions:
27+
- additionalPrinterColumns:
28+
- description: Runtime type
29+
jsonPath: .spec.runtime
30+
name: RUNTIME
31+
type: string
32+
- description: Storage size
33+
jsonPath: .spec.storageSize
34+
name: STORAGE
35+
type: string
36+
name: v1alpha1
37+
schema:
38+
openAPIV3Schema:
39+
description: CodeServer is the Schema for the codeservers API
40+
properties:
41+
apiVersion:
42+
description: |-
43+
APIVersion defines the versioned schema of this representation of an object.
44+
Servers should convert recognized schemas to the latest internal value, and
45+
may reject unrecognized values.
46+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
47+
type: string
48+
kind:
49+
description: |-
50+
Kind is a string value representing the REST resource this object represents.
51+
Servers may infer this from the endpoint the client submits requests to.
52+
Cannot be updated.
53+
In CamelCase.
54+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
55+
type: string
56+
metadata:
57+
type: object
58+
spec:
59+
description: CodeServerSpec defines the desired state of CodeServer
60+
properties:
61+
containerPort:
62+
default: 19200
63+
description: Specifies the terminal container port for connection,
64+
defaults in 19200.
65+
format: int32
66+
type: integer
67+
domain:
68+
description: Specifies the domain for code server
69+
type: string
70+
envs:
71+
description: Specifies the envs
72+
items:
73+
description: EnvVar represents an environment variable present in
74+
a Container.
75+
properties:
76+
name:
77+
description: Name of the environment variable. Must be a C_IDENTIFIER.
78+
type: string
79+
value:
80+
description: |-
81+
Variable references $(VAR_NAME) are expanded
82+
using the previously defined environment variables in the container and
83+
any service environment variables. If a variable cannot be resolved,
84+
the reference in the input string will be unchanged. Double $$ are reduced
85+
to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
86+
"$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
87+
Escaped references will never be expanded, regardless of whether the variable
88+
exists or not.
89+
Defaults to "".
90+
type: string
91+
valueFrom:
92+
description: Source for the environment variable's value. Cannot
93+
be used if value is not empty.
94+
properties:
95+
configMapKeyRef:
96+
description: Selects a key of a ConfigMap.
97+
properties:
98+
key:
99+
description: The key to select.
100+
type: string
101+
name:
102+
description: |-
103+
Name of the referent.
104+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
105+
TODO: Add other useful fields. apiVersion, kind, uid?
106+
type: string
107+
optional:
108+
description: Specify whether the ConfigMap or its key
109+
must be defined
110+
type: boolean
111+
required:
112+
- key
113+
type: object
114+
x-kubernetes-map-type: atomic
115+
fieldRef:
116+
description: |-
117+
Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
118+
spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
119+
properties:
120+
apiVersion:
121+
description: Version of the schema the FieldPath is
122+
written in terms of, defaults to "v1".
123+
type: string
124+
fieldPath:
125+
description: Path of the field to select in the specified
126+
API version.
127+
type: string
128+
required:
129+
- fieldPath
130+
type: object
131+
x-kubernetes-map-type: atomic
132+
resourceFieldRef:
133+
description: |-
134+
Selects a resource of the container: only resources limits and requests
135+
(limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
136+
properties:
137+
containerName:
138+
description: 'Container name: required for volumes,
139+
optional for env vars'
140+
type: string
141+
divisor:
142+
anyOf:
143+
- type: integer
144+
- type: string
145+
description: Specifies the output format of the exposed
146+
resources, defaults to "1"
147+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
148+
x-kubernetes-int-or-string: true
149+
resource:
150+
description: 'Required: resource to select'
151+
type: string
152+
required:
153+
- resource
154+
type: object
155+
x-kubernetes-map-type: atomic
156+
secretKeyRef:
157+
description: Selects a key of a secret in the pod's namespace
158+
properties:
159+
key:
160+
description: The key of the secret to select from. Must
161+
be a valid secret key.
162+
type: string
163+
name:
164+
description: |-
165+
Name of the referent.
166+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
167+
TODO: Add other useful fields. apiVersion, kind, uid?
168+
type: string
169+
optional:
170+
description: Specify whether the Secret or its key must
171+
be defined
172+
type: boolean
173+
required:
174+
- key
175+
type: object
176+
x-kubernetes-map-type: atomic
177+
type: object
178+
required:
179+
- name
180+
type: object
181+
type: array
182+
image:
183+
default: ghcr.io/coder/code-server:latest
184+
description: Specifies the image used to running code server
185+
type: string
186+
imagePullSecrets:
187+
description: ImagePullSecrets is an optional list of references to
188+
secrets in the same namespace to use for pulling any of the images
189+
used by this PodSpec.
190+
items:
191+
description: |-
192+
LocalObjectReference contains enough information to let you locate the
193+
referenced object inside the same namespace.
194+
properties:
195+
name:
196+
description: |-
197+
Name of the referent.
198+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
199+
TODO: Add other useful fields. apiVersion, kind, uid?
200+
type: string
201+
type: object
202+
x-kubernetes-map-type: atomic
203+
type: array
204+
initPlugins:
205+
additionalProperties:
206+
additionalProperties:
207+
type: string
208+
type: object
209+
description: Specifies the init plugins that will be running to finish
210+
before code server running.
211+
type: object
212+
nodeSelector:
213+
additionalProperties:
214+
type: string
215+
description: Specifies the node selector for scheduling.
216+
type: object
217+
resources:
218+
description: Specifies the resource requirements for code server pod.
219+
properties:
220+
claims:
221+
description: |-
222+
Claims lists the names of resources, defined in spec.resourceClaims,
223+
that are used by this container.
224+
225+
226+
This is an alpha field and requires enabling the
227+
DynamicResourceAllocation feature gate.
228+
229+
230+
This field is immutable. It can only be set for containers.
231+
items:
232+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
233+
properties:
234+
name:
235+
description: |-
236+
Name must match the name of one entry in pod.spec.resourceClaims of
237+
the Pod where this field is used. It makes that resource available
238+
inside a container.
239+
type: string
240+
required:
241+
- name
242+
type: object
243+
type: array
244+
x-kubernetes-list-map-keys:
245+
- name
246+
x-kubernetes-list-type: map
247+
limits:
248+
additionalProperties:
249+
anyOf:
250+
- type: integer
251+
- type: string
252+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
253+
x-kubernetes-int-or-string: true
254+
description: |-
255+
Limits describes the maximum amount of compute resources allowed.
256+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
257+
type: object
258+
requests:
259+
additionalProperties:
260+
anyOf:
261+
- type: integer
262+
- type: string
263+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
264+
x-kubernetes-int-or-string: true
265+
description: |-
266+
Requests describes the minimum amount of compute resources required.
267+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
268+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
269+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
270+
type: object
271+
type: object
272+
storageAnnotations:
273+
additionalProperties:
274+
type: string
275+
description: Specifies the additional annotations for persistent volume
276+
claim
277+
type: object
278+
storageClassName:
279+
description: Specifies the storage class name for persistent volume
280+
claim
281+
type: string
282+
storageSize:
283+
default: 1Gi
284+
description: Specifies the storage size that will be used for code
285+
server
286+
pattern: ^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$
287+
type: string
288+
suspendAfterSeconds:
289+
description: Specifies the period before controller suspend the resources
290+
(delete all resources except data).
291+
format: int64
292+
type: integer
293+
volumeName:
294+
description: VolumeName specifies the volume name for persistent volume
295+
claim
296+
type: string
297+
type: object
298+
status:
299+
description: CodeServerStatus defines the observed state of CodeServer
300+
enum:
301+
- NotReady
302+
- Ready
303+
- Suspended
304+
type: string
305+
type: object
306+
served: true
307+
storage: true
308+
subresources:
309+
status: {}

0 commit comments

Comments
 (0)