Y-stack is a micro-PaaS(?) with the following goals:
Y-stack is higly opinionated: It says "registry" to refer to a Docker registry with a particular setup, while "knative" refers to an installer that combines Knative modules. The point with being opinionated is that registry and knative work well together.
The stack supports local development ("inner development loop") using Skaffold with local and remote clusters alike. Image builds during development are in-cluster: Many dev setups transfer container images but we transfer the build context. We see builds as temporary and per-cluster, though they upon different kinds of verification can be pushed to a productiono registry. Build contexts are small and there's no need to git push to trigger a build.
Y-stack should be independent of cluster vendor,
but we provide some utilities like microk8s-multipass.sh to automate cluster creation.
Note that these scripts don't actually apply anything.
Actually installing y-stack is done through kubectl apply -k [path(s) in this repo].
A crucial part of modern development is to access your stack using https://.
For that you need a valid SSL certificate.
If your cluster has a public IP we assume that you can get real valid certificats,
through for example LetsEncrypt.
If your cluster has a local IP you'll probably want something like mkcert. It needs to run locally, so y-stack can't automate much, but some assistance is provided in the form of:
host: entries in any ingress resource.Unless you have a local DNS that gets updated with your ingress entries, you'll probably also want to update your /etc/hosts file. For that we use https://github.com/solsson/k8s-ingress-hosts/releases
Clone this repo to your Yolean workspace.
Add YSTACK_HOME env pointing to the root of y-stack, and $YSTACK_HOME/bin to path.
Y-stack doesn't have a CLI, but depends on assorted tooling from the Kubernetes community.
To ease the burden of maintaining a dev stack, there's tooling to keep these binaries updated.
If a requred binary exists in path, a version check is performed.
If not it is downloaded and placed in $YSTACK_HOME/bin.
Why do we name the stack namespace with a stage, for example ystack-dev?
Still doesn't guard against mistakes, because kubectl -n ystack-dev delete pod
y-cluster-provision-*KUBECONFIGystackbuilds-registry.ystack.svc.cluster.localapply -k should be declarative resource config that you can re-apply and extend.kubectl apply -k converge-generic/
converge-generic kustomization sets namespace: ystack,
but individual features only set namespace if thery have configuration that depend on a fixed namespacey-kubefwd svc -n ystacky-buildctl and y-skaffold./examples/basic-dev-inner-loop/ run skaffold devY-stack is opinionated on Kubernetes devops tooling as well.
We therefore download some CLIs to the aforementioned PATH entry.
docker volume rm ystack_admin 2> /dev/null || true
./test.sh
Using the y-docker-compose wrapper that extends docker-compose.test.yml that is used for CI with docker-compose.dev-overrides.yml. The k3s image is the stock k3s image with y-stack's local registry config.
y-cluster-provision-k3s-docker
For dev loops and y-assert the docker stack replaces y-kubefwd (hard to use in CI)
with container ports.
You need cat /etc/hosts | grep 127.0.0 | grep cluster.local to have something like:
127.0.0.1 builds-registry.ystack.svc.cluster.local
127.0.0.1 buildkitd.ystack.svc.cluster.local
127.0.0.1 monitoring.ystack.svc.cluster.local
Test using:
curl http://builds-registry.ystack.svc.cluster.local/v2/
curl http://monitoring.ystack.svc.cluster.local:9090/api/v1/alertmanagers | jq '.data.activeAlertmanagers[0]'
curl http://monitoring.ystack.svc.cluster.local:9093/api/v2/status
Start a dev loop for actual asserts using cd specs; y-skaffold --cache-artifacts=false dev and start editing specs/*.spec.js. Run y-assert for CI-like runs until completion.
Content type
Image
Digest
Size
189.3 MB
Last updated
over 5 years ago
docker pull solsson/ystack-runner