Last active
          September 5, 2022 06:08 
        
      - 
      
 - 
        
Save pre/2ca8e121a4b6330cd2cae92def3566b1 to your computer and use it in GitHub Desktop.  
    k8s nginx hello world manifest
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | --- | |
| apiVersion: v1 | |
| kind: Namespace | |
| metadata: | |
| name: hello-1 | |
| --- | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: hello-1 | |
| namespace: hello-1 | |
| spec: | |
| type: ClusterIP | |
| ports: | |
| - port: 80 | |
| targetPort: http | |
| protocol: TCP | |
| name: http | |
| selector: | |
| app: hello-1 | |
| --- | |
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: example-content | |
| namespace: hello-1 | |
| data: | |
| index.html: | | |
| hello-1 | |
| --- | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| labels: | |
| app: hello-1 | |
| name: hello-1 | |
| namespace: hello-1 | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: hello-1 | |
| template: | |
| metadata: | |
| labels: | |
| app: hello-1 | |
| spec: | |
| containers: | |
| - image: nginx:latest | |
| name: nginx | |
| ports: | |
| - name: http | |
| containerPort: 80 | |
| volumeMounts: | |
| - name: example-content | |
| mountPath: /usr/share/nginx/html/index.html | |
| subPath: index.html | |
| - name: example-content | |
| mountPath: /usr/share/nginx/html/hello-1.html | |
| subPath: hello-1.html | |
| volumes: | |
| - name: example-content | |
| configMap: | |
| name: example-content | |
| --- | |
| apiVersion: networking.istio.io/v1beta1 | |
| kind: VirtualService | |
| metadata: | |
| name: nginx | |
| namespace: hello-1 | |
| spec: | |
| gateways: | |
| - istio-system/default-gateway | |
| hosts: | |
| - '*.example.com' | |
| http: | |
| - match: | |
| - uri: | |
| prefix: / | |
| route: | |
| - destination: | |
| host: hello-1 | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment