If you don’t want to use KiND locally, you can follow these steps to deploy Smithy and it’s dependencies.
If you follow the Getting Started guide,
all these steps are taken care of by the make install
command.
Smithy dependencies are split into two categories:
The dependency that Smithy can’t function without is Tekton and for many users it is a good idea to deploy the Tekton Dashboard too for better visibility into what’s happening on the cluster. We offer a simple way of deploying these along with an Nginx ingress controller with the command:
make dev-infra
:warning: Warning 2: make sure that you have all the needed tools listed in the previous section installed in your system
For Smithy pipelines to run, they usually require the following services:
We use the Elastic Operator to spin up managed instances of Elasticsearch and Kibana and the bitnami charts to deploy instances of PostgreSQL and MongoDB.
If you run the command:
make dev-smithy
You will deploy the Elastic Operator on the cluster and the Smithy Helm package. Depending on the capabilities of your workstation this will probably take a couple of minutes, it’s perfect time to go get a cup of coffee ;).
) (
( ) )
) ( (
-------
.-\ /
'- \ /
_______
espresso cup by @ptzianos
The Smithy Helm package lists as dependencies the Bitnami charts for Postgres
and MongoDB. The values used are in the deploy/smithy/values/dev.yaml
file.
kubectl -n tekton-pipelines port-forward svc/tekton-dashboard 9097:9097
# Use `kubectl port-forward ...` to access the Kibana UI:
kubectl -n smithy port-forward svc/smithy-kb-kibana-kb-http 5601:5601
# You can obtain the password by examining the
# `smithy-es-elasticsearch-es-elastic-user` secret:
# The username is `elastic`.
kubectl -n smithy get secret smithy-es-elasticsearch-es-elastic-user \
-o=jsonpath='{.data.elastic}' | \
base64 -d && \
echo
# Use `kubectl port-forward ...` to access the Kibana UI:
kubectl -n smithy port-forward svc/smithy-kb-kibana-kb-http 5601:5601
The username/password is the same as Kibana
The components that are used to build our pipelines are comprised out of two pieces:
We provide Helm packages with all our components that can be easily installed as follows:
helm upgrade \
--install \
--namespace smithy \
--values deploy/smithy/values/dev.yaml \
smithy-security-oss-components \
oci://ghcr.io/smithy-security/smithy/charts/smithy-security-oss-components
There some migrations that should be applied to the postgres instance so that
the enrichment components can store and retrieve data from it. In order to apply
the migrations you need to run the following command (the container with the
smithyctl
binary and the migration scripts was built and pushed in the
previous step):
kubectl apply -n smithy -f deploy/smithy/serviceaccount.yaml
kubectl apply -n smithy -f deploy/smithy/role.yaml
kubectl apply -n smithy -f deploy/smithy/rolebinding.yaml
make cmd/smithyctl/bin
export SMITHYCTL_MIGRATIONS_PATH='/etc/smithy/migrations/enrichment'
bin/cmd/smithyctl migrations apply \
--namespace smithy \
--as-k8s-job \
--image "${CONTAINER_REPO}/smithyctl:${CUSTOM_SMITHY_VERSION}" \
--url "postgresql://smithy:smithy@smithy-enrichment-db.smithy.svc.cluster.local?sslmode=disable" \