diff --git a/acorn/Makefile b/acorn/Makefile new file mode 100644 index 0000000..4930174 --- /dev/null +++ b/acorn/Makefile @@ -0,0 +1,20 @@ +# renovate: datasource=github-tags depName=acorn-io/acorn +ACORN_VERSION ?= v0.6.0 + +.PHONY: install +install: + curl https://get.acorn.io | INSTALL_ACORN_VERSION=$(ACORN_VERSION) sh - + acorn install + +.PHONY: deploy-app +deploy-app: + acorn run --target-namespace podtato-acorn -n podtato-head app + +.PHONY: uninstall +uninstall: + acorn uninstall -a -f + +.PHONY: test +test: install deploy-app + kubectl kuttl test --start-kind=false ./kuttl --config=./kuttl/kuttl-test.yaml + make uninstall \ No newline at end of file diff --git a/acorn/README.md b/acorn/README.md new file mode 100644 index 0000000..d16400d --- /dev/null +++ b/acorn/README.md @@ -0,0 +1,33 @@ +# Deliver with Acorn +![Acorn](https://img.shields.io/badge/Acorn-v0.6.0-blue) +![PodTatoHead](https://img.shields.io/badge/PodTatoHead-v0.3.0-orange) + + +Website: https://acorn.io
+Repository: https://github.com/acorn-io/acorn + +## Deliver +Acorn delivers applications from source code or a container image in a kubernetes cluster. + +## Install Acorn +You can install acorn with the following commands: +```shell +$> curl https://get.acorn.io | INSTALL_ACORN_VERSION=$(ACORN_VERSION) sh - +$> acorn install +``` + +## Deliver PodTatoHead +1. Clone this repository +2. Install acorn as specified above +3. Apply the [Acornfile](app/Acornfile) to your cluster + > `acorn apply --target-namespace podtato-acorn -f app/Acornfile` +4. After some time the application should be deployed in the podtato-acorn namespace +5. You can access the application via the ingress or port-forwarding + > `kubectl port-forward -n podtato-acorn svc/frontend 8080` +6. Open http://localhost:8080 in your browser + +## Uninstall Acorn +You can uninstall acorn with the following command: +> `acorn uninstall -a -f` + + diff --git a/acorn/app/Acornfile b/acorn/app/Acornfile new file mode 100644 index 0000000..031953f --- /dev/null +++ b/acorn/app/Acornfile @@ -0,0 +1,77 @@ +containers: { + frontend: { + image: "ghcr.io/podtato-head/podtato-server:v0.3.0" + ports: "8080/tcp" + env: { + "PODTATO_COMPONENT": "frontend" + "SERVICES_CONFIG_FILE_PATH": "/config/service-discovery.yaml" + } + files: { + "/config/service-discovery.yaml": "secret://service-discovery/template" + } + } + hat: { + image: "ghcr.io/podtato-head/podtato-server:v0.3.0" + ports: "8080/tcp" + env: { + "PODTATO_COMPONENT": "hat" + "PODTATO_PART_NUMBER": "02" + } + } + leftarm: { + image: "ghcr.io/podtato-head/podtato-server:v0.3.0" + ports: "8080/tcp" + env: { + "PODTATO_COMPONENT": "left-arm" + "PODTATO_PART_NUMBER": "03" + } + } + rightarm: { + image: "ghcr.io/podtato-head/podtato-server:v0.3.0" + ports: "8080/tcp" + env: { + "PODTATO_COMPONENT": "right-arm" + "PODTATO_PART_NUMBER": "01" + } + } + leftleg: { + image: "ghcr.io/podtato-head/podtato-server:v0.3.0" + ports: "8080/tcp" + env: { + "PODTATO_COMPONENT": "left-leg" + "PODTATO_PART_NUMBER": "02" + } + } + rightleg: { + image: "ghcr.io/podtato-head/podtato-server:v0.3.0" + ports: "8080/tcp" + env: { + "PODTATO_COMPONENT": "right-leg" + "PODTATO_PART_NUMBER": "04" + } + } +} + +secrets: { + "service-discovery": { + type: "template" + data: { + template: """ + hat: http://hat:8080 + left-arm: http://leftarm:8080 + right-arm: http://rightarm:8080 + left-leg: http://leftleg:8080 + right-leg: http://rightleg:8080 + """ + } + } +} + +jobs: { + "test-app": { + image: "busybox" + command: [ "wget", "-q", "--tries=10", "-timeout=5", "-O", "-", "http://frontend:8080" ] + dependsOn: [ "frontend", "hat", "leftleg", "rightleg", "leftarm", "rightarm" ] + } +} + diff --git a/acorn/kuttl/kuttl-test.yaml b/acorn/kuttl/kuttl-test.yaml new file mode 100644 index 0000000..2fbdd2e --- /dev/null +++ b/acorn/kuttl/kuttl-test.yaml @@ -0,0 +1,7 @@ +apiVersion: kuttl.dev/v1 +kind: TestSuite +testDirs: + - ./test +timeout: 400 +skipDelete: true +namespace: podtato-acorn \ No newline at end of file diff --git a/acorn/kuttl/test/00-assert.yaml b/acorn/kuttl/test/00-assert.yaml new file mode 100644 index 0000000..bdd18cf --- /dev/null +++ b/acorn/kuttl/test/00-assert.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hat + namespace: podtato-acorn +status: + readyReplicas: 1 + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: leftleg + namespace: podtato-acorn +status: + readyReplicas: 1 + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: rightleg + namespace: podtato-acorn +status: + readyReplicas: 1 + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: leftarm + namespace: podtato-acorn +status: + readyReplicas: 1 + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: rightarm + namespace: podtato-acorn +status: + readyReplicas: 1 + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: frontend + namespace: podtato-acorn +status: + readyReplicas: 1 + +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: test-app + namespace: podtato-acorn +status: + succeeded: 1