Skip to content

Commit

Permalink
Add mongodb-atlas image
Browse files Browse the repository at this point in the history
  • Loading branch information
shahpratikr committed May 2, 2023
1 parent 3c625e8 commit 2426602
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ dockers:
image_templates:
- 'ghcr.io/kanisterio/mongodb:{{ .Tag }}'
dockerfile: 'docker/mongodb/Dockerfile'
- ids:
- kando
image_templates:
- 'ghcr.io/kanisterio/mongodb-atlas:{{ .Tag }}'
dockerfile: 'docker/mongodb-atlas/Dockerfile'
- ids:
- kando
image_templates:
Expand Down
2 changes: 1 addition & 1 deletion build/push_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -o errexit
set -o nounset

IMAGE_REGISTRY="ghcr.io/kanisterio"
IMAGES=("mysql-sidecar" "kafka-adobe-s3-sink-connector" "postgres-kanister-tools" "postgresql" "cassandra" "kanister-kubectl-1.18" "mongo-sidecar" "mongodb" "es-sidecar" "controller" "kanister-tools" "couchbase-tools" "kafka-adobe-s3-source-connector" "foundationdb" "mssql-tools")
IMAGES=("mysql-sidecar" "kafka-adobe-s3-sink-connector" "postgres-kanister-tools" "postgresql" "cassandra" "kanister-kubectl-1.18" "mongo-sidecar" "mongodb" "mongodb-atlas" "es-sidecar" "controller" "kanister-tools" "couchbase-tools" "kafka-adobe-s3-source-connector" "foundationdb" "mssql-tools")

TAG=${1:-"v9.99.9-dev"}

Expand Down
4 changes: 3 additions & 1 deletion docker/mongodb-atlas/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ gpgkey=https://pgp.mongodb.com/server-6.0.asc
EOL
RUN microdnf install yum -y && yum -y update &&\
yum install -y mongodb-atlas perl-Digest-SHA tar jq && microdnf clean all
RUN curl https://raw.githubusercontent.com/kanisterio/kanister/master/scripts/get.sh | bash
RUN mkdir -p /root/.config/atlascli/

# Install kando
ADD kando /usr/local/bin/
21 changes: 0 additions & 21 deletions examples/mongodb-atlas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,10 @@ $ helm install kanister --namespace kanister --create-namespace \
kanister/kanister-operator --set image.tag=0.91.0
```

### Build a tools image to interact with MongoDB Atlas

We need to build a tools image that contains `mongosh`, `atlas` and other
related utilities so that it can be used to interact with the MongoDB Atlas
database to add data to it.
This image will also be used in the Blueprint to run the `atlas` backup and
restore related commands against the MongoDB Atlas database. Please execute the
commands below to build and push the image.

```bash
$ docker build -t <registry>/<repository>/mongodb-atlas:<tag_name> \
PATH_TO_KANISTER/docker/mongodb-atlas
$ docker push <registry>/<repository>/mongodb-atlas:<tag_name>
```

### Create Blueprint

Create Blueprint in the same namespace as the Kanister controller.

**NOTE:**

Please make sure that the `<registry>`, `<repository>` and `<tag_name>` in the
blueprint (`mongodb-atlas-blueprint.yaml`) are replaced with correct values of
the tools image that we built above.

```bash
$ kubectl create -f ./mongodb-atlas-blueprint.yaml -n kanister
```
Expand Down
10 changes: 5 additions & 5 deletions examples/mongodb-atlas/mongodb-atlas-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ actions:
name: mongoBackup
args:
namespace: "{{ .Object.metadata.namespace }}"
image: <registry>/<repository>/mongodb-atlas:<tag_name>
image: ghcr.io/kanisterio/mongodb-atlas:0.91.0
command:
- bash
- -o
Expand All @@ -42,7 +42,7 @@ actions:
name: waitForBackupToComplete
args:
namespace: "{{ .Object.metadata.namespace }}"
image: <registry>/<repository>/mongodb-atlas:<tag_name>
image: ghcr.io/kanisterio/mongodb-atlas:0.91.0
command:
- bash
- -o
Expand Down Expand Up @@ -95,7 +95,7 @@ actions:
namespace: '{{ .ArtifactsIn.backupOutput.KeyValue.appNamespace }}'
args:
namespace: "{{ .ArtifactsIn.backupOutput.KeyValue.appNamespace }}"
image: <registry>/<repository>/mongodb-atlas:<tag_name>
image: ghcr.io/kanisterio/mongodb-atlas:0.91.0
command:
- bash
- -o
Expand Down Expand Up @@ -127,7 +127,7 @@ actions:
name: waitForRestoreToComplete
args:
namespace: "{{ .ArtifactsIn.backupOutput.KeyValue.appNamespace }}"
image: <registry>/<repository>/mongodb-atlas:<tag_name>
image: ghcr.io/kanisterio/mongodb-atlas:0.91.0
command:
- bash
- -o
Expand Down Expand Up @@ -182,7 +182,7 @@ actions:
namespace: '{{ .ArtifactsIn.backupOutput.KeyValue.appNamespace }}'
args:
namespace: "{{ .ArtifactsIn.backupOutput.KeyValue.appNamespace }}"
image: <registry>/<repository>/mongodb-atlas:<tag_name>
image: ghcr.io/kanisterio/mongodb-atlas:0.91.0
command:
- bash
- -o
Expand Down

0 comments on commit 2426602

Please sign in to comment.