---
# Source: gloo/templates/0-namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: gloo-system
  labels:
    app: gloo
  annotations:
    "helm.sh/hook": pre-install
---
# Source: gloo/templates/15-clusteringress-proxy-configmap.yaml

# configmap
apiVersion: v1
kind: ConfigMap
metadata:
  name: clusteringress-envoy-config
  namespace: gloo-system
  labels:
    app: gloo
    gloo: clusteringress-proxy
data:
  envoy.yaml: |
    node:
      cluster: clusteringress
      id: "{{.PodName}}.{{.PodNamespace}}"
      metadata:
        # this line must match !
        role: "{{.PodNamespace}}~clusteringress-proxy"
    static_resources:
      clusters:
      - name: xds_cluster
        connect_timeout: 5.000s
        load_assignment:
          cluster_name: xds_cluster
          endpoints:
          - lb_endpoints:
            - endpoint:
                address:
                  socket_address:
                    address: gloo
                    port_value: 9977
        http2_protocol_options: {}
        upstream_connection_options:
          tcp_keepalive: {}
        type: STRICT_DNS
    dynamic_resources:
      ads_config:
        api_type: GRPC
        grpc_services:
        - envoy_grpc: {cluster_name: xds_cluster}
      cds_config:
        ads: {}
      lds_config:
        ads: {}
    admin:
      access_log_path: /dev/null
      address:
        socket_address:
          address: 127.0.0.1
          port_value: 19000
---
# Source: gloo/templates/100-gloo-crds.yaml

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: settings.gloo.solo.io
  annotations:
    "helm.sh/hook": crd-install
  labels:
    gloo: settings
spec:
  group: gloo.solo.io
  names:
    kind: Settings
    listKind: SettingsList
    plural: settings
    shortNames:
      - st
  scope: Namespaced
  version: v1
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: gateways.gateway.solo.io
  annotations:
    "helm.sh/hook": crd-install
spec:
  group: gateway.solo.io
  names:
    kind: Gateway
    listKind: GatewayList
    plural: gateways
    shortNames:
      - gw
    singular: gateway
  scope: Namespaced
  version: v1
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: virtualservices.gateway.solo.io
  annotations:
    "helm.sh/hook": crd-install
spec:
  group: gateway.solo.io
  names:
    kind: VirtualService
    listKind: VirtualServiceList
    plural: virtualservices
    shortNames:
      - vs
    singular: virtualservice
  scope: Namespaced
  version: v1
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: proxies.gloo.solo.io
  annotations:
    "helm.sh/hook": crd-install
spec:
  group: gloo.solo.io
  names:
    kind: Proxy
    listKind: ProxyList
    plural: proxies
    shortNames:
      - px
    singular: proxy
  scope: Namespaced
  version: v1
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: upstreams.gloo.solo.io
  annotations:
    "helm.sh/hook": crd-install
spec:
  group: gloo.solo.io
  names:
    kind: Upstream
    listKind: UpstreamList
    plural: upstreams
    shortNames:
      - us
    singular: upstream
  scope: Namespaced
  version: v1
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: upstreamgroups.gloo.solo.io
  annotations:
    "helm.sh/hook": crd-install
spec:
  group: gloo.solo.io
  names:
    kind: UpstreamGroup
    listKind: UpstreamGroupList
    plural: upstreamgroups
    shortNames:
      - ug
    singular: upstreamgroup
  scope: Namespaced
  version: v1
---
---
# Source: gloo/templates/22-namespace-clusterrole-knative.yaml

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
    name: gloo-role-knative
    labels:
        app: gloo
        gloo: rbac
rules:
- apiGroups: [""]
  resources: ["pods", "services", "secrets", "endpoints", "configmaps"]
  verbs: ["*"]
- apiGroups: [""]
  resources: ["namespaces"]
  verbs: ["get", "list", "watch"]
- apiGroups: ["apiextensions.k8s.io"]
  resources: ["customresourcedefinitions"]
  verbs: ["get", "create"]
- apiGroups: ["gloo.solo.io"]
  resources: ["settings", "upstreams","upstreamgroups", "proxies","virtualservices"]
  verbs: ["*"]
- apiGroups: ["networking.internal.knative.dev"]
  resources: ["clusteringresses"]
  verbs: ["get", "list", "watch"]
- apiGroups: ["networking.internal.knative.dev"]
  resources: ["clusteringresses/status"]
  verbs: ["update"]
---
# Source: gloo/templates/25-namespace-clusterrolebinding-knative.yaml

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: gloo-role-binding-knative-gloo-system
  labels:
    app: gloo
    gloo: rbac
subjects:
- kind: ServiceAccount
  name: default
  namespace: gloo-system
roleRef:
  kind: ClusterRole
  name: gloo-role-knative
  apiGroup: rbac.authorization.k8s.io
---
# Source: gloo/templates/16-clusteringress-proxy-service.yaml

apiVersion: v1
kind: Service
metadata:
  labels:
    app: gloo
    gloo: clusteringress-proxy
  name: clusteringress-proxy
  namespace: gloo-system
spec:
  ports:
  - port: 80
    protocol: TCP
    name: http
  - port: 443
    protocol: TCP
    name: https
  selector:
    gloo: clusteringress-proxy
  type: LoadBalancer
---
# Source: gloo/templates/4-gloo-service.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    app: gloo
    gloo: gloo
  name: gloo
  namespace: gloo-system
spec:

  ports:
  - name: grpc
    port: 9977
    protocol: TCP
  selector:
    gloo: gloo

---
# Source: gloo/templates/10-ingress-deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: gloo
    gloo: ingress
  name: ingress
  namespace: gloo-system
spec:
  replicas: 1
  selector:
    matchLabels:
      gloo: ingress
  template:
    metadata:
      labels:
        gloo: ingress
    spec:
      containers:
      - image: "quay.io/solo-io/ingress:0.17.1"
        imagePullPolicy: Always
        name: ingress
        env:
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: "ENABLE_KNATIVE_INGRESS"
          value: "true"
        - name: "DISABLE_KUBE_INGRESS"
          value: "true"
---
# Source: gloo/templates/14-clusteringress-proxy-deployment.yaml


apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: gloo
    gloo: clusteringress-proxy
  name: clusteringress-proxy
  namespace: gloo-system
spec:
  replicas: 1
  selector:
    matchLabels:
      gloo: clusteringress-proxy
  template:
    metadata:
      labels:
        gloo: clusteringress-proxy
    spec:
      containers:
      - args: ["--disable-hot-restart"]
        env:
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        image: quay.io/solo-io/gloo-envoy-wrapper:0.17.1
        imagePullPolicy: Always
        name: clusteringress-proxy
        securityContext:
          readOnlyRootFilesystem: true
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - ALL
            add:
            - NET_BIND_SERVICE
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        - containerPort: 443
          name: https
          protocol: TCP
        volumeMounts:
        - mountPath: /etc/envoy
          name: envoy-config
      volumes:
      - configMap:
          name: clusteringress-envoy-config
        name: envoy-config

---
# Source: gloo/templates/3-gloo-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: gloo
    gloo: gloo
  name: gloo
  namespace: gloo-system
spec:
  replicas: 1
  selector:
    matchLabels:
      gloo: gloo
  template:
    metadata:
      labels:
        gloo: gloo
      annotations:
        prometheus.io/path: /metrics
        prometheus.io/port: "9091"
        prometheus.io/scrape: "true"
    spec:
      containers:
      - image: "quay.io/solo-io/gloo:0.17.1"
        imagePullPolicy: Always
        name: gloo
        resources:
          requests:
            cpu: 500m
            memory: 256Mi
        securityContext:
          readOnlyRootFilesystem: true
          allowPrivilegeEscalation: false
          runAsNonRoot: true
          runAsUser: 10101
          capabilities:
            drop:
            - ALL
        ports:
        - containerPort: 9977
          name: grpc
          protocol: TCP
        env:
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: START_STATS_SERVER
            value: "true"


---
# Source: gloo/templates/5-discovery-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: gloo
    gloo: discovery
  name: discovery
  namespace: gloo-system
spec:
  replicas: 1
  selector:
    matchLabels:
      gloo: discovery
  template:
    metadata:
      labels:
        gloo: discovery
      annotations:
        prometheus.io/path: /metrics
        prometheus.io/port: "9091"
        prometheus.io/scrape: "true"
    spec:
      containers:
      - image: "quay.io/solo-io/discovery:0.17.1"
        imagePullPolicy: Always
        name: discovery
        securityContext:
          readOnlyRootFilesystem: true
          allowPrivilegeEscalation: false
          runAsNonRoot: true
          runAsUser: 10101
          capabilities:
            drop:
            - ALL
        env:
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: START_STATS_SERVER
            value: "true"

---
# Source: gloo/templates/18-settings.yaml


apiVersion: gloo.solo.io/v1
kind: Settings
metadata:
  name: default
  namespace: gloo-system
  annotations:
    "helm.sh/hook": pre-install
spec:
  bindAddr: 0.0.0.0:9977
  discoveryNamespace: gloo-system
  kubernetesArtifactSource: {}
  kubernetesConfigSource: {}
  kubernetesSecretSource: {}
  refreshRate: 60s
  knative:
    clusterIngressProxyAddress: "clusteringress-proxy.gloo-system.svc.cluster.local"
  discovery:
    fdsMode: WHITELIST

---
# Source: gloo/templates/11-ingress-proxy-deployment.yaml

---
# Source: gloo/templates/12-ingress-proxy-configmap.yaml

---
# Source: gloo/templates/13-ingress-proxy-service.yaml

---
# Source: gloo/templates/20-namespace-clusterrole-gateway.yaml

---
# Source: gloo/templates/21-namespace-clusterrole-ingress.yaml

---
# Source: gloo/templates/23-namespace-clusterrolebinding-gateway.yaml

---
# Source: gloo/templates/24-namespace-clusterrolebinding-ingress.yaml

---
# Source: gloo/templates/6-gateway-deployment.yaml

---
# Source: gloo/templates/7-gateway-proxy-deployment.yaml

---
# Source: gloo/templates/8-gateway-proxy-service.yaml


---
# Source: gloo/templates/9-gateway-proxy-configmap.yaml

