Skip to content

Commit

Permalink
Add namespace.yaml to respect single stream per document
Browse files Browse the repository at this point in the history
  • Loading branch information
as51340 committed Jul 23, 2024
1 parent 9159e7e commit 103654b
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 42 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/kubelint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,18 @@ jobs:
with:
directory: config/manifests
config: ${GITHUB_WORKSPACE}/.github/config_files/config_lint.yaml
version: $KUBELINTER_VERSION
version: $KUBELINTER_VERSION

- name: Scan directory ./config/samples/ with kube-linter
uses: stackrox/[email protected]
with:
directory: config/samples
config: ${GITHUB_WORKSPACE}/.github/config_files/config_lint.yaml
version: $KUBELINTER_VERSION
version: $KUBELINTER_VERSION

- name: Scan directory ./config/scorecard/ with kube-linter
uses: stackrox/[email protected]
with:
directory: config/scorecard
config: ${GITHUB_WORKSPACE}/.github/config_files/config_lint.yaml
version: $KUBELINTER_VERSION











version: $KUBELINTER_VERSION
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.0.2
VERSION ?= 0.0.3

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
Expand All @@ -28,7 +28,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
# This variable is used to construct full image tags for bundle and catalog images.
#
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
u my.domain/kubernetes-operator-bundle:$VERSION and my.domain/kubernetes-operator-catalog:$VERSION.
# my.domain/kubernetes-operator-bundle:$VERSION and my.domain/kubernetes-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= memgraph/kubernetes-operator

# BUNDLE_IMG defines the image:tag used for the bundle.
Expand Down Expand Up @@ -232,7 +232,6 @@ HELMIFY ?= helmify
helmify: $(HELMIFY) ## Download helmify locally if necessary.
$(HELMIFY): $(LOCALBIN)
test -s $(LOCALBIN)/helmify || GOBIN=$(LOCALBIN) go install github.com/arttor/helmify/cmd/helmify@latest

helm: config/manifests kustomize helmify
$(KUSTOMIZE) build config/default | $(HELMIFY)

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Introduction

Memgraph Kubernetes Operator is WIP. You can currently install the operator and manage the deployment of Memgraph's High Availability cluster
through it.
through it.

## Table of Contents

Expand All @@ -13,8 +13,8 @@ through it.

## Prerequisites

We use Go version 1.22.5 (not needed at the moment). Check out here how to [install Go](https://go.dev/doc/install).
The current Helm version is v3.14.4.
We use Go version 1.22.5 (not needed at the moment). Check out here how to [install Go](https://go.dev/doc/install).
The current Helm version used is v3.14.4.

## Documentation

Expand Down
3 changes: 2 additions & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
resources:
- namespace.yaml
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: memgraph-kubernetes-operator
newName: memgraph/kubernetes-operator
newTag: 0.0.2
newTag: 0.0.3
7 changes: 1 addition & 6 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
apiVersion: v1
kind: Namespace
metadata:
name: memgraph-operator-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -30,7 +25,7 @@ spec:
runAsNonRoot: true
containers:
- args:
image: memgraph/kubernetes-operator:0.0.2
image: memgraph/kubernetes-operator:0.0.3 # TODO: (andi) Try to specify this in a single place, currently used by kustomization.yaml and Makefile
name: manager
securityContext:
readOnlyRootFilesystem: true
Expand Down
4 changes: 4 additions & 0 deletions config/manager/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: memgraph-operator-system
4 changes: 2 additions & 2 deletions config/samples/memgraph_v1_ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ spec:
coordinators:
volumeClaim:
logPVCClassName: ""
logPVC: false # TODO: (andi) Fix
logPVC: true
logPVCSize: 256Mi
storagePVCClassName: ""
storagePVC: true
Expand All @@ -102,7 +102,7 @@ spec:
image:
pullPolicy: IfNotPresent
repository: memgraph/memgraph
tag: 2.18.0_27_0b62e6a73
tag: 2.18.0
probes:
liveness:
initialDelaySeconds: 30
Expand Down
16 changes: 5 additions & 11 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,21 @@

All described installation options will run the Operator inside the cluster.

## Option I: Install using Makefile

Make sure to clone this repository with its submodule (helm-charts).

```bash
git clone --recurse-submodules [email protected]:memgraph/kubernetes-operator.git
```

After this you can start your operator with a single command:
## Install K8 resources

```bash
make deploy
kubectl apply -k config/default
```

This command will use operator's image from Memgraph's DockerHub and create all necessary Kubernetes resources for running an operator.

## Option II: Install using kubectl

```bash
kubectl apply -k config/default
```

## Verify installation

Installation using any of options described above will cause creating Kubernetes ServiceAccount, RoleBinding, Role, Deployment and Pods all in newly created all in newly created all in newly created
Expand Down Expand Up @@ -54,7 +47,7 @@ export MEMGRAPH_ORGANIZATION_NAME="<YOUR_ORGANIZATION_NAME>"
export MEMGRAPH_ENTERPRISE_LICENSE="<MEMGRAPH_ENTERPRISE_LICENSE>"
```

Start Memgraph HA cluster with `envsubst < config/samples/memgraph_v1_ha.yaml | kubectl apply -f -`. (The `envsubst command` is a part of the gettext package.)
Start Memgraph HA cluster with `envsubst < config/samples/memgraph_v1_ha.yaml | kubectl apply -f -`. (The `envsubst command` is a part of the `gettext` package.)
Instead of using `envsubst` command, you can directly set environment variables in `config/samples/memgraph_v1_ha.yaml`.


Expand All @@ -70,5 +63,6 @@ You can now find URL of any coordinator instances by running e.g `minikube servi

```bash
kubectl delete -f config/samples/memgraph_v1_ha.yaml
make undeploy / or kubectl delete -k config/default
kubectl delete pvc --all # Or leave them if you want to use persistent storage
kubectl delete -k config/default
```
2 changes: 1 addition & 1 deletion helm-charts

0 comments on commit 103654b

Please sign in to comment.