Back to Charts

JFrog Mission-Control Helm Chart - DEPRECATED

stable/mission-control/README.md

latest19.1 KB
Original Source

JFrog Mission-Control Helm Chart - DEPRECATED

This chart is deprecated! You can find the new chart in:

bash
helm repo add jfrog https://charts.jfrog.io

Prerequisites Details

  • Kubernetes 1.8+

Chart Details

This chart will do the following:

  • Deploy Mongodb database.
  • Deploy Elasticsearch.
  • Deploy Mission Control.

Requirements

  • A running Kubernetes cluster
  • Dynamic storage provisioning enabled
  • Default StorageClass set to allow services using the default StorageClass for persistent storage
  • A running Artifactory Enterprise
  • Kubectl installed and setup to use the cluster
  • Helm installed and setup to use the cluster (helm init)

Create Secret with keys and certs for Mission-Control

  • Create file generate_keys.sh with following content:
bash
#!/bin/bash
set -e

usage() {
    echo "Usage: $0 [store_password]"
    exit 1
}

processCommandLine() {
    if [[ "$1" =~ (help|-h|--help) ]]; then
        usage
    fi

    # Set password if not passed
    if [ -z "$1" ]; then
        echo "No password passed. Generating a random one..."
        storePassword=$(cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-f0-9' | head -c 16)
    else
        storePassword=$1
    fi
}

# Check if key generation tools are available
checkTools() {
    echo "Checking if required tools exist"
    for tool in "keytool" "openssl"; do
        echo "${tool}"
        hash ${tool} 2>/dev/null
    done
}

# Create the file system structure
createCertsDir() {
    tmpDir=./certs
    jfmcSecurity=${tmpDir}/mission-control/etc/security
    insightSecurity=${tmpDir}/insight-server/etc/security
    echo "Generating certs in ${tmpDir}"
    if [ -d ${tmpDir} ]; then
        echo "Found existing ${tmpDir}. Backing it up to ${tmpDir}-${timeStamp}..."
        mv ${tmpDir} ${tmpDir}-${timeStamp}
    fi

    mkdir -pv ${jfmcSecurity} ${insightSecurity}
}

genJfmcKeyStore() {
    keytool -genkeypair -alias secure-jfmc -keyalg RSA \
          -dname "CN=*,OU=JFMC,O=JFrog,L=Toulouse,S=France,C=fr" \
          -keystore ${tmpDir}/jfmc-keystore.jks \
          -storepass ${storePassword} \
          -keypass ${storePassword}

    keytool -exportcert -alias secure-jfmc \
          -file ${tmpDir}/jfmc-public.cer \
          -keystore ${tmpDir}/jfmc-keystore.jks \
          -storepass ${storePassword}

    keytool -importkeystore \
          -srcalias secure-jfmc \
          -srckeystore ${tmpDir}/jfmc-keystore.jks \
          -destkeystore ${tmpDir}/jfmc-keystore.p12 \
          -deststoretype PKCS12 \
          -srckeypass ${storePassword} \
          -srcstorepass ${storePassword} \
          -deststorepass ${storePassword}

    openssl pkcs12 -in ${tmpDir}/jfmc-keystore.p12 \
                 -nokeys \
                 -nodes \
                 -out ${tmpDir}/jfmc.crt \
                 -password pass:${storePassword} \
                 -passin pass:${storePassword}
}

genInsightKeyStore() {
    keytool -genkeypair -alias secure-insight -keyalg RSA \
          -dname "CN=*,OU=Insight,O=JFrog,L=Bengaluru,S=Kan,C=in" \
          -keystore ${tmpDir}/insight-keystore.jks \
          -storepass ${storePassword} \
          -keypass ${storePassword}

    keytool -exportcert -alias secure-insight \
          -file ${tmpDir}/insight-public.cer \
          -keystore ${tmpDir}/insight-keystore.jks \
          -storepass ${storePassword}

    keytool -importkeystore \
          -srcalias secure-insight \
          -srckeystore ${tmpDir}/insight-keystore.jks \
          -destkeystore ${tmpDir}/insight-keystore.p12 \
          -deststoretype PKCS12 \
          -noprompt \
          -srckeypass ${storePassword} \
          -srcstorepass ${storePassword} \
          -deststorepass ${storePassword}


    openssl pkcs12 -in ${tmpDir}/insight-keystore.p12 \
                 -nocerts \
                 -nodes \
                 -out ${tmpDir}/insight.key \
                 -password pass:${storePassword} \
                 -passin pass:${storePassword}
    openssl pkcs12 -in ${tmpDir}/insight-keystore.p12 \
                 -nokeys \
                 -nodes \
                 -out ${tmpDir}/insight.crt \
                 -password pass:${storePassword} \
                 -passin pass:${storePassword}
}

importInTrustStore() {
    keytool -importcert -keystore ${tmpDir}/jfmc-truststore.jks \
          -alias insightcert \
          -noprompt \
          -file ${tmpDir}/insight-public.cer \
          -storepass ${storePassword}

    keytool -importcert -keystore ${tmpDir}/insight-truststore.jks \
          -alias jfmccert \
          -noprompt \
          -file ${tmpDir}/jfmc-public.cer \
          -storepass ${storePassword}
}

# Put the generated files in their intended structure
arrangeFiles() {
    echo "Moving certs to their final location"
    mv -f ${tmpDir}/jfmc-truststore.jks ${jfmcSecurity}
    mv -f ${tmpDir}/jfmc-keystore.jks ${jfmcSecurity}
    mv -f ${tmpDir}/jfmc.crt ${insightSecurity}
    mv -f ${tmpDir}/insight-truststore.jks ${insightSecurity}
    mv -f ${tmpDir}/insight-keystore.jks ${insightSecurity}
    mv -f ${tmpDir}/insight.key ${insightSecurity}
    mv -f ${tmpDir}/insight.crt ${insightSecurity}
    cat ${jfmcSecurity}/jfmc-truststore.jks | base64 > ${jfmcSecurity}/jfmc-truststore.jks-b64
    cat ${jfmcSecurity}/jfmc-keystore.jks | base64 > ${jfmcSecurity}/jfmc-keystore.jks-b64
}

summary() {
    echo -e "\nAll keys and certificates are ready!"
    echo -e "\n- Mission Control files"
    find ${jfmcSecurity} -type f
    echo -e "\n- Insight Server files"
    find ${insightSecurity} -type f
}

############ Main ############

echo -e "\nCreating keys and certificates for JFrog Mission Control"
echo "========================================================"

timeStamp=$(date +%Y%m%d-%H%M%S)

processCommandLine $*
checkTools
createCertsDir
genInsightKeyStore
genJfmcKeyStore
importInTrustStore
arrangeFiles
summary
echo -e "========================================================\n"
  • Run ./generate_keys.sh to create certs and keys.

  • Create secret for certs and keys

bash
kubectl create secret generic mission-control-certs --from-file=./certs/insight-server/etc/security/insight.key --from-file=./certs/insight-server/etc/security/insight.crt --from-file=./certs/insight-server/etc/security/jfmc.crt  --from-file=./certs/mission-control/etc/security/jfmc-truststore.jks-b64 --from-file=./certs/mission-control/etc/security/jfmc-keystore.jks-b64

Installing the Chart with certificate secret

bash
helm install --name mission-control --set existingCertsSecret=mission-control-certs stable/mission-control

Set Mission Control base URL

  • Get mission-control url by running following commands: export SERVICE_IP=$(kubectl get svc --namespace default mission-control-mission-control -o jsonpath='{.status.loadBalancer.ingress[0].ip}')

export MISSION_CONTROL_URL="http://$SERVICE_IP:8080/"

  • Set mission-control by running helm upgrade command:
helm upgrade --name mission-control --set existingCertsSecret=mission-control-certs --set missionControl.missionControlUrl=$MISSION_CONTROL_URL stable/mission-control

Accessing Mission Control

NOTE: It might take a few minutes for Mission Control's public IP to become available, and the nodes to complete initial setup. Follow the instructions outputted by the install command to get the Distribution IP and URL to access it.

Updating Mission Control

Once you have a new chart version, you can update your deployment with

helm upgrade mission-control stable/mission-control

Configuration

The following table lists the configurable parameters of the distribution chart and their default values.

ParameterDescriptionDefault
initContainerImageInit Container Imagealpine:3.6
imagePullPolicyContainer pull policyIfNotPresent
imagePullSecretsDocker registry pull secret
serviceAccount.createSpecifies whether a ServiceAccount should be createdtrue
serviceAccount.nameThe name of the ServiceAccount to createGenerated using the fullname template
rbac.createSpecifies whether RBAC resources should be createdtrue
rbac.role.rulesRules to create[]
mongodb.enabledEnable Mongodbtrue
mongodb.image.tagMongodb docker image tag3.6.3
mongodb.image.pullPolicyMongodb Container pull policyIfNotPresent
mongodb.persistence.enabledMongodb persistence volume enabledtrue
mongodb.persistence.existingClaimUse an existing PVC to persist datanil
mongodb.persistence.storageClassStorage class of backing PVCgeneric
mongodb.persistence.sizeMongodb persistence volume size50Gi
mongodb.livenessProbe.initialDelaySecondsMongodb delay before liveness probe is initiated40
mongodb.readinessProbe.initialDelaySecondsMongodb delay before readiness probe is initiated30
mongodb.mongodbExtraFlagsMongoDB additional command line flags["--wiredTigerCacheSizeGB=1"]
mongodb.usePasswordEnable password authenticationfalse
mongodb.db.adminUserMongodb Database Admin Useradmin
mongodb.db.adminPasswordMongodb Database Password for Admin user
mongodb.db.mcUserMongodb Database Mission Control Usermission_platform
mongodb.db.mcPasswordMongodb Database Password for Mission Control user
mongodb.db.insightUserMongodb Database Insight Userjfrog_insight
mongodb.db.insightPasswordMongodb Database password for Insight User
mongodb.db.insightSchedulerDbMongodb Database for Schedulerinsight_scheduler
elasticsearch.enabledEnable Elasticsearchtrue
elasticsearch.persistence.enabledElasticsearch persistence volume enabledtrue
elasticsearch.persistence.existingClaimUse an existing PVC to persist datanil
elasticsearch.persistence.storageClassStorage class of backing PVCgeneric
elasticsearch.persistence.sizeElasticsearch persistence volume size50Gi
elasticsearch.env.clusterNameElasticsearch Cluster Namees-cluster
elasticsearch.env.esUsernameElasticsearch User Nameelastic
elasticsearch.env.esPasswordElasticsearch User Namechangeme
existingCertsSecretMission Control certificate secret name
missionControl.nameMission Control namemission-control
missionControl.replicaCountMission Control replica count1
missionControl.imageContainer imagedocker.jfrog.io/jfrog/mission-control
missionControl.versionContainer image tag3.1.2
missionControl.service.typeMission Control service typeLoadBalancer
missionControl.externalPortMission Control service external port80
missionControl.internalPortMission Control service internal port8080
missionControl.missionControlUrlMission Control URL
missionControl.persistence.mountPathMission Control persistence volume mount path"/var/opt/jfrog/mission-control"
missionControl.persistence.storageClassStorage class of backing PVCnil (uses alpha storage class annotation)
missionControl.persistence.existingClaimProvide an existing PersistentVolumeClaimnil
missionControl.persistence.enabledMission Control persistence volume enabledtrue
missionControl.persistence.accessModeMission Control persistence volume access modeReadWriteOnce
missionControl.persistence.sizeMission Control persistence volume size100Gi
missionControl.javaOpts.otherMission Control JAVA_OPTIONS-server -XX:+UseG1GC -Dfile.encoding=UTF8
missionControl.javaOpts.xmsMission Control JAVA_OPTIONS -Xms1g
missionControl.javaOpts.xmxMission Control JAVA_OPTIONS -Xmx2g
insightServer.nameInsight Server nameinsight-server
insightServer.replicaCountInsight Server replica count1
insightServer.imageContainer imagedocker.jfrog.io/jfrog/insight-server
insightServer.versionContainer image tag3.1.2
insightServer.service.typeInsight Server service typeClusterIP
insightServer.externalHttpPortInsight Server service external port8082
insightServer.internalHttpPortInsight Server service internal port8082
insightServer.externalHttpsPortInsight Server service external port8091
insightServer.internalHttpsPortInsight Server service internal port8091
insightScheduler.nameInsight Scheduler nameinsight-scheduler
insightScheduler.replicaCountInsight Scheduler replica count1
insightScheduler.imageContainer imagedocker.jfrog.io/jfrog/insight-scheduler
insightScheduler.versionContainer image tag3.1.2
insightScheduler.service.typeInsight Scheduler service typeClusterIP
insightScheduler.externalPortInsight Scheduler service external port8080
insightScheduler.internalPortInsight Scheduler service internal port8080
insightExecutor.nameInsight Executor nameinsight-scheduler
insightExecutor.replicaCountInsight Executor replica count1
insightExecutor.imageContainer imagedocker.jfrog.io/jfrog/insight-executor
insightExecutor.versionContainer image tag3.1.2
insightExecutor.service.typeInsight Executor service typeClusterIP
insightExecutor.externalPortInsight Executor service external port8080
insightExecutor.internalPortInsight Executor service internal port8080
insightExecutor.persistence.mountPathInsight Executor persistence volume mount path"/var/cloudbox"
insightExecutor.persistence.enabledInsight Executor persistence volume enabledtrue
insightExecutor.persistence.storageClassStorage class of backing PVCnil (uses alpha storage class annotation)
insightExecutor.persistence.existingClaimProvide an existing PersistentVolumeClaimnil
insightExecutor.persistence.accessModeInsight Executor persistence volume access modeReadWriteOnce
insightExecutor.persistence.sizeInsight Executor persistence volume size100Gi

Specify each parameter using the --set key=value[,key=value] argument to helm install.