APPDAT KPT Packages
Building Your Agent Config Project
export GROUP="example"
export AGENT_NAME="my-agent"
- initialize agent config repo
mkdir -p "$GROUP/cluster-config"
cd "$GROUP/cluster-config"
git init
# create agent config file
mkdir -p ".gitlab/agents/$AGENT_NAME"
cat <<EOF > ".gitlab/agents/$AGENT_NAME"
gitops:
manifest_projects:
- id: $GROUP/cluster-config
paths:
- glob: '/manifests/**/*.yaml'
EOF
- add kpt packages you wish to use (see
kpt pkg get
docs)
kpt pkg get git@appdat.jsc.nasa.gov:appdat/kpt-packages.git/ingress-nginx@master ingress-nginx
kpt pkg get git@appdat.jsc.nasa.gov:appdat/kpt-packages.git/cert-manager@master cert-manager
- create a
kustomization.yaml
file
cat <<EOF > kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ingress-nginx/appdat
- cert-manager/appdat
EOF
- generate manifest files and checkin
mkdir manifests
kustomize build . -o manifests
git add .
git commit -m "initial commit"
git push
Deploying Your Agent
- follow these instructions to generate an agent token
- deploy an agent to the cluster using the generated token:
kubectl create namespace gitlab-agent
docker run --rm -it registry.gitlab.com/gitlab-org/cluster-integration/gitlab-agent/cli:latest generate \
--agent-token "<agent-token>" \
--agent-version "<agent-version>" \
--namespace "gitlab-agent" \
--kas-address wss://kas.appdat.jsc.nasa.gov:443 | kubectl apply -f -
- verify that everything is working by tailing agent logs:
kubectl logs -f -l=app=gitlab-agent -n gitlab-agent
Modifying the Package Defaults
Various setters are exposed for basic customizations of the manifets provided in this project.
See the kpt cfg set
docs for usage.
When the setters do not provide enough flexibility you are free to override anything in the individual
manifest files directly. Even after manual modifications are made you can still pull in upstream changes
using kpt pkg update
. For example:
kpt pkg update cert-manager@master --strategy=resource-merge