Local Script Installation
How It Works
install.sh is an interactive bash script that performs the following steps in order:
- Detects and installs Helm (if not already installed locally)
- Uses Helm to install Tetragon to the cluster (if not already deployed)
- Deploys K8s Sentinel to the
sentinel-systemnamespace viakubectl apply - Uses Helm to install Trivy Operator into
sentinel-system(v0.61+, if not already deployed in the cluster)
The entire installation runs locally, printing progress messages at each step, making it easy to observe the installation status. Ideal for quick evaluation or development/test environments.
Step 1: Clone the Repository
git clone https://github.com/cooloo9871/K8s_Sentinel.git
cd K8s_Sentinel/deploy
After cloning, navigate to the deploy/ directory where the install.sh script is located.
Step 2: Grant Execute Permission
chmod +x install.sh
Why: Linux systems do not allow direct execution of scripts downloaded from the network by default. You must explicitly grant the execute bit with chmod +x before running with ./install.sh. This is a security mechanism to prevent accidental execution of unknown scripts.
Step 3: Run the Installation Script
./install.sh
The script executes the following flow:
- Prepare Helm - When Helm is needed to install Tetragon or Trivy Operator and
helmis not found locally, the script downloads the latest stable release into a temp directory for its own use (nothing is installed system-wide; cleaned up when the script exits) - Deploy Tetragon - Skipped when a Tetragon DaemonSet already exists in any namespace (not only
kube-systemsince v0.69); otherwise installed from the official Cilium Helm Chart as a Helm release (helm installsince v0.64.1, so a laterhelm upgradeworks) withhostNetwork=falseandtetragon.grpc.address=0.0.0.0:54321. Whether or not Tetragon was installed just now, the script appliestetragon-grpc-policy.yamlso that only K8s Sentinel can reach the gRPC port (see Installing Tetragon for the reason) - kubectl apply the K8s Sentinel manifest - Creates the required Namespace, ServiceAccount, ClusterRole, ClusterRoleBinding, Deployment, and Service resources
- Deploy Trivy Operator - Skipped when a Trivy Operator Deployment already exists in any namespace of the cluster; otherwise installed into
sentinel-systemwithhelm install, using thetrivy-operator-values.yamlin the same directory (see Installing Trivy Operator)
Step 4: Monitor Installation Output
During installation, the script prints progress messages for each phase:
| Output Phase | Description |
|---|---|
[helm] not found, downloading to temp dir... | Helm is not installed locally, so it is downloaded to a temp directory (only appears when needed) |
[tetragon] already installed, skipping | Tetragon already exists in the cluster, skipped |
[tetragon] not found, installing latest version... | Deploying Tetragon and waiting for the DaemonSet to become ready; prints [tetragon] ready when done |
[sentinel] applying manifests... | Applying K8s Sentinel Kubernetes resources and waiting for the Deployment to become ready |
[trivy-operator] already installed, skipping | Trivy Operator already exists in the cluster, skipped |
[trivy-operator] not found, installing latest version... | Installing Trivy Operator and waiting for the Deployment to become ready; prints [trivy-operator] ready when done |
Done. Access via: | All steps completed |
After installation, the script displays a suggested port-forward command:
kubectl port-forward -n sentinel-system svc/sentinel 8080:80
Copy and run this command locally to open the K8s Sentinel management UI in your browser.
Step 5: Verify Deployment Status
kubectl get all -n sentinel-system
Expected result:
- Pod status is
Running - Service type is
ClusterIPwith an internal IP assigned
NAME READY STATUS RESTARTS AGE
pod/sentinel-7d9f8b6c4-xxxxx 1/1 Running 0 2m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/sentinel ClusterIP 10.96.123.45 <none> 80/TCP 2m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/sentinel 1/1 1 1 2m
If the Pod does not reach Running state, check for detailed error messages:
kubectl describe pod -n sentinel-system
kubectl logs -n sentinel-system deployment/sentinel
The script automatically downloads Helm and modifies cluster configuration (adding Tetragon and Trivy Operator, creating RBAC resources, etc.). In production environments, such automated operations may bypass change review processes. Consider using Kubernetes Job Installation instead for better operational transparency and control.