Last active
August 12, 2019 19:36
-
-
Save judavi/92410bebe2e0ba3d7f162da9f6e6aea5 to your computer and use it in GitHub Desktop.
Jenkins EKS
This file contains hidden or 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
kubectl exec -it my-app-c456bf7c5-tl6cf -- cat /var/jenkins_home/secrets/initialAdminPassword | |
docker run jenkins/jnlp-slave -url http://jenkins-server:port <secret> <agent name> | |
kubectl run my-app --image=jenkins/jenkins:lts --port=8080 --port=50000 | |
http://137.135.245.74:8080/pluginManager/ | |
docker run jenkins/jnlp-slave -url http://ip:50000 115b5fa1adf62168b2e0212819027f621b test | |
Agent key : sasas | |
kubectl run agent --image=jenkins/jnlp-slave | |
/var/jenkins_home/secrets/initialAdminPassword : admin pass | |
This file contains hidden or 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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
labels: | |
run: my-app | |
name: my-app | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
run: my-app | |
strategy: | |
rollingUpdate: | |
maxSurge: 25% | |
maxUnavailable: 25% | |
type: RollingUpdate | |
template: | |
metadata: | |
creationTimestamp: null | |
labels: | |
run: my-app | |
spec: | |
containers: | |
- image: jenkins/jenkins:lts | |
imagePullPolicy: always | |
name: my-app | |
ports: | |
- containerPort: 50000 | |
protocol: TCP | |
dnsPolicy: ClusterFirst | |
restartPolicy: Always | |
schedulerName: default-scheduler | |
securityContext: {} | |
terminationGracePeriodSeconds: 30 | |
status: |
This file contains hidden or 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
run: my-app | |
name: my-app | |
namespace: default | |
spec: | |
externalTrafficPolicy: Cluster | |
ports: | |
- nodePort: 31720 | |
port: 8080 | |
protocol: TCP | |
targetPort: 8080 | |
name: master | |
- name: slaves | |
protocol: TCP | |
port: 50000 | |
targetPort: 50000 | |
selector: | |
run: my-app | |
sessionAffinity: None | |
type: LoadBalancer |
This file contains hidden or 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
{ | |
"name": "NODENAME", | |
"nodeDescription": "", | |
"numExecutors": "1", | |
"remoteFS": "/", | |
"labelString": "", | |
"mode": "NORMAL", | |
"": [ | |
"hudson.slaves.JNLPLauncher", | |
"hudson.slaves.RetentionStrategy$Always" | |
], | |
"launcher": { | |
"stapler-class": "hudson.slaves.JNLPLauncher", | |
"$class": "hudson.slaves.JNLPLauncher", | |
"workDirSettings": { | |
"disabled": false, | |
"workDirPath": "", | |
"internalDir": "remoting", | |
"failIfWorkDirIsMissing": false | |
}, | |
"tunnel": "", | |
"vmargs": "" | |
}, | |
"retentionStrategy": { | |
"stapler-class": "hudson.slaves.RetentionStrategy$Always", | |
"$class": "hudson.slaves.RetentionStrategy$Always" | |
}, | |
"nodeProperties": { | |
"stapler-class-bag": "true" | |
}, | |
"type": "hudson.slaves.DumbSlave" | |
} |
This file contains hidden or 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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
labels: | |
run: pod | |
name: pod | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
run: pod | |
strategy: | |
rollingUpdate: | |
maxSurge: 25% | |
maxUnavailable: 25% | |
type: RollingUpdate | |
template: | |
metadata: | |
creationTimestamp: null | |
labels: | |
run: pod | |
spec: | |
containers: | |
- image: jenkins/jnlp-slave | |
imagePullPolicy: Always | |
name: pod | |
args: ["-url","http://ip:8080","TOKEN", "test"] | |
dnsPolicy: ClusterFirst | |
restartPolicy: Always | |
schedulerName: default-scheduler | |
securityContext: {} | |
terminationGracePeriodSeconds: 30 | |
status: |
This file contains hidden or 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
# Needs to call | |
sed -i 's/NODENAME/$1/g' nodeTemplate.json | |
KEY = $(curl -L -s -u admin:pass -X GET http://ip:8080/computer/test2/slave-agent.jnlp | sed "s/.*<application-desc main-class=\"hudson.remoting.jnlp.Main\"><argument>\([a-z0-9]*\).*/\1/") | |
echo $KEY | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment