Add application controller resources

First chart version for argo-cd
added the new labels recommeneded for k8
This commit is contained in:
Liviu Costea 2019-01-16 21:51:07 +02:00
parent 969a59ead2
commit d403e02fe0
10 changed files with 223 additions and 0 deletions

View file

@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

View file

@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "0.11"
description: A Helm chart for Argo-CD
name: argo-cd
version: 0.1.0

View file

View file

@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "argo-cd.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "argo-cd.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "argo-cd.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View file

@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "argo-cd.fullname" . }}-application-controller
spec:
selector:
matchLabels:
app: {{ include "argo-cd.name" . }}-application-controller
template:
metadata:
labels:
app: {{ include "argo-cd.name" . }}-application-controller
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-application-controller
helm.sh/chart: {{ include "argo-cd.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "argo-cd.name" . }}
app.kubernetes.io/component: application-controller
spec:
containers:
- command:
- argocd-application-controller
- --status-processors
- "20"
- --operation-processors
- "10"
image: {{ .Values.applicationController.image.repository }}:{{ .Values.applicationController.image.tag }}
imagePullPolicy: {{ .Values.applicationController.image.pullPolicy }}
name: {{ include "argo-cd.name" . }}-application-controller
ports:
- containerPort: {{ .Values.applicationController.containerPort }}
readinessProbe:
tcpSocket:
port: {{ .Values.applicationController.containerPort }}
initialDelaySeconds: 5
periodSeconds: 10
serviceAccountName: {{ include "argo-cd.name" . }}-application-controller

View file

@ -0,0 +1,42 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "argo-cd.fullname" . }}-application-controller
labels:
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-application-controller
helm.sh/chart: {{ include "argo-cd.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "argo-cd.name" . }}
app.kubernetes.io/component: application-controller
rules:
- apiGroups:
- ""
resources:
- secrets
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- argoproj.io
resources:
- applications
- appprojects
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- list

View file

@ -0,0 +1,18 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "argo-cd.fullname" . }}-application-controller
labels:
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-application-controller
helm.sh/chart: {{ include "argo-cd.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "argo-cd.name" . }}
app.kubernetes.io/component: application-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "argo-cd.fullname" . }}-application-controller
subjects:
- kind: ServiceAccount
name: {{ include "argo-cd.fullname" . }}-application-controller

View file

@ -0,0 +1,11 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "argo-cd.fullname" . }}-application-controller
labels:
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-application-controller
helm.sh/chart: {{ include "argo-cd.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "argo-cd.name" . }}
app.kubernetes.io/component: application-controller

View file

@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "argo-cd.fullname" . }}-application-controller
labels:
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-application-controller
helm.sh/chart: {{ include "argo-cd.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "argo-cd.name" . }}
app.kubernetes.io/component: application-controller
spec:
ports:
- port: {{ .Values.applicationController.servicePort }}
targetPort: {{ .Values.applicationController.containerPort }}
selector:
app: {{ include "argo-cd.name" . }}-application-controller

View file

@ -0,0 +1,40 @@
applicationController:
containerPort: 8083
servicePort: 8083
image:
repository: argoproj/argocd
tag: v0.11.0
pullPolicy: Always
server:
containerPort: 8080
servicePort: 8080
containerMetricsPort: 8082
metricsPort: 8082
image:
repository: argoproj/argocd
tag: v0.11.0
pullPolicy: Always
uiInitImage:
repository: argoproj/argocd-ui
tag: v0.11.0
pullPolicy: Always
repoServer:
port: 8081
image:
repository: argoproj/argocd
tag: v0.11.0
pullPolicy: Always
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi