Skip to content

Commit

Permalink
Merge c8e8a71 into da81cc2
Browse files Browse the repository at this point in the history
  • Loading branch information
knight42 committed Dec 16, 2020
2 parents da81cc2 + c8e8a71 commit 5c518bf
Show file tree
Hide file tree
Showing 25 changed files with 525 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ With Cyclone, users end up with the flexibility of workflow orchestration and th
Make sure [Helm](https://helm.sh/) with a version higher than **2.10** is installed ([install guide](https://helm.sh/docs/using_helm/#install-helm)), then install Cyclone with:

```bash
$ helm install --name cyclone --namespace cyclone-system ./helm/cyclone
$ helm install --name cyclone --namespace cyclone-system ./manifests/cyclone-public
```

If you want to configure the installation or want to install from source code, please refer to [Cyclone Install Guide](docs/installation.md).
Expand Down
2 changes: 1 addition & 1 deletion build/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /root

# Copy cyclone server and stage templates
COPY bin/server /cyclone-server
COPY manifests/templates /root/templates
COPY templates /root/templates

EXPOSE 7099

Expand Down
2 changes: 1 addition & 1 deletion build/server/Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /root

# Copy cyclone server and stage templates
COPY bin/server /cyclone-server
COPY manifests/templates /root/templates
COPY templates /root/templates

EXPOSE 7099

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If you want to use your own private registry, you can configure it as:
$ helm install --name cyclone --namespace cyclone-system --set imageRegistry.registry=cargo.caicloud.xyz,imageRegistry.project=release ./helm/cyclone
```

For more detailed configuration, please use values file, [default values file](../helm/cyclone/values.yaml) is a good reference on how to write it.
For more detailed configuration, please use values file, [default values file](../manifests/cyclone-public/values.yaml) is a good reference on how to write it.

```bash
$ helm install --name cyclone --namespace cyclone-system -f <path-to-your-values-file> ./helm/cyclone
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
AppVersion: v1.0.0
apiVersion: v2
appVersion: v1.0.0
description: A Helm chart for Cyclone
name: cyclone
version: 0.1.2
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ data:
---

apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: cyclone-workflow-controller
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ rules:
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["rolebindings", "roles", "clusterroles"]
verbs: ["create", "get"]
- apiGroups: ["extensions"]
- apiGroups: ["extensions", "policy"]
resources: ["podsecuritypolicies"]
verbs: ["create", "get"]
- apiGroups: ["cyclone.dev"]
Expand Down
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions manifests/cyclone/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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
.vscode/
12 changes: 12 additions & 0 deletions manifests/cyclone/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
description: A Helm chart for Cyclone
name: cyclone
version: v1.2.0-alpha
appVersion: v1.2.0-alpha
keywords:
- cicd
- workflow
- devops
- k8s
sources:
- https://github.com/caicloud/cyclone
32 changes: 32 additions & 0 deletions manifests/cyclone/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "cyclone.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 "cyclone.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 "cyclone.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
140 changes: 140 additions & 0 deletions manifests/cyclone/templates/controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: workflow-controller-config
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "cyclone.name" . }}
helm.sh/chart: {{ include "cyclone.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
workflow-controller.json: |
{
"images": {
"git-resolver": "{{ .Values.platformConfig.imageRepositoryRelease }}/cyclone-resolver-git:{{ .Chart.AppVersion }}",
"svn-resolver": "{{ .Values.platformConfig.imageRepositoryRelease }}/cyclone-resolver-svn:{{ .Chart.AppVersion }}",
"image-resolver": "{{ .Values.platformConfig.imageRepositoryRelease }}/cyclone-resolver-image:{{ .Chart.AppVersion }}",
"http-resolver": "{{ .Values.platformConfig.imageRepositoryRelease }}/cyclone-resolver-http:{{ .Chart.AppVersion }}",
"coordinator": "{{ .Values.platformConfig.imageRepositoryRelease }}/cyclone-workflow-coordinator:{{ .Chart.AppVersion }}",
"toolbox": "{{ .Values.platformConfig.imageRepositoryRelease }}/cyclone-toolbox:{{ .Chart.AppVersion }}",
"gc": "{{ .Values.platformConfig.imageRepositoryLibrary }}/{{ .Values.engine.images.gc }}"
},
"logging": {
"level": "info"
},
"gc": {
"enabled": {{ .Values.engine.gc.enabled }},
"delay_seconds": {{ .Values.engine.gc.delaySeconds }},
"retry": {{ .Values.engine.gc.retry }},
"resource_quota": {
"limits": {
"cpu": "{{ .Values.engine.gc.resourceRequirement.limits.cpu }}",
"memory": "{{ .Values.engine.gc.resourceRequirement.limits.memory }}"
},
"requests": {
"cpu": "{{ .Values.engine.gc.resourceRequirement.requests.cpu }}",
"memory": "{{ .Values.engine.gc.resourceRequirement.requests.memory }}"
}
}
},
"limits": {
"max_workflowruns": {{ .Values.engine.limits.maxWorkflowRuns }}
},
"default_resource_quota": {
"limits": {
"cpu": "{{ .Values.engine.resourceRequirement.default.limits.cpu }}",
"memory": "{{ .Values.engine.resourceRequirement.default.limits.memory }}"
},
"requests": {
"cpu": "{{ .Values.engine.resourceRequirement.default.requests.cpu }}",
"memory": "{{ .Values.engine.resourceRequirement.default.requests.memory }}"
}
},
"workers_number": {
"execution_cluster": 1,
"workflow_trigger": 1,
"workflow_run": 1,
"pod": 1
},
"pvc": "cyclone-server-cyclone-data",
"cyclone_server_addr": "{{ .Values.platformConfig.controlClusterVIP }}:6041",
"notification_url": "http://{{ .Values.platformConfig.controlClusterVIP }}:6041/apis/v1alpha1/notifications"
}
---

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-workflow-controller
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ include "cyclone.name" . }}
app.kubernetes.io/component: workflow-controller
helm.sh/chart: {{ include "cyclone.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: {{ include "cyclone.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: cyclone-workflow-controller
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "cyclone.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: cyclone-workflow-controller
annotations:
sidecar.istio.io/inject: "false"
spec:
serviceAccountName: {{ .Values.serviceAccount }}
containers:
- name: controller
command:
- /workspace/controller
image: "{{ .Values.platformConfig.imageRegistry }}/{{ .Values.platformConfig.imageRepositoryRelease }}/cyclone-workflow-controller:{{ .Chart.AppVersion }}"
imagePullPolicy: Always
env:
- name: DEVELOP_MODE
value: {{ .Values.engine.developMode | quote }}
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
livenessProbe:
httpGet:
port: 8080
path: /healthz
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
successThreshold: 1
resources:
limits:
cpu: 150m
memory: 300Mi
requests:
cpu: 50m
memory: 100Mi
volumeMounts:
- mountPath: /etc/localtime
mountPropagation: HostToContainer
name: timezone
volumes:
- name: timezone
hostPath:
path: /etc/localtime
type: File

0 comments on commit 5c518bf

Please sign in to comment.