-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π Created a chart for Jenkins deployment (#1)
* π Created a chart for Jenkins deployment * π Update deployment config and values π * π¨πΌβπ€updated for new lineπ¨πΌβπ€ * π add status as per pr Co-authored-by: Cansu Kavili <[email protected]>
- Loading branch information
Showing
12 changed files
with
309 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# General files for the project | ||
pkg/* | ||
*.pyc | ||
bin/* | ||
.project | ||
/.bin | ||
/_test/secrets/*.json | ||
|
||
# OSX leaves these everywhere on SMB shares | ||
._* | ||
|
||
# OSX trash | ||
.DS_Store | ||
|
||
# Files generated by JetBrains IDEs, e.g. IntelliJ IDEA | ||
.idea/ | ||
*.iml | ||
|
||
# Vscode files | ||
.vscode | ||
|
||
# Emacs save files | ||
*~ | ||
\#*\# | ||
.\#* | ||
|
||
# Vim-related files | ||
[._]*.s[a-w][a-z] | ||
[._]s[a-w][a-z] | ||
*.un~ | ||
Session.vim | ||
.netrwhist | ||
|
||
# Chart dependencies | ||
**/charts/*.tgz | ||
|
||
.history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
ci/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
appVersion: "v0.0.1" | ||
description: A Helm chart for deploying Jenkins on OpenShift | ||
name: jenkins | ||
version: 0.0.1 | ||
home: https://github.com/rht-labs/charts | ||
maintainers: | ||
- name: springdo | ||
- name: ckavili |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{{- if .Values.deployment }} | ||
--- | ||
apiVersion: apps.openshift.io/v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
annotations: | ||
template.alpha.openshift.io/wait-for-ready: "true" | ||
name: {{ .Values.appName }} | ||
labels: | ||
app: {{ .Values.appName }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
name: {{ .Values.appName }} | ||
strategy: {{- if .Values.persistence.enabled }} | ||
type: Recreate | ||
{{ else }} | ||
type: Rolling | ||
{{- end }} | ||
template: | ||
metadata: | ||
labels: | ||
name: {{ .Values.appName }} | ||
spec: | ||
containers: | ||
- name: {{ .Values.appName }} | ||
env: {{ if .Values.deployment.openshiftauth }} | ||
- name: OPENSHIFT_ENABLE_OAUTH | ||
value: "true" | ||
- name: OPENSHIFT_ENABLE_REDIRECT_PROMPT | ||
value: "true" | ||
{{- end }} | ||
- name: KUBERNETES_MASTER | ||
value: https://kubernetes.default:443 | ||
- name: KUBERNETES_TRUST_CERTIFICATES | ||
value: "true" | ||
- name: JENKINS_SERVICE_NAME | ||
value: {{ .Values.appName }} | ||
- name: JNLP_SERVICE_NAME | ||
value: {{ .Values.appName }}-jnlp | ||
{{- range $key := .Values.deployment.env_vars }} | ||
- name: {{ .name }} | ||
value: {{ .value | quote }} | ||
{{- end }} | ||
image: ' ' | ||
imagePullPolicy: IfNotPresent | ||
livenessProbe: | ||
failureThreshold: 2 | ||
httpGet: | ||
path: /login | ||
port: 8080 | ||
initialDelaySeconds: 420 | ||
periodSeconds: 360 | ||
timeoutSeconds: 240 | ||
readinessProbe: | ||
httpGet: | ||
path: /login | ||
port: 8080 | ||
initialDelaySeconds: 3 | ||
timeoutSeconds: 240 | ||
resources: | ||
requests: | ||
cpu: {{ .Values.deployment.limits.cpu_request | quote }} | ||
memory: {{ .Values.deployment.limits.memory_request | quote }} | ||
limits: | ||
cpu: {{ .Values.deployment.limits.cpu_limit | quote }} | ||
memory: {{ .Values.deployment.limits.memory_request | quote }} | ||
securityContext: | ||
capabilities: {} | ||
privileged: false | ||
terminationMessagePath: /dev/termination-log | ||
{{- if .Values.persistence.enabled }} | ||
volumeMounts: | ||
- mountPath: /var/lib/jenkins | ||
name: {{ .Values.appName }}-data {{ end }} | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
serviceAccountName: {{ .Values.appName }} | ||
{{- if .Values.persistence.enabled }} | ||
volumes: | ||
- name: {{ .Values.appName }}-data | ||
persistentVolumeClaim: | ||
claimName: {{ .Values.appName }} | ||
{{- end }} | ||
triggers: | ||
- imageChangeParams: | ||
automatic: true | ||
containerNames: | ||
- {{ .Values.appName }} | ||
from: | ||
kind: ImageStreamTag | ||
name: {{ .Values.deployment.imagestream.name}}:{{ .Values.deployment.imagestream.tag}} | ||
namespace: {{ .Values.deployment.imagestream.namespace}} | ||
lastTriggeredImage: "" | ||
type: ImageChange | ||
- type: ConfigChange | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- if .Values.persistence.enabled }} | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ .Values.appName }} | ||
spec: | ||
accessModes: | ||
- {{ .Values.persistence.accessModes }} | ||
resources: | ||
requests: | ||
storage: {{ .Values.persistence.volumeSize }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ .Values.appName }}_edit | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: edit | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ .Values.appName }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- if .Values.route }} | ||
--- | ||
apiVersion: v1 | ||
kind: Route | ||
metadata: | ||
annotations: | ||
haproxy.router.openshift.io/timeout: 4m | ||
template.openshift.io/expose-uri: http://{.spec.host}{.spec.path} | ||
name: {{ .Values.appName }} | ||
spec: | ||
tls: | ||
insecureEdgeTerminationPolicy: Redirect | ||
termination: edge | ||
to: | ||
kind: Service | ||
name: {{ .Values.appName }} | ||
status: | ||
ingress: [] | ||
{{ end }} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
annotations: | ||
serviceaccounts.openshift.io/oauth-redirectreference.jenkins: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"{{ .Values.appName }}"}}' | ||
name: {{ .Values.appName }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{{- if .Values.services }} | ||
{{- range $key := .Values.services }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
{{- if .annotations }} | ||
annotations: | ||
service.alpha.openshift.io/dependencies: '[{"name": "jenkins-jnlp", "namespace":"", "kind": "Service"}]' {{ end }} | ||
name: {{ .name }} | ||
spec: | ||
ports: | ||
- name: {{ .port_name }} | ||
nodePort: 0 | ||
port: {{ .port }} | ||
protocol: TCP | ||
targetPort: {{ .target_port }} | ||
selector: | ||
name: {{ .selector }} | ||
sessionAffinity: None | ||
type: ClusterIP | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
appName: &name jenkins | ||
|
||
route: true | ||
|
||
deployment: | ||
openshiftauth: true | ||
imagestream: | ||
name: jenkins | ||
tag: latest | ||
namespace: openshift | ||
limits: | ||
memory_request: 2Gi | ||
memory_limit: 6Gi | ||
cpu_request: 500m | ||
cpu_limit: 1 | ||
env_vars: | ||
- name: JVM_ARCH | ||
value: "x86_64" | ||
- name: DISABLE_ADMINISTRATIVE_MONITORS | ||
value: "false" | ||
- name: ENABLE_FATAL_ERROR_LOG_FILE | ||
value: "false" | ||
- name: JENKINS_OPTS | ||
value: "--sessionTimeout=0" | ||
- name: SLACK_BASE_URL | ||
value: "" | ||
- name: SLACK_ROOM | ||
value: "" | ||
- name: SLACK_TOKEN_CREDENTIAL_ID | ||
value: "" | ||
- name: SLACK_TEAM | ||
value: "" | ||
- name: SHARED_LIB_REPO | ||
value: "" | ||
- name: SHARED_LIB_NAME | ||
value: "" | ||
- name: SHARED_LIB_REF | ||
value: "" | ||
- name: SHARED_LIB_SECRET | ||
value: "" | ||
- name: GITLAB_HOST | ||
value: "" | ||
- name: GITLAB_TOKEN | ||
value: "" | ||
- name: GITLAB_GROUP_NAME | ||
value: rht-labs | ||
|
||
persistence: | ||
enabled: true | ||
accessModes: ReadWriteOnce | ||
volumeSize: 20Gi | ||
|
||
services: | ||
- name: *name | ||
port_name: web | ||
port: 80 | ||
target_port: 8080 | ||
selector: *name | ||
annotations: service.alpha.openshift.io/dependencies | ||
- name: jenkins-jnlp | ||
port_name: agent | ||
port: 50000 | ||
target_port: 5000 | ||
selector: *name |