Install on an Existing cluster using KOTS (legacy)
You are now on a GitGuardian legacy architecture page.
We recommend installing the latest GitGuardian architecture. Please refer to Install on an Existing cluster using KOTS for guidance.
For information on the new architecture, as well as determining whether you are using the new or the legacy GitGuardian architecture, explore the New GitGuardian Architecture page.
Introduction
GitGuardian can be installed on your existing Kubernetes cluster using KOTS, a kubectl plugin and KOTS Admin Console to help manage Kubernetes Off-The-Shelf software.
GitGuardian supports deployment on bare metal, private, or public clouds.
Before starting the installation, ensure to review the system and network requirements, and download your license.
Installation
KOTS plugin
First, you need to install the KOTS plugin for kubectl
. You can do this with
this command:
curl https://kots.io/install | bash
Kubernetes Application RBAC
The KOTS Admin Console will have full control over all resources across all namespaces in the cluster. More information in Replicated documentation.
If you are not cluster-admin
in your Kubernetes cluster or do not want to
grant the KOTS Admin Console such wide permissions, you will need to apply the
below configuration in your targeted namespace:
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kotsadm
labels:
kots.io/backup: velero
kots.io/kotsadm: 'true'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: kotsadm-role
labels:
kots.io/backup: velero
kots.io/kotsadm: 'true'
rules:
- apiGroups: ['']
resources:
[
'configmaps',
'persistentvolumeclaims',
'pods',
'secrets',
'services',
'limitranges',
'serviceaccounts',
]
verbs: ['get', 'list', 'watch', 'create', 'update', 'patch', 'delete']
- apiGroups: ['apps']
resources:
[
'daemonsets',
'deployments',
'deployments/scale',
'replicasets',
'statefulsets',
]
verbs: ['get', 'list', 'watch', 'create', 'update', 'patch', 'delete']
- apiGroups: ['batch']
resources: ['jobs', 'cronjobs']
verbs: ['get', 'list', 'watch', 'create', 'update', 'patch', 'delete']
- apiGroups: ['networking.k8s.io', 'extensions']
resources: ['ingresses', 'networkpolicies']
verbs: ['get', 'list', 'watch', 'create', 'update', 'patch', 'delete']
- apiGroups: ['policy']
resources: ['poddisruptionbudgets']
verbs: ['get', 'list', 'watch', 'create', 'update', 'patch', 'delete']
- apiGroups: ['']
resources: ['namespaces', 'endpoints']
verbs: ['get']
- apiGroups: ['authorization.k8s.io']
resources: ['selfsubjectaccessreviews', 'selfsubjectrulesreviews']
verbs: ['create']
- apiGroups: ['rbac.authorization.k8s.io']
resources: ['roles', 'rolebindings']
verbs: ['get', 'list', 'watch', 'create', 'update', 'patch', 'delete']
- apiGroups: ['']
resources: ['pods/log', 'pods/exec']
verbs: ['get', 'list', 'watch', 'create']
- apiGroups: ['batch']
resources: ['jobs/status']
verbs: ['get', 'list', 'watch']
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kotsadm-rolebinding
labels:
kots.io/backup: velero
kots.io/kotsadm: 'true'
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kotsadm-role
subjects:
- kind: ServiceAccount
name: kotsadm
And proceed with the KOTS Admin Console step.
KOTS Admin Console
Once you have the plugin installed, you can install the KOTS Admin Console.
If you are cluster-admin
:
kubectl kots install gitguardian-seal/prod
If not:
kubectl kots install --ensure-rbac=false gitguardian-seal/prod
You will be prompted to choose a namespace to deploy the application and a password to access the KOTS Admin Console.
Once the installation of the KOTS Admin Console is finished, a port forward will be set up, and you will be able to access the KOTS Admin Console on http://localhost:8800.
KOTS Admin Console
By default, this is accessed on http://localhost:8800 using this command
kubectl kots admin-console --namespace=<namespace>
, which is a wrapper
around kubectl port-forward
. You can configure an ingress if you want a public
endpoint.
Launch
Application
- Enter the password provided at the end of the cluster installation.
- Upload the license downloaded on the portal for instructions on how to download the license file).
Configure the application. You need to fill in all the required fields:
- Application Hostname: Enter the Fully Qualified Domain Name (FQDN) for the GitGuardian application.
- Admin User Fields: These fields are used to create the first GitGuardian user. You'll need to change the password upon the first login.
- Databases: You must select an external PostgreSQL and Redis, see Configure your database. When utilizing Redis Sentinel for high availability, ensure that the Redis master password matches with the Redis sentinel's password and that you're using the correct Sentinel port (default: 26379).
Additional configuration options include:
- Scaling (Advanced): Adjust the number of replicas for each application component. For more details, visit the Scaling page.
- Prometheus: Activate an exporter for Prometheus.
- Ingress TLS Certificate: This is for the GitGuardian Application. You can either use auto-generated self-signed certificates or upload your own. If not specified, the certificate from the KOTS Admin Console in step 1 will be used. For self-signed or private CA certificates, disable SSL verification for the GitHub webhook. Learn more on the Configure TLS certificates page.
- Custom Certificate Authority: Provide a custom CA if necessary.
- HTTP(s) Proxy: Refer to the proxy section if needed.
- Check if preflight checks pass.
- Launch
The first installation of the application requires a few minutes to create all database objects. Once the process is completed, you will be able to log in to the dashboard using the administrator user you defined.
- Save the Data Encryption Key
GitGuardian encrypts all sensitive information in the database using an encryption key (aka Django Secret Key). In case of disaster recovery, this key will be needed to restore your data.
You should save it and keep it in a secure location. Use the following command to display the key:
kubectl get secrets gitguardian-env-variables -o jsonpath='{.data.DJANGO_SECRET_KEY}' | base64 -d