Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added aws-rds promise and operators #4

Merged
merged 5 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/linters/.gitleaks.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[rules]
[rules.generic-api-key]
files-exclude = ["internal/configure-pipeline/dependencies/cluster-operator.yml"]
files-exclude = ["internal/configure-pipeline/dependencies/operator.yml"]
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ In order to have this pull request merged, complete the following tasks.
- [ ] If this pull request is about and existing issue,
I added the `Fix #ISSUE_NUMBER` label to the description of the pull request.

### Promise Flink maintainer tasks
### Promise aws-rds maintainer tasks

- [ ] Label as `breaking` if this change breaks compatibility with the previous released version.
- [ ] Label as either: `automation`, `bug`, `documentation`, `enhancement`, `infrastructure`.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
id: build-and-push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: shell/internal/configure-pipeline
context: internal/configure-pipeline
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ jobs:
env:
DEFAULT_BRANCH: main
VALIDATE_KUBERNETES_KUBECONFORM: false
VALIDATE_JSCPD: false # because we have CRDs from aws controller
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

/.idea/
.idea
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,54 @@
# aws-rds-kratix-promise
# aws-rds-kratix-promise

This project provides a Kubernetes operator for managing AWS RDS instances using a Kratix-backed state store. This promise uses aws controllers(ACK) for kubernetes as the underlying operator/controller. Aws-rds kratix promise can be used to enforce company standards, security and rules.
This promise is the starting point to create a promise using ACK's so that aws rds resource can be created by the application developer from the EKS cluster itself independently without relying on platform engineering team and needing to have separate access to AWS cloud.

[![Entrypoint](https://github.com/opencredo/aws-rds-kratix-promise/actions/workflows/entrypoint.yml/badge.svg)](https://github.com/opencredo/aws-rds-kratix-promise/actions/workflows/entrypoint.yml)

## Prerequisites

- A running EKS cluster
- Kratix [see install guide](https://docs.kratix.io/main/guides/installing-kratix/single-cluster)
- Docker environment with the ability to build images for both amd64 or arm64 architectures.

## Note
We have tried running this on local kubernetes clusters(minikube and kind) instead of EKS but there are many challenges in it since we are using ACK's for this promise, and they were primarily written to work best on the EKS clusters.
We have detailed information about this promise [here](https://opencredo.atlassian.net/wiki/spaces/ADA/embed/434339842)

### Setup (Promise)
```bash
kubectl apply --context $PLATFORM --filename promise.yaml

```
```bash
kubectl --context $WORKER get pods --watch
```

### Setup (Request)
Once the rds operator is running as seen in the previous step you are ready to fulfil a [resource-request](resource-request.yaml) as a RDSInstance job:
```bash
kubectl apply --context $PLATFORM --filename resource-request.yaml
```

### Kratix Verification
```bash
kubectl --context $PLATFORM get crds awsrds.example.promise.syntasso.io

kubectl logs -l=kratix-promise-id=awsrds -n kratix-platform-system -c aws-rds-promise-pipeline

```

### Teardown (Request)
```bash
kubectl delete --context $PLATFORM --filename resource-request.yaml
```

### Teardown (Promise)
```bash
kubectl delete --context $PLATFORM --filename promise.yaml

```

## References
1. [Kratix docs](https://docs.kratix.io/)
2. [Aws controllers for kubernetes docs](https://aws-controllers-k8s.github.io/community/docs/community/overview/)
17 changes: 17 additions & 0 deletions internal/configure-pipeline/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM alpine:3.19 AS build

LABEL org.opencontainers.image.authors "[email protected]"
LABEL org.opencontainers.image.source https://github.com/opencredo/promise-aws-rds

RUN mkdir -p /tmp/transfer /kratix/output
RUN apk update && apk add --no-cache yq

COPY resources /tmp/transfer/resources/
COPY dependencies/ /tmp/transfer/dependencies/
COPY execute-pipeline execute-pipeline

RUN chmod +x execute-pipeline

ENV KRATIX_WORKFLOW_TYPE="promise"
CMD [ "sh", "-c", "./execute-pipeline" ]
ENTRYPOINT []
Loading