Skip to content

Latest commit

 

History

History
71 lines (61 loc) · 1.48 KB

yamlfiles.md

File metadata and controls

71 lines (61 loc) · 1.48 KB

Kubernetes yaml file deployments

YAML file definition

https://kubernetes.io/docs/user-guide/walkthrough/

The simplest pod definition describes the deployment of a single container. For example, an nginx web server pod might be defined as such:

apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - name: nginx
    image: nginx:latest
    ports:
    - containerPort: 80

liveness probes and variables

https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/

Ensure that health checks are performed against your instance

apiVersion: v1
kind: Pod
metadata:
  name: nginx
  #namespace: default
spec:
  containers:
  - name: nginx
    image: nginx:latest
    ports:
    - containerPort: 80
    env:       
      - name: "SOMEVARIABLE"
        value: "somevalue"
    livenessProbe:
      httpGet:
        path: /
        port: 80
      initialDelaySeconds: 15
      timeoutSeconds: 1

Referencing images from your own registry

To reference an image from your own registry you need to reference a credential for the cluster to login. Check the hint about secrets: here 📘

apiVersion: "v1"
kind: Pod
metadata:
  name: somePodName
  labels:
    name: someLabelName
spec:
  containers:
    - name: blue
      image: someRegistryOnAzure.azurecr.io/someImage:latest
      ports:
        - containerPort: 80
          name: http
          protocol: TCP 
  imagePullSecrets:
    - name: nameOfYourSecret