make forward-port fleet

Signed-off-by: Matt Farina <matt.farina@suse.com>
pull/2319/head
Matt Farina 2023-01-06 15:21:53 -05:00
parent 8f6c528621
commit 2ddbd7a8fc
No known key found for this signature in database
GPG Key ID: 92C44A3D421FF7F9
20 changed files with 594 additions and 51 deletions

Binary file not shown.

View File

@ -0,0 +1,22 @@
annotations:
catalog.cattle.io/auto-install: fleet-crd=match
catalog.cattle.io/certified: rancher
catalog.cattle.io/experimental: "true"
catalog.cattle.io/hidden: "true"
catalog.cattle.io/kube-version: '>= 1.16.0-0 < 1.25.0-0'
catalog.cattle.io/namespace: cattle-fleet-system
catalog.cattle.io/os: linux
catalog.cattle.io/permits-os: linux,windows
catalog.cattle.io/provides-gvr: clusters.fleet.cattle.io/v1alpha1
catalog.cattle.io/rancher-version: '>= 2.6.0-0 < 2.7.0-0'
catalog.cattle.io/release-name: fleet
apiVersion: v2
appVersion: 0.4.1
dependencies:
- condition: gitops.enabled
name: gitjob
repository: file://./charts/gitjob
description: Fleet Manager - GitOps at Scale
icon: https://charts.rancher.io/assets/logos/fleet.svg
name: fleet
version: 100.1.1+up0.4.1

View File

@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View File

@ -0,0 +1,5 @@
apiVersion: v2
appVersion: 0.1.32
description: Controller that run jobs based on git events
name: gitjob
version: 0.1.32

View File

@ -0,0 +1,22 @@
{{- define "system_default_registry" -}}
{{- if .Values.global.cattle.systemDefaultRegistry -}}
{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}}
{{- else -}}
{{- "" -}}
{{- end -}}
{{- end -}}
{{/*
Windows cluster will add default taint for linux nodes,
add below linux tolerations to workloads could be scheduled to those linux nodes
*/}}
{{- define "linux-node-tolerations" -}}
- key: "cattle.io/os"
value: "linux"
effect: "NoSchedule"
operator: "Equal"
{{- end -}}
{{- define "linux-node-selector" -}}
kubernetes.io/os: linux
{{- end -}}

View File

@ -0,0 +1,38 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: gitjob
rules:
- apiGroups:
- "batch"
resources:
- 'jobs'
verbs:
- '*'
- apiGroups:
- ""
resources:
- 'pods'
verbs:
- 'list'
- 'get'
- 'watch'
- apiGroups:
- ""
resources:
- 'secrets'
verbs:
- '*'
- apiGroups:
- ""
resources:
- 'configmaps'
verbs:
- '*'
- apiGroups:
- "gitjob.cattle.io"
resources:
- "gitjobs"
- "gitjobs/status"
verbs:
- "*"

View File

@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: gitjob-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: gitjob
subjects:
- kind: ServiceAccount
name: gitjob
namespace: {{ .Release.Namespace }}

View File

@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitjob
spec:
selector:
matchLabels:
app: "gitjob"
template:
metadata:
labels:
app: "gitjob"
spec:
serviceAccountName: gitjob
containers:
- image: "{{ template "system_default_registry" . }}{{ .Values.gitjob.repository }}:{{ .Values.gitjob.tag }}"
name: gitjob
command:
- gitjob
{{- if .Values.debug }}
- --debug
{{- end }}
- --tekton-image
- "{{ template "system_default_registry" . }}{{ .Values.tekton.repository }}:{{ .Values.tekton.tag }}"
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.proxy }}
- name: HTTP_PROXY
value: {{ .Values.proxy }}
- name: HTTPS_PROXY
value: {{ .Values.proxy }}
- name: NO_PROXY
value: {{ .Values.noProxy }}
{{- end }}
nodeSelector: {{ include "linux-node-selector" . | nindent 8 }}
{{- if .Values.nodeSelector }}
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
tolerations: {{ include "linux-node-tolerations" . | nindent 8 }}
{{- if .Values.tolerations }}
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}

View File

@ -0,0 +1,23 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: gitjob
rules:
- apiGroups:
- "coordination.k8s.io"
resources:
- "leases"
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: gitjob
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: gitjob
subjects:
- kind: ServiceAccount
name: gitjob

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: gitjob
spec:
ports:
- name: http-80
port: 80
protocol: TCP
targetPort: 8080
selector:
app: "gitjob"

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: gitjob

View File

@ -0,0 +1,26 @@
gitjob:
repository: rancher/gitjob
tag: v0.1.32
tekton:
repository: rancher/tekton-utils
tag: v0.1.7
global:
cattle:
systemDefaultRegistry: ""
# http[s] proxy server
# proxy: http://<username>@<password>:<url>:<port>
# comma separated list of domains or ip addresses that will not use the proxy
noProxy: 127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.svc,.cluster.local
## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## List of node taints to tolerate (requires Kubernetes >= 1.6)
tolerations: []
debug: false

View File

@ -0,0 +1,22 @@
{{- define "system_default_registry" -}}
{{- if .Values.global.cattle.systemDefaultRegistry -}}
{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}}
{{- else -}}
{{- "" -}}
{{- end -}}
{{- end -}}
{{/*
Windows cluster will add default taint for linux nodes,
add below linux tolerations to workloads could be scheduled to those linux nodes
*/}}
{{- define "linux-node-tolerations" -}}
- key: "cattle.io/os"
value: "linux"
effect: "NoSchedule"
operator: "Equal"
{{- end -}}
{{- define "linux-node-selector" -}}
kubernetes.io/os: linux
{{- end -}}

View File

@ -0,0 +1,24 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: fleet-controller
data:
config: |
{
"agentImage": "{{ template "system_default_registry" . }}{{.Values.agentImage.repository}}:{{.Values.agentImage.tag}}",
"agentImagePullPolicy": "{{ .Values.agentImage.imagePullPolicy }}",
"apiServerURL": "{{.Values.apiServerURL}}",
"apiServerCA": "{{b64enc .Values.apiServerCA}}",
"agentCheckinInterval": "{{.Values.agentCheckinInterval}}",
"ignoreClusterRegistrationLabels": {{.Values.ignoreClusterRegistrationLabels}},
"bootstrap": {
"paths": "{{.Values.bootstrap.paths}}",
"repo": "{{.Values.bootstrap.repo}}",
"secret": "{{.Values.bootstrap.secret}}",
"branch": "{{.Values.bootstrap.branch}}",
"namespace": "{{.Values.bootstrap.namespace}}",
"agentNamespace": "{{.Values.bootstrap.agentNamespace}}",
},
"webhookReceiverURL": "{{.Values.webhookReceiverURL}}",
"githubURLPrefix": "{{.Values.githubURLPrefix}}"
}

View File

@ -0,0 +1,56 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: fleet-controller
spec:
selector:
matchLabels:
app: fleet-controller
template:
metadata:
labels:
app: fleet-controller
spec:
containers:
- env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.proxy }}
- name: HTTP_PROXY
value: {{ .Values.proxy }}
- name: HTTPS_PROXY
value: {{ .Values.proxy }}
- name: NO_PROXY
value: {{ .Values.noProxy }}
{{- end }}
image: '{{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}'
name: fleet-controller
imagePullPolicy: "{{ .Values.image.imagePullPolicy }}"
command:
- fleetcontroller
{{- if .Values.debug }}
- --debug
- --debug-level
- {{ quote .Values.debugLevel }}
{{- end }}
{{- if not .Values.gitops.enabled }}
- --disable-gitops
{{- end }}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
serviceAccountName: fleet-controller
nodeSelector: {{ include "linux-node-selector" . | nindent 8 }}
{{- if .Values.nodeSelector }}
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
tolerations: {{ include "linux-node-tolerations" . | nindent 8 }}
{{- if .Values.tolerations }}
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000

View File

@ -0,0 +1,112 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: fleet-controller
rules:
- apiGroups:
- gitjob.cattle.io
resources:
- '*'
verbs:
- '*'
- apiGroups:
- fleet.cattle.io
resources:
- '*'
verbs:
- '*'
- apiGroups:
- ""
resources:
- namespaces
- serviceaccounts
verbs:
- '*'
- apiGroups:
- ""
resources:
- secrets
- configmaps
verbs:
- '*'
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterroles
- clusterrolebindings
- roles
- rolebindings
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: fleet-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: fleet-controller
subjects:
- kind: ServiceAccount
name: fleet-controller
namespace: {{.Release.Namespace}}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: fleet-controller
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- '*'
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: fleet-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: fleet-controller
subjects:
- kind: ServiceAccount
name: fleet-controller
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: fleet-controller-bootstrap
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: fleet-controller-bootstrap
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: fleet-controller-bootstrap
subjects:
- kind: ServiceAccount
name: fleet-controller-bootstrap
namespace: {{.Release.Namespace}}

View File

@ -0,0 +1,10 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: fleet-controller
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: fleet-controller-bootstrap

View File

@ -0,0 +1,60 @@
image:
repository: rancher/fleet
tag: v0.4.1
imagePullPolicy: IfNotPresent
agentImage:
repository: rancher/fleet-agent
tag: v0.4.1
imagePullPolicy: IfNotPresent
# For cluster registration the public URL of the Kubernetes API server must be set here
# Example: https://example.com:6443
apiServerURL: ""
# For cluster registration the pem encoded value of the CA of the Kubernetes API server must be set here
# If left empty it is assumed this Kubernetes API TLS is signed by a well known CA.
apiServerCA: ""
# A duration string for how often agents should report a heartbeat
agentCheckinInterval: "15m"
# Whether you want to allow cluster upon registration to specify their labels.
ignoreClusterRegistrationLabels: false
# http[s] proxy server
# proxy: http://<username>@<password>:<url>:<port>
# comma separated list of domains or ip addresses that will not use the proxy
noProxy: 127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.svc,.cluster.local
bootstrap:
# The namespace that will be autocreated and the local cluster will be registered in
namespace: fleet-local
# The namespace where the fleet agent for the local cluster will be ran, if empty
# this will default to cattle-fleet-system
agentNamespace: ""
# A repo to add at install time that will deploy to the local cluster. This allows
# one to fully bootstrap fleet, it's configuration and all it's downstream clusters
# in one shot.
repo: ""
secret: ""
branch: master
paths: ""
global:
cattle:
systemDefaultRegistry: ""
## Node labels for pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## List of node taints to tolerate (requires Kubernetes >= 1.6)
tolerations: []
gitops:
enabled: true
debug: false
debugLevel: 0

View File

@ -321,6 +321,32 @@ entries:
urls:
- assets/fleet/fleet-101.0.0+up0.5.0.tgz
version: 101.0.0+up0.5.0
- annotations:
catalog.cattle.io/auto-install: fleet-crd=match
catalog.cattle.io/certified: rancher
catalog.cattle.io/experimental: "true"
catalog.cattle.io/hidden: "true"
catalog.cattle.io/kube-version: '>= 1.16.0-0 < 1.25.0-0'
catalog.cattle.io/namespace: cattle-fleet-system
catalog.cattle.io/os: linux
catalog.cattle.io/permits-os: linux,windows
catalog.cattle.io/provides-gvr: clusters.fleet.cattle.io/v1alpha1
catalog.cattle.io/rancher-version: '>= 2.6.0-0 < 2.7.0-0'
catalog.cattle.io/release-name: fleet
apiVersion: v2
appVersion: 0.4.1
created: "2023-01-06T15:15:22.126647-05:00"
dependencies:
- condition: gitops.enabled
name: gitjob
repository: file://./charts/gitjob
description: Fleet Manager - GitOps at Scale
digest: 4fa31b4ba3d2451a595a21bee0abb381c83074ca98fbe03bf338e5558d72cf0b
icon: https://charts.rancher.io/assets/logos/fleet.svg
name: fleet
urls:
- assets/fleet/fleet-100.1.1+up0.4.1.tgz
version: 100.1.1+up0.4.1
- annotations:
catalog.cattle.io/auto-install: fleet-crd=match
catalog.cattle.io/certified: rancher

View File

@ -1,86 +1,87 @@
epinio:
- 100.0.0+up1.2.1
- 101.0.0+up1.4.0
- 101.0.1+up1.4.0
- 101.0.2+up1.5.1
- 100.0.0+up1.2.1
- 101.0.0+up1.4.0
- 101.0.1+up1.4.0
- 101.0.2+up1.5.1
epinio-crd:
- 100.0.0+up1.2.1
- 101.0.0+up1.4.0
- 101.0.1+up1.4.0
- 101.0.2+up1.5.1
- 100.0.0+up1.2.1
- 101.0.0+up1.4.0
- 101.0.1+up1.4.0
- 101.0.2+up1.5.1
prometheus-federator:
- 1.1.0+up0.2.0-rc1
- 1.1.0+up0.2.0-rc1
rancher-aks-operator:
- 101.1.0+up1.0.8-rc1
- 101.1.1+up1.1.0-rc1
- 101.1.0+up1.0.8-rc1
- 101.1.1+up1.1.0-rc1
rancher-aks-operator-crd:
- 101.1.0+up1.0.8-rc1
- 101.1.1+up1.1.0-rc1
- 101.1.0+up1.0.8-rc1
- 101.1.1+up1.1.0-rc1
rancher-csp-adapter:
- 2.0.1+up2.0.1-rc1
- 2.0.1+up2.0.1-rc1
rancher-eks-operator:
- 101.1.0+up1.1.6-rc1
- 101.2.0+up1.2.0-rc2
- 101.1.0+up1.1.6-rc1
- 101.2.0+up1.2.0-rc2
rancher-eks-operator-crd:
- 101.1.0+up1.1.6-rc1
- 101.2.0+up1.2.0-rc2
- 101.1.0+up1.1.6-rc1
- 101.2.0+up1.2.0-rc2
rancher-istio:
- 101.1.0+up1.15.3
- 101.1.1+up1.15.3
- 101.1.0+up1.15.3
- 101.1.1+up1.15.3
rancher-logging-crd:
- 101.1.0+up3.17.10
- 101.1.0+up3.17.10
rancher-monitoring:
- 100.2.0+up40.1.2
- 101.1.0+up40.1.2
- 100.2.0+up40.1.2
- 101.1.0+up40.1.2
rancher-monitoring-crd:
- 100.2.0+up40.1.2
- 101.1.0+up40.1.2
- 100.2.0+up40.1.2
- 101.1.0+up40.1.2
rancher-project-monitoring:
- 1.1.0+up0.2.0-rc1
- 1.1.0+up0.2.0-rc1
rancher-vsphere-cpi:
- 101.1.0+up1.4.1
- 101.1.0+up1.4.1
rancher-vsphere-csi:
- 101.1.0+up2.6.2-rancher1
- 101.1.0+up2.6.2-rancher1
rancher-backup:
- 3.0.1-rc2
- 3.0.1-rc2
rancher-backup-crd:
- 3.0.1-rc2
- 3.0.1-rc2
rancher-cis-benchmark:
- 3.0.1-rc3
- 3.0.1-rc3
rancher-cis-benchmark-crd:
- 3.0.1-rc3
- 3.0.1-rc3
rancher-gatekeeper:
- 101.1.0+up3.10.0
- 101.1.0+up3.10.0
rancher-gatekeeper-crd:
- 101.1.0+up3.10.0
- 101.1.0+up3.10.0
rancher-logging:
- 101.1.0+up3.17.10
- 101.1.0+up3.17.10
rancher-webhook:
- 2.0.2+up0.3.2-rc7
- 2.0.2+up0.3.2-rc7
sriov:
- 101.0.2+up0.1.0
- 101.0.2+up0.1.0
sriov-crd:
- 101.0.2+up0.1.0
- 101.0.2+up0.1.0
fleet:
- 101.0.0+up0.5.0
- 101.1.0+up0.6.0-rc.1
- 101.0.0+up0.5.0
- 101.1.0+up0.6.0-rc.1
- 100.1.1+up0.4.1
fleet-agent:
- 101.0.0+up0.5.0
- 101.1.0+up0.6.0-rc.1
- 101.0.0+up0.5.0
- 101.1.0+up0.6.0-rc.1
fleet-crd:
- 101.0.0+up0.5.0
- 101.1.0+up0.6.0-rc.1
- 101.0.0+up0.5.0
- 101.1.0+up0.6.0-rc.1
rancher-gke-operator:
- 101.0.1+up1.1.5
- 101.0.1+up1.1.5
rancher-gke-operator-crd:
- 101.0.1+up1.1.5
- 101.0.1+up1.1.5
ui-plugin-operator:
- 101.0.1+up0.1.1-rc1
- 101.0.1+up0.1.1-rc1
ui-plugin-operator-crd:
- 101.0.1+up0.1.1-rc1
- 101.0.1+up0.1.1-rc1
rancher-alerting-drivers:
- 101.0.1
- 101.0.1
neuvector:
- 101.0.2+up2.4.0
- 101.0.2+up2.4.0
neuvector-crd:
- 101.0.2+up2.4.0
- 101.0.2+up2.4.0