Skip to content

Commit 8a65b8e

Browse files
author
eliranb
committed
move rename helm-chart to charts/lightrun-operator
1 parent ddc8765 commit 8a65b8e

14 files changed

+789
-0
lines changed

charts/lightrun-operator/.helmignore

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/

charts/lightrun-operator/Chart.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
apiVersion: v2
2+
name: lightrun-k8s-operator
3+
description: A Helm chart for Lightrun k8s 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+
icon: https://lightrun-public.s3.amazonaws.com/img/lightrun-logo.png
14+
15+
## Kubeversion due to "seccompProfile" in the controller deployment
16+
## -0 is used to allow any patch version
17+
## it is resolving GKE and EKS versioning
18+
## Example of EKS version: v1.28.9-eks-036c24b
19+
kubeVersion: ">= 1.19.0-0"
20+
21+
# This is the chart version. This version number should be incremented each time you make changes
22+
# to the chart and its templates, including the app version.
23+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
24+
version: 0.1.0 # Will be updated by CI pipeline
25+
26+
# ArtifactHub.io annotations
27+
annotations:
28+
artifacthub.io/crds: |
29+
- kind: LightrunJavaAgent
30+
version: v1beta
31+
name: lightrunjavaagent
32+
shortName: lrja
33+
description: Custom resource describing Lightrun agent version, configuration and deployment that will be patched. Dependend on secret with few Lightrun key
34+
artifacthub.io/crdsExamples: |
35+
- apiVersion: agents.lightrun.com/v1beta
36+
kind: LightrunJavaAgent
37+
metadata:
38+
name: example-cr
39+
spec:
40+
deploymentName: sample-deployment
41+
containerSelector:
42+
- app
43+
secretName: lightrun-secrets
44+
serverHostname: app.lightrun.com
45+
agentEnvVarName: JAVA_TOOL_OPTIONS
46+
initContainer:
47+
image: "lightruncom/k8s-operator-init-java-agent-linux:latest"
48+
sharedVolumeName: lightrun-agent-init
49+
sharedVolumeMountPath: "/lightrun"
50+
agentTags:
51+
- operator
52+
- example
53+
- 1.8.3
54+
55+
artifacthub.io/license: Apache-2.0
56+
artifacthub.io/links: |
57+
- name: Operator repo
58+
url: https://github.com/lightrun-platform/lightrun-k8s-operator
59+
- name: CR example with explanation
60+
url: https://github.com/lightrun-platform/lightrun-k8s-operator/blob/main/examples/lightrunjavaagent.yaml
61+
artifacthub.io/maintainers: |
62+
- name: Lightrun devops team
63+
email: devopsdevops@lightrun.com
64+
- name: LeonidP
65+
email: leonidp@lightrun.com
66+
artifacthub.io/operator: "true"
67+
artifacthub.io/operatorCapabilities: Basic Install
68+
artifacthub.io/prerelease: "false"

charts/lightrun-operator/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# [Lightrun k8s operator](https://github.com/lightrun-platform/lightrun-k8s-operator)
2+
3+
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
4+
5+
## Operator docs
6+
[Github readme](https://github.com/lightrun-platform/lightrun-k8s-operator/tree/main/docs)
7+
8+
## Requirements
9+
10+
Kubernetes: `>= 1.19.0`
11+
12+
## Dependencies
13+
14+
Custom Resource of the operator is strictly depends on the secret with `lightrun_key` and `pinned_cert_hash` values
15+
[Example](https://github.com/lightrun-platform/lightrun-k8s-operator/tree/main/examples/lightrunjavaagent.yaml#L56)
16+
17+
## Installation
18+
- Add the repo to your Helm repository list
19+
```sh
20+
helm repo add lightrun-k8s-operator https://lightrun-platform.github.io/lightrun-k8s-operator
21+
```
22+
23+
- Install the Helm chart:
24+
> _Using default [values](../lightrun-operator/values.yaml)_
25+
26+
```sh
27+
helm install lightrun-k8s-operator/lightrun-k8s-operator -n lightrun-operator --create-namespace
28+
```
29+
30+
> _Using custom values file_
31+
32+
```sh
33+
helm install lightrun-k8s-operator/lightrun-k8s-operator -f <values file> -n lightrun-operator --create-namespace
34+
```
35+
> `helm upgrade --install` or `helm install --dry-run` may not work properly due to limitations of how Helm work with CRDs.
36+
You can find more info [here](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/)
37+
38+
39+
## Uninstall
40+
```sh
41+
helm delete lightrun-k8s-operator
42+
```
43+
> `CRDs` will not be deleted due to Helm CRDs limitations. You can learn more about the limitations [here](https://helm.sh/docs/topics/charts/#limitations-on-crds).
44+
45+
## Chart version vs controller version
46+
For the sake of simplicity, we are keeping the convention of the same version for both the controller image and the Helm chart. This helps to ensure that controller actions are aligned with CRDs preventing failed resource validation errors.
47+
48+
49+
## Values
50+
51+
| Key | Type | Default | Description |
52+
|-----|------|---------|-------------|
53+
| controllerManager.kubeRbacProxy.image.repository | string | `"gcr.io/kubebuilder/kube-rbac-proxy"` | |
54+
| controllerManager.kubeRbacProxy.image.tag | string | `"v0.11.0"` | |
55+
| controllerManager.kubeRbacProxy.resources.limits.cpu | string | `"500m"` | |
56+
| controllerManager.kubeRbacProxy.resources.limits.memory | string | `"128Mi"` | |
57+
| controllerManager.kubeRbacProxy.resources.requests.cpu | string | `"5m"` | |
58+
| controllerManager.kubeRbacProxy.resources.requests.memory | string | `"64Mi"` | |
59+
| controllerManager.manager.image.repository | string | `"lightruncom/lightrun-k8s-operator"` | |
60+
| controllerManager.manager.image.tag | string | `"latest"` | For simplicity of version compatibilities we are keeping the same controller and chart versions So the most safe approach is to use same version as the Chart. When installing chart from the helm repo, every helm package version will have controller image set to chart version |
61+
| controllerManager.manager.nodeSelector | object | `{}` | |
62+
| controllerManager.manager.resources.limits.cpu | string | `"500m"` | |
63+
| controllerManager.manager.resources.limits.memory | string | `"128Mi"` | |
64+
| controllerManager.manager.resources.requests.cpu | string | `"10m"` | |
65+
| controllerManager.manager.resources.requests.memory | string | `"64Mi"` | |
66+
| controllerManager.manager.tolerations | list | `[]` | |
67+
| controllerManager.replicas | int | `1` | |
68+
| managerConfig.controllerManagerConfigYaml.health.healthProbeBindAddress | string | `":8081"` | |
69+
| managerConfig.controllerManagerConfigYaml.leaderElection.leaderElect | bool | `true` | |
70+
| managerConfig.controllerManagerConfigYaml.leaderElection.resourceName | string | `"5b425f09.lightrun.com"` | |
71+
| managerConfig.controllerManagerConfigYaml.metrics.bindAddress | string | `"127.0.0.1:8080"` | |
72+
| managerConfig.controllerManagerConfigYaml.webhook.port | int | `9443` | |
73+
| managerConfig.logLevel | string | `"info"` | Log level: 1 - 5 Higher number - more logs Documentation of logr module https://pkg.go.dev/github.com/go-logr/logr@v1.2.0#hdr-Verbosity On level info (0) (default) you'll see only deployments that are being added or deleted and errors On level 1 you'll see 1 additional log per every successful reconciliation loop run On level 2 you'll see all debug prints with intermediate steps while patching deployment per every reconciliation loop run |
74+
| managerConfig.operatorScope | object | `{"namespacedScope":false,"namespaces":["default"]}` | Operator may work in 2 scopes: cluster and namespaced Cluster scope will give permissions to operator to watch and patch deployment in the whole cluster With namespaced scope you need to provide list of namespaces that operator will be able to watch. Namespaced scope implemented by both controller code and creation of the appropriate Roles by the chart Any change to the list of namespaces will cause restart of the operator controller pod. |
75+
| metricsService | object | `{"ports":[{"name":"https","port":8443,"protocol":"TCP","targetPort":8443}],"type":"ClusterIP"}` | Metrics service for prometheus compatible poller |
76+
| nameOverride | string | `"lightrun-k8s-operator"` | |
77+
78+
----------------------------------------------
79+
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: v0.14.0
6+
name: lightrunjavaagents.agents.lightrun.com
7+
spec:
8+
group: agents.lightrun.com
9+
names:
10+
kind: LightrunJavaAgent
11+
listKind: LightrunJavaAgentList
12+
plural: lightrunjavaagents
13+
shortNames:
14+
- lrja
15+
singular: lightrunjavaagent
16+
scope: Namespaced
17+
versions:
18+
- additionalPrinterColumns:
19+
- description: Deployment name
20+
jsonPath: .spec.deploymentName
21+
name: Deployment
22+
type: string
23+
- description: Status of Deployment Reconciliation
24+
jsonPath: .status.deploymentStatus
25+
name: Status
26+
type: string
27+
- jsonPath: .metadata.creationTimestamp
28+
name: Age
29+
type: date
30+
name: v1beta
31+
schema:
32+
openAPIV3Schema:
33+
description: LightrunJavaAgent is the Schema for the lightrunjavaagents API
34+
properties:
35+
apiVersion:
36+
description: |-
37+
APIVersion defines the versioned schema of this representation of an object.
38+
Servers should convert recognized schemas to the latest internal value, and
39+
may reject unrecognized values.
40+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
41+
type: string
42+
kind:
43+
description: |-
44+
Kind is a string value representing the REST resource this object represents.
45+
Servers may infer this from the endpoint the client submits requests to.
46+
Cannot be updated.
47+
In CamelCase.
48+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
49+
type: string
50+
metadata:
51+
type: object
52+
spec:
53+
description: LightrunJavaAgentSpec defines the desired state of LightrunJavaAgent
54+
properties:
55+
agentCliFlags:
56+
description: |-
57+
Add cli flags to the agent "-agentpath:/lightrun/agent/lightrun_agent.so=<AgentCliFlags>"
58+
https://docs.lightrun.com/jvm/agent-configuration/#additional-command-line-flags
59+
type: string
60+
agentConfig:
61+
additionalProperties:
62+
type: string
63+
description: |-
64+
Agent configuration to be changed from default values
65+
https://docs.lightrun.com/jvm/agent-configuration/#setting-agent-properties-from-the-agentconfig-file
66+
type: object
67+
agentEnvVarName:
68+
description: |-
69+
Env variable that will be patched with the -agentpath
70+
Common choice is JAVA_TOOL_OPTIONS
71+
Depending on the tool used it may vary from JAVA_OPTS to MAVEN_OPTS and CATALINA_OPTS
72+
More info can be found here https://docs.lightrun.com/jvm/build-tools/
73+
type: string
74+
agentName:
75+
description: Agent name for registration to the server
76+
type: string
77+
agentTags:
78+
description: Agent tags that will be shown in the portal / IDE plugin
79+
items:
80+
type: string
81+
type: array
82+
containerSelector:
83+
description: List of containers that should be patched in the Pod
84+
items:
85+
type: string
86+
type: array
87+
deploymentName:
88+
description: Name of the Deployment that will be patched
89+
type: string
90+
initContainer:
91+
properties:
92+
image:
93+
description: Image of the init container. Image name and tag will
94+
define platform and version of the agent
95+
type: string
96+
sharedVolumeMountPath:
97+
description: Path in the app container where volume with agent
98+
will be mounted
99+
type: string
100+
sharedVolumeName:
101+
description: Name of the volume that will be added to pod
102+
type: string
103+
required:
104+
- image
105+
- sharedVolumeMountPath
106+
- sharedVolumeName
107+
type: object
108+
secretName:
109+
description: Name of the Secret in the same namespace contains lightrun
110+
key and conmpany id
111+
type: string
112+
serverHostname:
113+
description: |-
114+
Lightrun server hostname that will be used for downloading an agent
115+
Key and company id in the secret has to be taken from this server as well
116+
type: string
117+
required:
118+
- agentEnvVarName
119+
- agentTags
120+
- containerSelector
121+
- deploymentName
122+
- initContainer
123+
- secretName
124+
- serverHostname
125+
type: object
126+
status:
127+
description: LightrunJavaAgentStatus defines the observed state of LightrunJavaAgent
128+
properties:
129+
conditions:
130+
items:
131+
description: "Condition contains details for one aspect of the current
132+
state of this API Resource.\n---\nThis struct is intended for
133+
direct use as an array at the field path .status.conditions. For
134+
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
135+
observations of a foo's current state.\n\t // Known .status.conditions.type
136+
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
137+
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
138+
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
139+
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
140+
\ // other fields\n\t}"
141+
properties:
142+
lastTransitionTime:
143+
description: |-
144+
lastTransitionTime is the last time the condition transitioned from one status to another.
145+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
146+
format: date-time
147+
type: string
148+
message:
149+
description: |-
150+
message is a human readable message indicating details about the transition.
151+
This may be an empty string.
152+
maxLength: 32768
153+
type: string
154+
observedGeneration:
155+
description: |-
156+
observedGeneration represents the .metadata.generation that the condition was set based upon.
157+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
158+
with respect to the current state of the instance.
159+
format: int64
160+
minimum: 0
161+
type: integer
162+
reason:
163+
description: |-
164+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
165+
Producers of specific condition types may define expected values and meanings for this field,
166+
and whether the values are considered a guaranteed API.
167+
The value should be a CamelCase string.
168+
This field may not be empty.
169+
maxLength: 1024
170+
minLength: 1
171+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
172+
type: string
173+
status:
174+
description: status of the condition, one of True, False, Unknown.
175+
enum:
176+
- "True"
177+
- "False"
178+
- Unknown
179+
type: string
180+
type:
181+
description: |-
182+
type of condition in CamelCase or in foo.example.com/CamelCase.
183+
---
184+
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
185+
useful (see .node.status.conditions), the ability to deconflict is important.
186+
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
187+
maxLength: 316
188+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
189+
type: string
190+
required:
191+
- lastTransitionTime
192+
- message
193+
- reason
194+
- status
195+
- type
196+
type: object
197+
type: array
198+
deploymentStatus:
199+
type: string
200+
lastScheduleTime:
201+
format: date-time
202+
type: string
203+
type: object
204+
type: object
205+
served: true
206+
storage: true
207+
subresources:
208+
status: {}

0 commit comments

Comments
 (0)