Skip to content

Commit

Permalink
Merge pull request #2207 from ks-ci-bot/cherry-pick-2206-to-release-3.4
Browse files Browse the repository at this point in the history
[release-3.4] upgrade devops to 3.4.0
  • Loading branch information
pixiake committed Jul 5, 2023
2 parents 9554583 + 46fa9a7 commit 6e327a5
Show file tree
Hide file tree
Showing 15 changed files with 302 additions and 577 deletions.
8 changes: 8 additions & 0 deletions controller/installRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,14 @@ def generate_new_cluster_configuration(api):

del cluster_configuration_spec["kubeedge"]

if "devops" in cluster_configuration_spec and "enabled" in cluster_configuration_spec["devops"] and cluster_configuration_spec["devops"]["enabled"]:
if "jenkinsCpuReq" not in cluster_configuration_spec["devops"]:
upgrade_flag = True
cluster_configuration_spec["devops"]["jenkinsCpuReq"] = 0.5
if "jenkinsCpuLim" not in cluster_configuration_spec["devops"]:
upgrade_flag = True
cluster_configuration_spec["devops"]["jenkinsCpuLim"] = 4

if isinstance(cluster_configuration_status,
dict) and "core" in cluster_configuration_status:
if ("version" in cluster_configuration_status["core"] and cluster_configuration_status["core"]["version"] !=
Expand Down
16 changes: 6 additions & 10 deletions deploy/cluster-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,12 @@ spec:
# webhook:
# resources: {}
devops: # (CPU: 0.47 Core, Memory: 8.6 G) Provide an out-of-the-box CI/CD system based on Jenkins, and automated workflow tools including Source-to-Image & Binary-to-Image.
enabled: false # Enable or disable the KubeSphere DevOps System.
ci:
enabled: false # Enable ci
cd:
enabled: false # Enable cd
type: argocd # Choose cd core, although only argocd is supported.
# resources: {}
jenkinsMemoryLim: 4Gi # Jenkins memory limit.
jenkinsMemoryReq: 2Gi # Jenkins memory request.
jenkinsVolumeSize: 8Gi # Jenkins volume size.
enabled: false # Enable or disable the KubeSphere DevOps System.
jenkinsCpuReq: 0.5
jenkinsCpuLim: 1
jenkinsMemoryReq: 4Gi
jenkinsMemoryLim: 4Gi # Recommend keep same as requests.memory.
jenkinsVolumeSize: 16Gi
events: # Provide a graphical web console for Kubernetes Events exporting, filtering and alerting in multi-tenant Kubernetes clusters.
enabled: false # Enable or disable the KubeSphere Events System.
# operator:
Expand Down
4 changes: 2 additions & 2 deletions playbooks/devops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
roles:
- kubesphere-defaults
- role: ks-devops
# when:
# - "status.devops is not defined or status.devops.status is not defined or status.devops.status != 'enabled'"
when:
- "status.devops is not defined or status.devops.status is not defined or status.devops.status != 'enabled'"
# - { role: ks-core, when: sonar_health is defined and sonar_health == true }
2 changes: 1 addition & 1 deletion roles/download/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ ks_devops_tools_tag: "ks-{{ ks_version }}"

#jenkins:
jenkins_repo: "{{ base_repo }}{{ namespace_override | default('kubespheredev') }}/ks-jenkins"
jenkins_tag: v3.3.0-2.319.1
jenkins_tag: v3.4.0-2.319.3
jnlp_slave_repo: "{{ base_repo }}{{ namespace_override | default('jenkins') }}/inbound-agent"
jnlp_slave_tag: 4.10-2

Expand Down
15 changes: 15 additions & 0 deletions roles/ks-core/prepare/files/ks-init/role-templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,19 @@ rules:
- clustertemplates/render
verbs:
- create
- apiGroups:
- devops.kubesphere.io
resources:
- clustersteptemplates
verbs:
- list
- get
- apiGroups:
- devops.kubesphere.io
resources:
- clustersteptemplates/render
verbs:
- create
- apiGroups:
- gitops.kubesphere.io
resources:
Expand Down Expand Up @@ -3194,6 +3207,8 @@ role:
- 'pipelines/sonarstatus'
- 'clustertemplates'
- 'clustertemplates/render'
- 'clustersteptemplates'
- 'clustersteptemplates/render'
verbs:
- '*'

Expand Down
2 changes: 0 additions & 2 deletions roles/ks-devops/OWNERS
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
approvers:
- chilianyi
- yudong2015
- zhbinary
reviewers:
- chilianyi
- yudong2015
- zhbinary
27 changes: 4 additions & 23 deletions roles/ks-devops/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
---
devops:
jenkinsVolumeSize: "8Gi"
jenkinsVolumeSize: "16Gi"
jenkinsMemoryLim: "{{ jenkins_memory_lim |default('4Gi') }}"
jenkinsMemoryReq: "{{ jenkins_memory_req |default('2Gi') }}"
jenkinsMemoryReq: "{{ jenkins_memory_req |default('4Gi') }}"
jenkinsCpuReq: "{{ jenkins_cpu_req |default('0.5') }}"
jenkinsCpuLim: "{{ jenkins_cpu_lim |default('1') }}"

JavaOpts: >
-XX:MaxRAMPercentage=80 -XX:MinRAMPercentage=60
-Dhudson.slaves.NodeProvisioner.initialDelay=20
-Dhudson.slaves.NodeProvisioner.MARGIN=50
-Dhudson.slaves.NodeProvisioner.MARGIN0=0.85
-Dhudson.model.LoadStatistics.clock=5000
-Dhudson.model.LoadStatistics.decay=0.2
-Dhudson.slaves.NodeProvisioner.recurrencePeriod=5000
-Dhudson.security.csrf.DefaultCrumbIssuer.EXCLUDE_SESSION_ID=true
-Dio.jenkins.plugins.casc.ConfigurationAsCode.initialDelay=10000
-Djenkins.install.runSetupWizard=false
-XX:+AlwaysPreTouch
-XX:+HeapDumpOnOutOfMemoryError
-XX:+UseG1GC
-XX:+UseStringDeduplication
-XX:+ParallelRefProcEnabled
-XX:+DisableExplicitGC
-XX:+UnlockDiagnosticVMOptions
-XX:+UnlockExperimentalVMOptions
JenkinsLocationUrl: jenkins.devops.kubesphere.local

EMAIL_SMTP_HOST: mail.example.com
EMAIL_FROM_ADDR: admin@example.com
Expand Down
Binary file not shown.
Binary file not shown.
31 changes: 0 additions & 31 deletions roles/ks-devops/tasks/cd.yaml

This file was deleted.

229 changes: 0 additions & 229 deletions roles/ks-devops/tasks/ci.yaml

This file was deleted.

0 comments on commit 6e327a5

Please sign in to comment.