Last active
January 24, 2017 07:11
-
-
Save moondev/29e6541177939cc92584ad286a121a80 to your computer and use it in GitHub Desktop.
k8s hostpath pv
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
--- | |
kind: PersistentVolume | |
apiVersion: v1 | |
metadata: | |
name: pvjenkins | |
labels: | |
type: local | |
spec: | |
capacity: | |
storage: 3Gi | |
accessModes: | |
- ReadWriteOnce | |
hostPath: | |
path: "/var/jenkins_home" | |
--- | |
kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: jenkinsclaim-2 | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 3Gi | |
--- | |
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: jenkins | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: jenkins | |
spec: | |
containers: | |
- name: jenkins | |
image: jenkins:latest | |
ports: | |
- containerPort: 8080 | |
protocol: TCP | |
volumeMounts: | |
- mountPath: "/var/jenkins_home" | |
name: jenkins | |
- name: docker-sock | |
mountPath: "/var/run/docker.sock" | |
nodeSelector: | |
kubernetes.io/hostname: 192.168.1.50 | |
volumes: | |
- name: jenkins | |
persistentVolumeClaim: | |
claimName: jenkinsclaim-2 | |
- name: docker-sock | |
hostPath: | |
path: /var/run/docker.sock | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: jenkins-service | |
spec: | |
type: NodePort | |
ports: | |
- port: 80 | |
targetPort: 8080 | |
protocol: TCP | |
selector: | |
app: jenkins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment