Commit 844b165d by Anshul Anshul Committed by Guangbo

Add harness delegate chart v1.0.0

Add harness delegate chart v1.0.0
parent d7a6d260
apiVersion: v1
name: harness-delegate
version: 1.0.0
appVersion: 1.0.0
description: Deploys harness delegate
home: https://harness.io/
icon: https://harness.io/wp-content/uploads/2019/07/logo-black.png
keywords:
- harness.io
- harness delegate
maintainers:
- email: anshul@harness.io
name: anshul-harness
- email: puneet.saraswat@harness.io
name: puneetsar
# Harness Delegate
The [Harness Delegate](https://docs.harness.io/article/de9t8iiynt-harness-architecture) is a service that you run in your local network or VPC to connect Harness Manager with your artifact servers, infrastructure, collaboration providers, and verification providers.
## Introduction
This chart creates a [Harness Delegate](https://docs.harness.io/article/h9tkwmkrm7-delegate-installation) deployment on a [Kubernetes](http://kubernetes.io) cluster, using the [Helm](https://helm.sh) package manager.
## Installing the Chart
To add a Harness Helm repo named `harness`:
```console
$ helm repo add harness https://app.harness.io/storage/harness-download/harness-helm-charts/
```
The chart requires some account-specific information. You can download the account-specific `delegate-helm-values.yaml` file by going to Harness Manager > Setup > Harness Delegates > Download Delegate > Helm Values YAML.
To install the chart using release name `my-release` and the `delegate-helm-values.yaml`
```console
$ helm install --name my-release harness/harness-delegate -f delegate-helm-values.yaml
```
Above command deploys Harness Delegate on the Kubernetes cluster.
## Uninstalling the Chart
To uninstall/delete the `my-release` deployment:
```console
$ helm del --purge my-release
```
## Useful commands
Get pod names:
```console
kubectl get pods -n harness-delegate
```
See startup logs:
```console
kubectl logs <pod-name> -n harness-delegate -f
```
Run a shell in a pod:
```console
kubectl exec <pod-name> -n harness-delegate -it -- bash
```
# Harness Delegate
The [Harness Delegate](https://docs.harness.io/article/de9t8iiynt-harness-architecture) is a service that you run in your local network or VPC to connect Harness Manager with your artifact servers, infrastructure, collaboration providers, and verification providers.
## Introduction
This chart creates a [Harness Delegate](https://docs.harness.io/article/h9tkwmkrm7-delegate-installation) deployment on a [Kubernetes](http://kubernetes.io) cluster, using the [Helm](https://helm.sh) package manager.
categories:
- CI/CD
labels:
io.rancher.certified: partner
questions:
- variable: accountId
default: ""
description: "Account ID to which the Harness Delegate will connect"
type: string
required: true
label: Account ID
group: "Account Details"
- variable: accountSecret
default: ""
type: string
required: true
label: Account Secret
group: "Account Details"
- variable: accountIdShort
default: ""
description: "6-character identifier for the account"
type: string
required: true
label: Short Account ID
group: "Account Details"
# Delegate Configuration
- variable: delegateName
default: "harness-delegate"
description: "Name of the Harness Delegate"
type: string
required: true
label: Delegate Name
group: "Delegate Configuration"
- variable: clusterWideRbacScope
default: true
description: "Role-based access control: Set to True for cluster-wide, or False for namespace-wide"
type: boolean
required: true
label: RBAC scope
group: "Delegate Configuration"
# Advanced Server Settings
- variable: advancedOptions
default: false
label: Show Advanced Server Configurations
type: boolean
show_subquestion_if: true
group: "Advanced Server Options"
subquestions:
- variable: managerHostAndPort
default: "https://app.harness.io"
description: "URL of the Harness server"
type: string
label: Harness Server
- variable: watcherStorageUrl
default: "https://app.harness.io/storage/wingswatchers"
type: string
label: Watcher Storage URL
- variable: watcherCheckLocation
default: "watcherprod.txt"
description: "Watcher file name"
type: string
label: Watcher File
- variable: delegateStorageUrl
default: "https://app.harness.io/storage/wingsdelegates"
type: string
label: Delegate Storage URL
- variable: delegateCheckLocation
default: "delegateprod.txt"
description: "Delegate file name"
type: string
label: Delegate File
- variable: delegateProfile
default: ""
description: "ID of the Delegate profile that must run when the Delegate launches"
type: string
label: Delegate Profile ID
- variable: helmDesiredVersion
default: ""
description: "Helm version to be installed in the Delegate"
type: string
label: Helm version
# Advanced Proxy Settings
- variable: advancedProxyOptions
default: false
label: Show Advanced Proxy Configurations
type: boolean
show_subquestion_if: true
group: "Advanced Proxy Options"
subquestions:
- variable: proxyManager
default: "true"
description: "Set to True if the Harness Delegate should go through the proxy"
type: boolean
label: Proxy Manager
- variable: pollForTasks
default: "false"
description: "Set to True if the proxy does not support WebSocket Protocol (wss)"
type: boolean
label: Poll For Tasks
- variable: proxyHost
default: ""
description: "URL of the proxy host"
type: string
label: Proxy Host
- variable: proxyPort
default: ""
type: string
label: Proxy Port
- variable: proxyUser
default: ""
type: string
label: Proxy Username
- variable: proxyPassword
default: ""
type: string
label: Proxy Password
- variable: proxyScheme
default: ""
description: "Select http or https"
type: enum
label: Proxy Scheme
options:
- ""
- "http"
- "https"
- variable: noProxy
default: ""
description: "Enter a comma-separated list of suffixes for which the proxy is not required (.example.com, <specifichost>, ...). Do not insert leading wildcards"
type: string
label: No Proxy Domains
apiVersion: v1
kind: ServiceAccount
metadata:
name: harness-admin-sa
---
{{- if .Values.clusterWideRbacScope}}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: {{ .Values.delegateName }}-cluster-admin
subjects:
- kind: ServiceAccount
name: harness-admin-sa
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
---
{{- else }}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: {{ .Values.delegateName }}-admin
rules:
- apiGroups: ["", "extensions", "apps"]
resources: ["deployments", "replicasets", "pods", "configmaps", "secrets", "services"]
verbs: ["*"]
- apiGroups: ["", "extensions", "apps"]
resources: ["events", "namespaces", "resourcequotas", "limitranges"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: {{ .Values.delegateName }}-admin
subjects:
- kind: ServiceAccount
name: harness-admin-sa
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ .Values.delegateName }}-admin
{{- end}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.delegateName }}-configmap
data:
ACCOUNT_ID: {{ required "A valid .Values.accountId entry required!" .Values.accountId }}
ACCOUNT_SECRET: {{ required "A valid .Values.accountSecret entry required!" .Values.accountSecret }}
MANAGER_HOST_AND_PORT : {{ .Values.managerHostAndPort }}
WATCHER_STORAGE_URL: {{ .Values.watcherStorageUrl }}
WATCHER_CHECK_LOCATION: {{ .Values.watcherCheckLocation }}
DELEGATE_STORAGE_URL: {{ .Values.delegateStorageUrl }}
DELEGATE_CHECK_LOCATION: {{ .Values.delegateCheckLocation }}
DEPLOY_MODE: "KUBERNETES"
DELEGATE_NAME: {{ .Values.delegateName | quote }}
DELEGATE_PROFILE: {{ .Values.delegateProfile | quote }}
PROXY_HOST: {{ .Values.proxyHost | quote }}
PROXY_PORT: {{ .Values.proxyPort | quote }}
PROXY_SCHEME: {{ .Values.proxyScheme | quote }}
NO_PROXY: {{ .Values.noProxy | quote }}
PROXY_MANAGER: {{ .Values.proxyManager | quote }}
POLL_FOR_TASKS: {{ .Values.pollForTasks | quote }}
HELM_DESIRED_VERSION: {{ .Values.helmDesiredVersion | quote }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.delegateName }}-secret
type: Opaque
data:
# Enter base64 encoded username and password, if needed
PROXY_USER: {{ .Values.proxyUser | quote }}
PROXY_PASSWORD: {{ .Values.proxyPassword | quote }}
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
harness.io/name: {{ .Values.delegateName }}
name: {{ .Values.delegateName }}-{{ required "A valid .Values.accountIdShort entry required!" .Values.accountIdShort }}
spec:
replicas: 1
selector:
matchLabels:
harness.io/name: {{ .Values.delegateName }}
serviceName: ""
template:
metadata:
labels:
harness.io/name: {{ .Values.delegateName }}
spec:
serviceAccountName: harness-admin-sa
containers:
- image: {{ .Values.image }}
imagePullPolicy: Always
name: harness-delegate-instance
resources:
{{ toYaml .Values.resources | indent 10 }}
envFrom:
- configMapRef:
name: {{ .Values.delegateName }}-configmap
- secretRef:
name: {{ .Values.delegateName }}-secret
restartPolicy: Always
# Default values for harness-delegate chart.
# This is a YAML-formatted file.
# Declare name/value pairs to be passed into your templates.
# name: value
# These are the required values that are needed for harness-delegate
# chart deployment. You can download these account specific values by
# going to Harness > Setup > Installations page
# Account Id to which the delegate will be connecting
accountId: ""
# Account Secret
accountSecret: ""
# Short 6 character identifier of the account
accountIdShort: ""
# These are the prepopulated default values that are needed for
# harness-delegate chart deployment
# Delegate name
delegateName: harness-delegate
# If the RBAC scope is at cluster or namespace level
clusterWideRbacScope: true
# For connecting to Harness production SAAS environment, leave these
# values as it is. For on-prem installation, these will be overriden
# and you can download at Harness > Setup > Installations page
managerHostAndPort: https://app.harness.io
watcherStorageUrl: https://app.harness.io/storage/wingswatchers
watcherCheckLocation: watcherprod.txt
delegateStorageUrl: https://app.harness.io/storage/wingsdelegates
delegateCheckLocation: delegateprod.txt
# Delegate image to be deployed
image: harness/delegate:latest
# Delegate resource limits
resources:
limits:
cpu: "1"
memory: "8Gi"
requests:
cpu: "500m"
memory: "6Gi"
# If the harness delegate should go through proxy then set it to true
proxyManager: "true"
# If the proxy doesn't support web socket (wss) protocol then set it
# to true
pollForTasks: "false"
# Proxy settings if the delegate will be running behind proxy
proxyHost: ""
proxyPort: ""
proxyUser: ""
proxyPassword: ""
# Allowed values are http or https
proxyScheme: ""
# Enter a comma separated list of suffixes for which proxy is not
# required. Do not use leading wildcards (.company.com,specifichost)
# (optional):
noProxy: ""
# Id of the delegate profile that needs to run when the delegate is
# coming up
delegateProfile: ""
# Helm version to be installed in delegate
helmDesiredVersion: ""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment