This is a template used to scaffold a toolchain to host and deploy a fully functional frontend App (FireworksApp).
This Template implements the following steps:
- Create an empty Github repository (on github.com) - link
- Push the code from the skeleton to the previously create repository - link
- A Continuous Integration pipeline (GitHub workflow) will build the Dockerfile of the frontend app and the resulting image will be published as a Docker image on the GitHub Package registry
- An ArgoCD Application will be deployed to listen to the Helm Chart of the FireworksApp application and deploy the chart on the same Kubernetes cluster where ArgoCD is hosted
- The FireworksApp will be deployed with a Service type of NodePort kind exposed on the chosen port.
- Install argo CLI: https://argo-cd.readthedocs.io/en/stable/cli_installation/
- Have Krateo PlatformOps installed: https://docs.krateo.io/
helm repo add krateo https://charts.krateo.io
helm repo update krateo
helm install github-provider krateo/github-provider --namespace krateo-system --create-namespace
helm install git-provider krateo/git-provider --namespace krateo-system --create-namespace
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update argo
helm install argocd argo/argo-cd --namespace krateo-system --create-namespace --wait
kubectl patch configmap argocd-cm -n krateo-system --patch '{"data": {"accounts.krateo-account": "apiKey, login"}}'
kubectl patch configmap argocd-rbac-cm -n krateo-system --patch '{"data": {"policy.default": "role:readonly"}}'
In order to generate a token, follow this instructions:
kubectl port-forward service/argocd-server -n krateo-system 8443:443
Open a new terminal and execute the following commands:
PASSWORD=$(kubectl -n krateo-system get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)
argocd login localhost:8443 --insecure --username admin --password $PASSWORD
argocd account list
TOKEN=$(argocd account generate-token --account krateo-account)
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: argocd-endpoint
namespace: krateo-system
stringData:
insecure: "true"
server-url: https://argocd-server.krateo-system.svc:443
token: $TOKEN
EOF
In order to generate a token, follow this instructions: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic
Give the following permissions: delete:packages, delete_repo, repo, workflow, write:packages
Substitute the value with the generated token:
cat <<EOF | kubectl apply -f -
apiVersion: v1
stringData:
token: <PAT>
kind: Secret
metadata:
name: github-repo-creds
namespace: krateo-system
type: Opaque
EOF
kubectl create ns fireworksapp-system
kubectl apply -f https://raw.githubusercontent.com/krateoplatformops/krateo-v2-template-fireworksapp/refs/heads/main/compositiondefinition.yaml
DATE=$(date +"%Y-%m-%dT%H:%M:%SZ")
curl -sL "https://raw.githubusercontent.com/krateoplatformops/krateo-v2-template-fireworksapp/main/form.yaml" | sed "s/{{DATE}}/$DATE/" | kubectl apply -f -
DATE=$(date +"%Y-%m-%dT%H:%M:%SZ")
curl -sL "https://raw.githubusercontent.com/krateoplatformops/krateo-v2-template-fireworksapp/main/customform.yaml" | sed "s/{{DATE}}/$DATE/" | kubectl apply -f -