# This is the schema for the website controller ???

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: websites.extensions.example.com
  labels:
    type: CRD
spec:
  group: example.com
  scope: Namespaced # Cluster or Namespaced
  # RESTful API endpoint is created:
  # /apis/extensions.example.com/v1/namespaces/chp18-set1812/website
  group: extensions.example.com

  names:
    kind: Website
    singular: website
    # plural name in URL: /apis/<group>/<version>/<plural>
    # /apis/extensions.example.com/v1/websites
    plural: websites

  versions:
  - name: v1
    served: true
    storage: true
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            properties:
              image:
                type: string
              gitRepo:
                type: string
              serviceAccountName:
                type: string
              containers:
                type: object
                properties:
                  imagePullPolicy:
                    type: string
                  securityContext:
                    type: object
                    properties:
                      allowPrivilegeEscalation:
                        type: boolean
                      privileged:
                        type: boolean
                      runAsNonRoot:
                        type: boolean
                      runAsUser:
                        type: integer
                  resources:
                    type: object
                    properties:
                      requests:
                        type: object
                        properties:
                          memory:
                            type: string
                      limits:
                        type: object
                        properties:
                          memory:
                            type: string
                   

