https://www.jenkins.io/doc/book/installing/kubernetes/
jenkins: 10.11.168.251
jenkins-agent: 10.11.168.252
k create namespace jenkins
helm -n jenkins delete jenkins
k delete -f jenkins-persistent-volume.yaml
k create -f jenkins-persistent-volume.yaml
helm install jenkins -n jenkins -f jenkins-values.yaml jenkinsci/jenkins
finally got it workig
http://10.11.168.251
printf $(kubectl get secret –namespace jenkins jenkins -o jsonpath=”{.data.jenkins-admin-password}” | base64 –decode);echo
export POD_NAME=$(kubectl get pods –namespace jenkins -l “app.kubernetes.io/component=jenkins-master” -l “app.kubernetes.io/instance=jenkins” -o jsonpath=”{.items[0].metadata.name}”)
get pods –namespace jenkins -l “app.kubernetes.io/component=jenkins-master” -l “app.kubernetes.io/instance=jenkins” -o jsonpath=”{.items[0].metadata.name}”)
both worked:
lynx http://10.166.32.242:8080/login
lynx http://10.105.174.214:8080/login
want this to work:
lynx http://10.11.169.251/login
we need to create a load balancer with an annotation to match the jenkins pod
helm -n jenkins delete jenkins
k delete -f jenkins-persistent-volume.yaml
k create -f jenkins-persistent-volume.yaml
helm install jenkins -n jenkins -f jenkins-values.yaml jenkinsci/jenkins
k delete -f jenkins-service-ui.yaml
k apply -f jenkins-service-ui.yaml
apiVersion: v1
kind: Service
metadata:
annotations:
meta.helm.sh/release-name: jenkins
meta.helm.sh/release-namespace: jenkins
creationTimestamp: “2020-12-24T09:29:19Z”
labels:
app.kubernetes.io/component: jenkins-controller
app.kubernetes.io/instance: jenkins
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: jenkins
helm.sh/chart: jenkins-3.0.10
managedFields:
– apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:meta.helm.sh/release-name: {}
f:meta.helm.sh/release-namespace: {}
f:labels:
.: {}
f:app.kubernetes.io/component: {}
f:app.kubernetes.io/instance: {}
f:app.kubernetes.io/managed-by: {}
f:app.kubernetes.io/name: {}
f:helm.sh/chart: {}
f:spec:
f:externalTrafficPolicy: {}
f:loadBalancerSourceRanges: {}
f:ports:
.: {}
k:{“port”:8080,”protocol”:”TCP”}:
.: {}
f:name: {}
f:port: {}
f:protocol: {}
f:targetPort: {}
f:selector:
.: {}
f:app.kubernetes.io/component: {}
f:app.kubernetes.io/instance: {}
f:sessionAffinity: {}
f:type: {}
manager: Go-http-client
operation: Update
time: “2020-12-24T09:29:19Z”
– apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:status:
f:loadBalancer:
f:ingress: {}
manager: dashboard
operation: Update
time: “2020-12-24T09:36:25Z”
name: jenkins
namespace: jenkins
resourceVersion: “12280462”
selfLink: /api/v1/namespaces/jenkins/services/jenkins
uid: ed82c7e0-69ac-4337-a532-2864273e6068
spec:
clusterIP: 10.98.252.119
externalTrafficPolicy: Cluster
loadBalancerSourceRanges:
– 0.0.0.0/0
ports:
– name: http
nodePort: 30362
port: 80
protocol: TCP
targetPort: 8080
selector:
app.kubernetes.io/component: jenkins-controller
app.kubernetes.io/instance: jenkins
sessionAffinity: None
type: LoadBalancer
loadBalancerIP: 10.11.168.251