Skip to content

Commit 89024ae

Browse files
authored
Merge pull request #61 from JupiterOne/nick/k8s-operator-new
Adds helm chart for kubernetes-operator
2 parents 6dc7c59 + 4ff3261 commit 89024ae

32 files changed

+1075
-3
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Release Chart
22

3-
on:
3+
on:
44
push:
55
branches:
66
- main

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# Chart dependencies
2-
/charts/*/charts
3-
values.yaml
2+
/charts/*/charts
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Patterns to ignore when building Helm packages.
2+
# Operating system files
3+
.DS_Store
4+
5+
# Version control directories
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.hg/
10+
.hgignore
11+
.svn/
12+
13+
# Backup and temporary files
14+
*.swp
15+
*.tmp
16+
*.bak
17+
*.orig
18+
*~
19+
20+
# IDE and editor-related files
21+
.idea/
22+
.vscode/
23+
24+
# Helm chart artifacts
25+
dist/chart/*.tgz

charts/kubernetes-operator/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: kubernetes-operator
3+
description: A Helm chart to distribute the project kubernetes-operator
4+
type: application
5+
version: 1.0.0
6+
appVersion: "v0.0.10"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{{- define "chart.name" -}}
2+
{{- if .Chart }}
3+
{{- if .Chart.Name }}
4+
{{- .Chart.Name | trunc 63 | trimSuffix "-" }}
5+
{{- else if .Values.nameOverride }}
6+
{{ .Values.nameOverride | trunc 63 | trimSuffix "-" }}
7+
{{- else }}
8+
kubernetes-operator
9+
{{- end }}
10+
{{- else }}
11+
kubernetes-operator
12+
{{- end }}
13+
{{- end }}
14+
15+
16+
{{- define "chart.labels" -}}
17+
{{- if .Chart.AppVersion -}}
18+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
19+
{{- end }}
20+
{{- if .Chart.Version }}
21+
helm.sh/chart: {{ .Chart.Version | quote }}
22+
{{- end }}
23+
app.kubernetes.io/name: {{ include "chart.name" . }}
24+
app.kubernetes.io/instance: {{ .Release.Name }}
25+
app.kubernetes.io/managed-by: {{ .Release.Service }}
26+
{{- end }}
27+
28+
29+
{{- define "chart.selectorLabels" -}}
30+
app.kubernetes.io/name: {{ include "chart.name" . }}
31+
app.kubernetes.io/instance: {{ .Release.Name }}
32+
{{- end }}
33+
34+
35+
{{- define "chart.hasMutatingWebhooks" -}}
36+
{{- $hasMutating := false }}
37+
{{- range . }}
38+
{{- if eq .type "mutating" }}
39+
$hasMutating = true }}{{- end }}
40+
{{- end }}
41+
{{ $hasMutating }}}}{{- end }}
42+
43+
44+
{{- define "chart.hasValidatingWebhooks" -}}
45+
{{- $hasValidating := false }}
46+
{{- range . }}
47+
{{- if eq .type "validating" }}
48+
$hasValidating = true }}{{- end }}
49+
{{- end }}
50+
{{ $hasValidating }}}}{{- end }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{{- if .Values.certmanager.enable }}
2+
# Self-signed Issuer
3+
apiVersion: cert-manager.io/v1
4+
kind: Issuer
5+
metadata:
6+
labels:
7+
{{- include "chart.labels" . | nindent 4 }}
8+
name: selfsigned-issuer
9+
namespace: {{ .Release.Namespace }}
10+
spec:
11+
selfSigned: {}
12+
{{- if .Values.metrics.enable }}
13+
---
14+
# Certificate for the metrics
15+
apiVersion: cert-manager.io/v1
16+
kind: Certificate
17+
metadata:
18+
annotations:
19+
{{- if .Values.crd.keep }}
20+
"helm.sh/resource-policy": keep
21+
{{- end }}
22+
labels:
23+
{{- include "chart.labels" . | nindent 4 }}
24+
name: metrics-certs
25+
namespace: {{ .Release.Namespace }}
26+
spec:
27+
dnsNames:
28+
- kubernetes-operator.{{ .Release.Namespace }}.svc
29+
- kubernetes-operator.{{ .Release.Namespace }}.svc.cluster.local
30+
- kubernetes-operator-metrics-service.{{ .Release.Namespace }}.svc
31+
issuerRef:
32+
kind: Issuer
33+
name: selfsigned-issuer
34+
secretName: metrics-server-cert
35+
{{- end }}
36+
{{- end }}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{{- if .Values.crd.enable }}
2+
---
3+
apiVersion: apiextensions.k8s.io/v1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
labels:
7+
{{- include "chart.labels" . | nindent 4 }}
8+
annotations:
9+
{{- if .Values.crd.keep }}
10+
"helm.sh/resource-policy": keep
11+
{{- end }}
12+
controller-gen.kubebuilder.io/version: v0.18.0
13+
name: integrationinstancejobs.integrations.jupiterone.io
14+
spec:
15+
group: integrations.jupiterone.io
16+
names:
17+
kind: IntegrationInstanceJob
18+
listKind: IntegrationInstanceJobList
19+
plural: integrationinstancejobs
20+
singular: integrationinstancejob
21+
scope: Namespaced
22+
versions:
23+
- additionalPrinterColumns:
24+
- description: Indicates if the image has been cosign verified
25+
jsonPath: .status.imageVerified
26+
name: Verified
27+
type: string
28+
name: v1
29+
schema:
30+
openAPIV3Schema:
31+
description: IntegrationInstanceJob is the Schema for the integrationinstancejobs
32+
API.
33+
properties:
34+
apiVersion:
35+
description: |-
36+
APIVersion defines the versioned schema of this representation of an object.
37+
Servers should convert recognized schemas to the latest internal value, and
38+
may reject unrecognized values.
39+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
40+
type: string
41+
kind:
42+
description: |-
43+
Kind is a string value representing the REST resource this object represents.
44+
Servers may infer this from the endpoint the client submits requests to.
45+
Cannot be updated.
46+
In CamelCase.
47+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
48+
type: string
49+
metadata:
50+
type: object
51+
spec:
52+
description: IntegrationInstanceJobSpec defines the desired state of IntegrationInstanceJob.
53+
properties:
54+
certificateIdentity:
55+
type: string
56+
image:
57+
type: string
58+
integrationDefinitionName:
59+
description: IntegrationDefinitionName is the name of the integration
60+
that will be run
61+
type: string
62+
integrationInstanceId:
63+
description: IntegrationInstanceID is the ID of the integration instance
64+
that this job is associated with.
65+
type: string
66+
integrationInstanceJobId:
67+
description: IntegrationInstanceJobID is the unique identifier for
68+
the integration instance job.
69+
type: string
70+
integrationRunnerName:
71+
description: IntegrationRunnerName is the name of the IntegrationRunner
72+
that created this instance.
73+
type: string
74+
secretName:
75+
description: SecretName is the name of the secret that contains the
76+
credentials for the integration instance job.
77+
type: string
78+
type: object
79+
status:
80+
description: IntegrationInstanceJobStatus defines the observed state of
81+
IntegrationInstanceJob.
82+
properties:
83+
imageVerified:
84+
description: |-
85+
ImageVerified indicates the status of the cosign image verification step.
86+
It can be one of the following values: PENDING, SUCCESS, FAILED.
87+
type: string
88+
type: object
89+
type: object
90+
served: true
91+
storage: true
92+
subresources:
93+
status: {}
94+
{{- end -}}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{{- if .Values.crd.enable }}
2+
---
3+
apiVersion: apiextensions.k8s.io/v1
4+
kind: CustomResourceDefinition
5+
metadata:
6+
labels:
7+
{{- include "chart.labels" . | nindent 4 }}
8+
annotations:
9+
{{- if .Values.crd.keep }}
10+
"helm.sh/resource-policy": keep
11+
{{- end }}
12+
controller-gen.kubebuilder.io/version: v0.18.0
13+
name: integrationrunners.integrations.jupiterone.io
14+
spec:
15+
group: integrations.jupiterone.io
16+
names:
17+
kind: IntegrationRunner
18+
listKind: IntegrationRunnerList
19+
plural: integrationrunners
20+
singular: integrationrunner
21+
scope: Namespaced
22+
versions:
23+
- name: v1
24+
schema:
25+
openAPIV3Schema:
26+
description: IntegrationRunner is the Schema for the integrationrunners API.
27+
properties:
28+
apiVersion:
29+
description: |-
30+
APIVersion defines the versioned schema of this representation of an object.
31+
Servers should convert recognized schemas to the latest internal value, and
32+
may reject unrecognized values.
33+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
34+
type: string
35+
kind:
36+
description: |-
37+
Kind is a string value representing the REST resource this object represents.
38+
Servers may infer this from the endpoint the client submits requests to.
39+
Cannot be updated.
40+
In CamelCase.
41+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
42+
type: string
43+
metadata:
44+
type: object
45+
spec:
46+
description: IntegrationRunnerSpec defines the desired state of IntegrationRunner.
47+
properties:
48+
accountId:
49+
description: AccountID is the JupiterOne account ID that this integration
50+
runner belongs to.
51+
type: string
52+
collectorId:
53+
description: CollectorID is the ID of the collector that this integration
54+
runner is associated with.
55+
type: string
56+
jupiterOneApiUrl:
57+
description: |-
58+
JupiterOneApiURL is the URL of the JupiterOne API that the integration runner will connect to.
59+
This defaults to https://api.us.jupiterone.io if not specified.
60+
type: string
61+
secretName:
62+
description: SecretName is the name of the Kubernetes secret that
63+
contains the credentials for the integration runner.
64+
type: string
65+
syncIntervalSeconds:
66+
description: SyncIntervalSeconds is the interval in seconds at which
67+
the integration runner should sync data.
68+
type: integer
69+
type: object
70+
status:
71+
description: IntegrationRunnerStatus defines the observed state of IntegrationRunner.
72+
properties:
73+
lastHeartbeatTime:
74+
format: date-time
75+
type: string
76+
lastSyncTime:
77+
format: date-time
78+
type: string
79+
registrationStatus:
80+
type: string
81+
type: object
82+
type: object
83+
served: true
84+
storage: true
85+
subresources:
86+
status: {}
87+
{{- end -}}

0 commit comments

Comments
 (0)