Last active
June 1, 2020 13:50
-
-
Save pipoblak/8dcd3307b849689051bb31b5e41e9f4f to your computer and use it in GitHub Desktop.
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: rbac.authorization.k8s.io/v1beta1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: jenkins-rbac | |
subjects: | |
- kind: ServiceAccount | |
name: default | |
namespace: default | |
roleRef: | |
kind: ClusterRole | |
name: cluster-admin | |
apiGroup: rbac.authorization.k8s.io | |
--- | |
kind: PersistentVolume | |
apiVersion: v1 | |
metadata: | |
name: jenkins | |
labels: | |
type: local | |
spec: | |
capacity: | |
storage: 2Gi | |
accessModes: | |
- ReadWriteOnce | |
hostPath: | |
path: "/data/jenkins/" | |
selector: "jenkins-rbac" | |
--- | |
kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: jenkins-claim | |
spec: | |
accessModes: | |
- ReadWriteMany | |
resources: | |
requests: | |
storage: 2Gi | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: jenkins | |
labels: | |
app: jenkins | |
spec: | |
ports: | |
- port: 80 | |
targetPort: 8080 | |
nodePort: 32256 | |
selector: | |
app: jenkins | |
tier: jenkins | |
type: NodePort | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: jenkins | |
labels: | |
app: jenkins | |
spec: | |
strategy: | |
type: Recreate | |
template: | |
metadata: | |
labels: | |
app: jenkins | |
tier: jenkins | |
spec: | |
containers: | |
- image: cirolini/jenkins-docker-kubectl | |
name: jenkins | |
securityContext: | |
privileged: true | |
ports: | |
- containerPort: 8080 | |
name: jenkins | |
volumeMounts: | |
- name: jenkins-persistent-storage | |
mountPath: /var/jenkins_home | |
- name: docker | |
mountPath: /var/run/docker.sock | |
volumes: | |
- name: docker | |
hostPath: | |
path: /var/run/docker.sock | |
- name: jenkins-persistent-storage | |
persistentVolumeClaim: | |
claimName: jenkins-claim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment