Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Firstly, create a file named nginx-app.yaml to describe a Pod and service by:

Code Block
languagebash
   $ cat <<EOF >~/nginx-app.yaml
   apiVersion: v1
   kind: Service
 
 metadata:
   
  name: nginx
      labels:
        app: nginx
   spec:
 
    type: NodePort
      ports:
 
    - port: 80
        protocol: TCP
  
     name: http
   
  selector:
  
     app: nginx
   ---
   apiVersion: v1
  
kind: ReplicationController
  
metadata:
      name: nginx
   spec:

     replicas: 2
 
    template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        #image: arm64v8/nginx:stable
        image: nginx
        ports:
        - containerPort: 80
  
EOF

then test the Kubernetes working status with the script:

...