NOTICE: This system contains Controlled Unclassified Information (CUI)

Skip to content
Snippets Groups Projects
Select Git revision
2 results Searching

kpt-packages

  • Open with
  • Download source code
  • user avatar
    Adam Stracener authored
    10b0ec66
    History

    APPDAT KPT Packages

    Building Your Agent Config Project

    export GROUP="example"
    export AGENT_NAME="my-agent"
    1. 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
    1. 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
    1. 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
    1. generate manifest files and checkin
    mkdir manifests
    kustomize build . -o manifests
    
    git add .
    git commit -m "initial commit"
    git push

    Deploying Your Agent

    1. follow these instructions to generate an agent token
    2. 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 -
    1. 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