Skip to content

Instantly share code, notes, and snippets.

@dorako321
Last active March 16, 2019 06:19
Show Gist options
  • Save dorako321/41643f1ccf3ae4a231d9e969c1abef26 to your computer and use it in GitHub Desktop.
Save dorako321/41643f1ccf3ae4a231d9e969c1abef26 to your computer and use it in GitHub Desktop.

hello-kube-pod.yaml

apiVersion: v1
kind: Pod
metadata:
  name: hello-kube-pod
  namespace: default
spec:
  containers:
    - name: hello-kube
      image: dorako321/hello-kube
      ports:
        - containerPort: 8080

hello-kube-deployment.yaml

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: hello-kube-deployment
  namespace: default
spec:
  replicas: 3
  template:
    metadata:
      labels:
        app: hello-kube-pod
    spec:
      containers:
      - name: hello-kube
        image: dorako321/hello-kube
        ports:
          - containerPort: 8080

hello-kube-service.yaml

apiVersion: v1
kind: Service
metadata:
  name: hello-kube-service
  namespace: default
spec:
  ports:
    - port: 8080
      protocol: TCP
      tartgetPort: 8080
  selector:
    app: hello-kube-pod
  type: ClusterIP

hello-kube-ingress.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: hello-kube-ingress
  namespace: default
spec:
  rules:
    - host: hello-kube.localhost
      http:
        paths:
          - backend:
              serviceName: hello-kube-service
              servicePort: 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment