Skip to content

Instantly share code, notes, and snippets.

@Hounddog
Created September 29, 2015 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hounddog/c24045af0e8421adf62a to your computer and use it in GitHub Desktop.
Save Hounddog/c24045af0e8421adf62a to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx-frontend
labels:
name: nginx-frontend
spec:
replicas: 1
selector:
name: nginx-frontend
template:
metadata:
labels:
name: nginx-frontend
spec:
containers:
-
name: nginx-frontend
image: elephone/nginx
ports:
- containerPort: 80
volumeMounts:
-
name: "certifications"
mountPath: "/etc/nginx/certs"
readOnly: true
- name: sites-enabled
mountPath: "/etc/nginx/sites-enabled"
readonly: true
volumes:
-
name: "certifications"
secret:
secretName: "ssl-certificates-elephone"
-
name: sites-enabled
persistentVolumeClaim:
claimName: sites-enabled
ubuntu@ip-172-20-0-204:~/nginx/sites-enabled$ ls /home/ubuntu/nginx/sites-enabled/
elephone-nl.conf
martin@martin-ubuntu:~/Work/kubernetes/elephone$ kubectl exec -p nginx-frontend-325na -i -t -- bash -il
W0929 17:27:58.931926 23742 cmd.go:161] -p POD is DEPRECATED and will be removed in a future version. Use exec POD instead.
root@nginx-frontend-325na:/# ls /etc/nginx/sites-enabled/
root@nginx-frontend-325na:/# ls /etc/nginx/certs/
elephone-nl-crt elephone-nl-key
kind: PersistentVolume
apiVersion: v1
metadata:
name: sites-enabled
labels:
type: local
spec:
capacity:
storage: 10Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/home/ubuntu/nginx/sites-enabled"
apiVersion: v1
kind: Secret
metadata:
name: ssl-certificates-elephone
type: Opaque
data:
elephone-nl-key: "xyz"
elephone-nl-crt: "xyz"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment