-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Summary cli: v0.5.0
- Loading branch information
Showing
34 changed files
with
1,847 additions
and
472 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v2 | ||
name: operator | ||
description: The Apibara operator for Kubernetes | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "0.2.2" | ||
home: https://www.apibara.com | ||
sources: | ||
- https://github.com/apibara/dna/tree/main/charts/operator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Apibara Operator | ||
|
||
The Apibara Operator is a Kubernetes operator to deploy indexers. | ||
|
||
## Usage | ||
|
||
The chart is published to an OCI Helm repository. | ||
|
||
Inspect the chart with the `helm show` command: | ||
|
||
``` | ||
$ helm show readme oci://quay.io/apibara-charts/operator | ||
--- | ||
Pulled: quay.io/apibara-charts/operator:0.1.0 | ||
Digest: sha256:a248767bcfbb2973b616052dcc38b791f1b6ff13f2db40b61951183f85c0729e | ||
# Apibara Operator | ||
The Apibara Operator is a Kubernetes operator to deploy indexers. | ||
``` | ||
|
||
Install the chart with `helm install`. | ||
|
||
``` | ||
$ helm install capy oci://quay.io/apibara-charts/operator | ||
--- | ||
Pulled: quay.io/apibara-charts/operator:0.1.0 | ||
Digest: sha256:a248767bcfbb2973b616052dcc38b791f1b6ff13f2db40b61951183f85c0729e | ||
NAME: capy | ||
LAST DEPLOYED: Fri May 10 21:00:30 2024 | ||
NAMESPACE: default | ||
STATUS: deployed | ||
REVISION: 1 | ||
TEST SUITE: None | ||
NOTES: | ||
capy-operator has been installed. Check its status by running: | ||
kubectl --namespace default get pods | ||
``` | ||
|
||
Customize the release using `values.yaml` as usual. |
1,373 changes: 1,373 additions & 0 deletions
1,373
charts/operator/crds/custom-resource-definitions.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{ template "operator.fullname" . }} has been installed. Check its status by running: | ||
|
||
kubectl --namespace {{ template "operator.namespace" . }} get pods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "operator.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Namespace where to install the operator. | ||
*/}} | ||
{{- define "operator.namespace" -}} | ||
{{- default .Release.Namespace .Values.namespace -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "operator.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "operator.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "operator.labels" -}} | ||
helm.sh/chart: {{ include "operator.chart" . }} | ||
{{ include "operator.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "operator.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "operator.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "operator.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "operator.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "operator.fullname" . }} | ||
namespace: {{ include "operator.namespace" . }} | ||
labels: | ||
{{- include "operator.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "operator.selectorLabels" . | nindent 6 }} | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "operator.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
automountServiceAccountToken: true | ||
serviceAccountName: {{ include "operator.serviceAccountName" . }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
{{- if gt (len .Values.customArgs) 0 }} | ||
args: | ||
{{- toYaml .Values.customArgs | nindent 12 }} | ||
{{- end }} | ||
env: | ||
- name: "RUST_LOG" | ||
value: "INFO" | ||
{{- if .Values.extraEnv }} | ||
{{- toYaml .Values.extraEnv | nindent 12 }} | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ template "operator.fullname" . }}-role | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- "*" | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- endpoints | ||
- configmaps | ||
- secrets | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- pods/status | ||
- pods/finalizers | ||
verbs: | ||
- "*" | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
- services/status | ||
- services/finalizers | ||
verbs: | ||
- "*" | ||
- apiGroups: | ||
- "apibara.com" | ||
resources: | ||
- indexers | ||
- indexers/status | ||
- indexers/finalizers | ||
verbs: | ||
- "*" | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ template "operator.fullname" . }}-rolebinding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: {{ template "operator.fullname" . }}-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ template "operator.serviceAccountName" . }} | ||
namespace: {{ template "operator.namespace" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- if .Values.serviceAccount.create -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "operator.serviceAccountName" . }} | ||
namespace: {{ include "operator.namespace" . }} | ||
labels: | ||
{{- include "operator.labels" . | nindent 4 }} | ||
{{- with .Values.serviceAccount.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{- if .Values.test.enabled }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "operator.fullname" . }}-test-api-key | ||
namespace: {{ include "operator.namespace" . }} | ||
stringData: | ||
production: {{ .Values.test.apiKey }} | ||
--- | ||
apiVersion: apibara.com/v1alpha2 | ||
kind: Indexer | ||
metadata: | ||
name: {{ include "operator.fullname" . }}-test-indexer | ||
namespace: {{ include "operator.namespace" . }} | ||
spec: | ||
source: | ||
gitHub: | ||
repo: dna | ||
owner: apibara | ||
revision: main | ||
subpath: examples/console | ||
sink: | ||
script: starknet_to_console.js | ||
type: console | ||
env: | ||
- name: AUTH_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ include "operator.fullname" . }}-test-api-key | ||
key: production | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
image: | ||
repository: quay.io/apibara/operator | ||
pullPolicy: IfNotPresent | ||
# Overrides the image tag whose default is the chart appVersion. | ||
tag: "" | ||
|
||
# namespace: apibara-system | ||
|
||
replicaCount: 1 | ||
|
||
# Custom args for the operator, e.g. `["--namespace", "my-namespace"]` | ||
customArgs: | ||
- start | ||
|
||
# Additional environment variables to set | ||
extraEnv: [] | ||
|
||
imagePullSecrets: [] | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
serviceAccount: | ||
# Specifies whether a service account should be created | ||
create: true | ||
# Annotations to add to the service account | ||
annotations: {} | ||
# The name of the service account to use. | ||
# If not set and create is true, a name is generated using the fullname template | ||
name: "apibara-operator-manager" | ||
|
||
podAnnotations: {} | ||
|
||
resources: | ||
{} | ||
# We usually recommend not to specify default resources and to leave this as a conscious | ||
# choice for the user. This also increases chances charts run on environments with little | ||
# resources, such as Minikube. If you do want to specify resources, uncomment the following | ||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'. | ||
# limits: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
|
||
# Values used for testing | ||
test: | ||
enabled: false | ||
# DNA auth token | ||
apiKey: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.