def manifests(self) -> str:
        return namespace_manifest('same-mapping-1') + \
            namespace_manifest('same-mapping-2') + \
            self.format('''
---
apiVersion: getambassador.io/v2
kind: Mapping
metadata:
  name: {self.target.path.k8s}
  namespace: same-mapping-1
spec:
  ambassador_id: {self.ambassador_id}
  prefix: /{self.name}-1/
  service: {self.target.path.fqdn}.default
---
apiVersion: getambassador.io/v2
kind: Mapping
metadata:
  name: {self.target.path.k8s}
  namespace: same-mapping-2
spec:
  ambassador_id: {self.ambassador_id}
  prefix: /{self.name}-2/
  service: {self.target.path.fqdn}.default
''') + super().manifests()
    def manifests(self) -> str:
        return namespace_manifest("tcp-namespace") + namespace_manifest("other-namespace") + f"""
---
apiVersion: v1
kind: Secret
metadata:
  name: supersecret
type: kubernetes.io/tls
data:
  tls.crt: {TLSCerts["tls-context-host-2"].k8s_crt}
  tls.key: {TLSCerts["tls-context-host-2"].k8s_key}
""" + super().manifests()
Beispiel #3
0
    def manifests(self) -> str:
        return namespace_manifest("same-ingress-1") + """
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: ambassador
    getambassador.io/ambassador-id: {self.ambassador_id}
  name: {self.name.k8s}
  namespace: same-ingress-1
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: {self.target.path.k8s}-target1
          servicePort: 80
        path: /{self.name}-target1/
""" + namespace_manifest("same-ingress-2") + """
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: ambassador
    getambassador.io/ambassador-id: {self.ambassador_id}
  name: {self.name.k8s}
  namespace: same-ingress-2
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: {self.target.path.k8s}-target2
          servicePort: 80
        path: /{self.name}-target2/
""" + super().manifests()
Beispiel #4
0
    def manifests(self) -> str:
        return namespace_manifest("secret-namespace") + """
---
apiVersion: v1
data:
  cert-chain.pem: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURJVENDQWdtZ0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ZVFYSTVrSU0vdWgxL2wwN3pKClU3eG8zSmVZbHpMZnJSVWhNRnc1Vk5ETkNCY3JldEoyOWgvZzRpS1plM2JDS3laVmJRUkN3VjR5ck12YTA4Z3kKYzRhSGJud1VtRThKT0JvcE5abW1uOHc0bFcwQjFsS1Q3aFhBRldJdW55WVhIOWFabUJJd1pPVk9kV0N4SmZnTQpKSWY1UVJSY0s5MVZGMjYvcUp2RHlwaVpxcHFJcEdQWHJHbHF2dGtTSmwxdHhYMENBd0VBQWFNak1DRXdEZ1lEClZSMFBBUUgvQkFRREFnSUVNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUIKQUpjWXl3WkoxeUZpQzRpT0xNbXY4MTZYZEhUSWdRTGlLaXNBdGRqb21TdXhLc0o1eXZ3M2lGdkROSklseEQ4SgoyVVROR2JJTFN2d29qQ1JzQVcyMlJtelpjZG95SXkvcFVIR25EVUpiMk14T0svaEVWU0x4cnN6RHlEK2YwR1liCjdhL1Q2ZmJFbUdYK0JHTnBKZ2lTKytwUm5JMzE3THN6aldtTUlmbVF3T1NtZXNvKzhMSXAxZS9STGVKcThoM0cKREZzcVA4c1BLaHNEM1M1RWNGYU5vSVg4OThVK3UvUWlKd3BoS2lDK3RRRzExeGJZanMxaURNcFJpUGsvSi9NRwpiaTZnQm8zZGdjZ1RWWFdOY2YzeHRiQWErMmkzK3k1V25ydHoyK1d4ZG96cEhpN3FLL1BEbGpwVG5JdkY2Nm0wCjBFYVA0T3ZOY29hNk12MUpoYkFVK0w0PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
kind: Secret
metadata:
  name: istio.test-tlscontext-istio-secret-1
  namespace: secret-namespace
  labels:
    kat-ambassador-id: tlscontextistiosecret
type: istio.io/key-and-cert
""" + super().manifests()
Beispiel #5
0
    def manifests(self):
        return namespace_manifest("redirect-namespace") + f"""
---
apiVersion: v1
kind: Secret
metadata:
  name: redirect-cert
  namespace: redirect-namespace
type: kubernetes.io/tls
data:
  tls.crt: {TLSCerts["localhost"].k8s_crt}
  tls.key: {TLSCerts["localhost"].k8s_key}
---
apiVersion: v1
kind: Secret
metadata:
  name: redirect-cert
type: kubernetes.io/tls
data:
  tls.crt: {TLSCerts["localhost"].k8s_crt}
  tls.key: {TLSCerts["localhost"].k8s_key}
""" + super().manifests()
Beispiel #6
0
    def manifests(self):
        return namespace_manifest("redirect-namespace") + """
---
apiVersion: v1
kind: Secret
metadata:
  name: redirect-cert
  namespace: redirect-namespace
type: kubernetes.io/tls
data:
  tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURwakNDQW82Z0F3SUJBZ0lKQUpxa1Z4Y1RtQ1FITUEwR0NTcUdTSWIzRFFFQkN3VUFNR2d4Q3pBSkJnTlYKQkFZVEFsVlRNUXN3Q1FZRFZRUUlEQUpOUVRFUE1BMEdBMVVFQnd3R1FtOXpkRzl1TVJFd0R3WURWUVFLREFoRQpZWFJoZDJseVpURVVNQklHQTFVRUN3d0xSVzVuYVc1bFpYSnBibWN4RWpBUUJnTlZCQU1NQ1d4dlkyRnNhRzl6CmREQWVGdzB4T0RFd01UQXhNREk1TURKYUZ3MHlPREV3TURjeE1ESTVNREphTUdneEN6QUpCZ05WQkFZVEFsVlQKTVFzd0NRWURWUVFJREFKTlFURVBNQTBHQTFVRUJ3d0dRbTl6ZEc5dU1SRXdEd1lEVlFRS0RBaEVZWFJoZDJseQpaVEVVTUJJR0ExVUVDd3dMUlc1bmFXNWxaWEpwYm1jeEVqQVFCZ05WQkFNTUNXeHZZMkZzYUc5emREQ0NBU0l3CkRRWUpLb1pJaHZjTkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFMcTZtdS9FSzlQc1Q0YkR1WWg0aEZPVnZiblAKekV6MGpQcnVzdXcxT05MQk9jT2htbmNSTnE4c1FyTGxBZ3NicDBuTFZmQ1pSZHQ4UnlOcUFGeUJlR29XS3IvZAprQVEybVBucj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0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K
""" + super().manifests()
Beispiel #7
0
    def manifests(self) -> str:
        return namespace_manifest("secret-namespace") + f"""
---
apiVersion: v1
data:
  tls.crt: {TLSCerts["localhost"].k8s_crt}
  tls.key: {TLSCerts["localhost"].k8s_key}
kind: Secret
metadata:
  name: test-tlscontext-secret-0
  labels:
    kat-ambassador-id: tlscontexttest
type: kubernetes.io/tls
---
apiVersion: v1
data:
  tls.crt: {TLSCerts["tls-context-host-1"].k8s_crt}
  tls.key: {TLSCerts["tls-context-host-1"].k8s_key}
kind: Secret
metadata:
  name: test-tlscontext-secret-1
  namespace: secret-namespace
  labels:
    kat-ambassador-id: tlscontexttest
type: kubernetes.io/tls
---
apiVersion: v1
data:
  tls.crt: {TLSCerts["tls-context-host-2"].k8s_crt}
  tls.key: {TLSCerts["tls-context-host-2"].k8s_key}
kind: Secret
metadata:
  name: test-tlscontext-secret-2
  labels:
    kat-ambassador-id: tlscontexttest
type: kubernetes.io/tls
""" + super().manifests()
Beispiel #8
0
    def manifests(self) -> str:
        m = namespace_manifest("plain-namespace") + namespace_manifest(
            "evil-namespace") + """
---
kind: Service
apiVersion: v1
metadata:
  name: plain-simplemapping-http-all-http
  namespace: evil-namespace
  annotations:
    getambassador.io/config: |
      ---
      apiVersion: ambassador/v1
      kind: Mapping
      name: SimpleMapping-HTTP-all
      prefix: /SimpleMapping-HTTP-all/
      service: http://plain-simplemapping-http-all-http.plain
      ambassador_id: plain      
      ---
      apiVersion: getambassador.io/v2
      kind: Host
      name: cleartext-host-{self.path.k8s}
      ambassador_id: [ "plain" ]
      hostname: "*"
      selector:
        matchLabels:
          hostname: {self.path.k8s}
      acmeProvider:
        authority: none
      requestPolicy:
        insecure:
          action: Route
          # additionalPort: 8080
  labels:
    scope: AmbassadorTest
spec:
  selector:
    backend: plain-simplemapping-http-all-http
  ports:
  - name: http
    protocol: TCP
    port: 80
    targetPort: 8080
  - name: https
    protocol: TCP
    port: 443
    targetPort: 8443
"""

        if EDGE_STACK:
            m += """
---
kind: Service
apiVersion: v1
metadata:
  name: plain-host-carrier
  namespace: plain-namespace
  annotations:
    getambassador.io/config: |
      ---
      apiVersion: getambassador.io/v2
      kind: Host
      name: cleartext-host-{self.path.k8s}
      ambassador_id: [ "plain" ]
      hostname: "*"
      selector:
        matchLabels:
          hostname: {self.path.k8s}
      acmeProvider:
        authority: none
      requestPolicy:
        insecure:
          action: Route
          # Since this is cleartext already, additionalPort: 8080 is technically
          # an error. Leave it in to make sure it's a harmless no-op error.
          additionalPort: 8080
  labels:
    scope: AmbassadorTest
spec:
  selector:
    backend: plain-simplemapping-http-all-http
  ports:
  - name: http
    protocol: TCP
    port: 80
    targetPort: 8080
  - name: https
    protocol: TCP
    port: 443
    targetPort: 8443
"""

        return m + super().manifests()
Beispiel #9
0
def create_namespace(namespace):
    apply_kube_artifacts(namespace=namespace,
                         artifacts=namespace_manifest(namespace))
Beispiel #10
0
    def manifests(self) -> str:
        self.manifest_envs = """
    - name: AMBASSADOR_DEBUG
      value: "diagd"
"""

        return namespace_manifest("secret-namespace-ingress") + f"""
---
apiVersion: v1
data:
  tls.crt: {TLSCerts["localhost"].k8s_crt}
  tls.key: {TLSCerts["localhost"].k8s_key}
kind: Secret
metadata:
  name: test-tlscontext-secret-ingress-0
  labels:
    kat-ambassador-id: tlsingresstest
type: kubernetes.io/tls
---
apiVersion: v1
data:
  tls.crt: {TLSCerts["tls-context-host-1"].k8s_crt}
  tls.key: {TLSCerts["tls-context-host-1"].k8s_key}
kind: Secret
metadata:
  name: test-tlscontext-secret-ingress-1
  namespace: secret-namespace-ingress
  labels:
    kat-ambassador-id: tlsingresstest
type: kubernetes.io/tls
---
apiVersion: v1
data:
  tls.crt: {TLSCerts["tls-context-host-2"].k8s_crt}
  tls.key: {TLSCerts["tls-context-host-2"].k8s_key}
kind: Secret
metadata:
  name: test-tlscontext-secret-ingress-2
  labels:
    kat-ambassador-id: tlsingresstest
type: kubernetes.io/tls
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: ambassador
    getambassador.io/ambassador-id: tlsingresstest
  name: {self.name.lower()}-1
spec:
  tls:
  - secretName: test-tlscontext-secret-ingress-1.secret-namespace-ingress
    hosts:
    - tls-context-host-1
  rules:
  - host: tls-context-host-1
    http:
      paths:
      - backend:
          serviceName: {self.target.path.k8s}
          servicePort: 80
        path: /tls-context-same/
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: ambassador
    getambassador.io/ambassador-id: tlsingresstest
  name: {self.name.lower()}-2
spec:
  tls:
  - secretName: test-tlscontext-secret-ingress-2
    hosts:
    - tls-context-host-2
  rules:
  - host: tls-context-host-2
    http:
      paths:
      - backend:
          serviceName: {self.target.path.k8s}
          servicePort: 80
        path: /tls-context-same/
""" + super().manifests()
Beispiel #11
0
 def manifests(self) -> str:
     return namespace_manifest("empty-namespace") + super().manifests()
Beispiel #12
0
    def manifests(self) -> str:
        # All of the things referenced from a Host have a '.' in their
        # name, to make sure that Ambassador is correctly interpreting
        # the '.' as a namespace-separator (or not).  Because most of
        # the references are core.v1.LocalObjectReferences, the '.' is
        # not taken as a namespace-separator, but it is for the
        # tls.ca_secret.  And for ca_secret we still put the '.' in
        # the name so that we check that it's choosing the correct '.'
        # as the separator.
        return namespace_manifest("alt-namespace") + self.format('''
---
apiVersion: getambassador.io/v2
kind: Host
metadata:
  name: {self.path.k8s}
  labels:
    kat-ambassador-id: {self.ambassador_id}
spec:
  ambassador_id: [ {self.ambassador_id} ]
  hostname: ambassador.example.com
  acmeProvider:
    authority: none
  tlsSecret:
    name: {self.path.k8s}.server
  tls:
    # ca_secret supports cross-namespace references, so test it
    ca_secret: {self.path.k8s}.ca.alt-namespace
    cert_required: true
---
apiVersion: v1
kind: Secret
metadata:
  name: {self.path.k8s}.ca
  namespace: alt-namespace
  labels:
    kat-ambassador-id: {self.ambassador_id}
type: kubernetes.io/tls
data:
  tls.crt: ''' + TLSCerts["master.datawire.io"].k8s_crt + '''
  tls.key: ""
---
apiVersion: v1
kind: Secret
metadata:
  name: {self.path.k8s}.server
  labels:
    kat-ambassador-id: {self.ambassador_id}
type: kubernetes.io/tls
data:
  tls.crt: ''' + TLSCerts["ambassador.example.com"].k8s_crt + '''
  tls.key: ''' + TLSCerts["ambassador.example.com"].k8s_key + '''
---
apiVersion: getambassador.io/v2
kind: Mapping
metadata:
  name: {self.path.k8s}
  labels:
    kat-ambassador-id: {self.ambassador_id}
spec:
  ambassador_id: [ {self.ambassador_id} ]
  prefix: /
  service: {self.target.path.fqdn}
''') + super().manifests()
Beispiel #13
0
    def manifests(self) -> str:
        # Same as HostCRDClientCertCrossNamespace, all of the things
        # referenced by a Host have a '.' in their name; except
        # (unlike HostCRDClientCertCrossNamespace) the ca_secret
        # doesn't, so that we can check that it chooses the correct
        # namespace when a ".{namespace}" suffix isn't specified.
        return namespace_manifest("alt2-namespace") + self.format('''
---
apiVersion: getambassador.io/v2
kind: Host
metadata:
  name: {self.path.k8s}
  namespace: alt2-namespace
  labels:
    kat-ambassador-id: {self.ambassador_id}
spec:
  ambassador_id: [ {self.ambassador_id} ]
  hostname: ambassador.example.com
  acmeProvider:
    authority: none
  tlsSecret:
    name: {self.path.k8s}.server
  tls:
    # ca_secret supports cross-namespace references, so test it
    ca_secret: {self.path.k8s}-ca
    cert_required: true
---
apiVersion: v1
kind: Secret
metadata:
  name: {self.path.k8s}-ca
  namespace: alt2-namespace
  labels:
    kat-ambassador-id: {self.ambassador_id}
type: kubernetes.io/tls
data:
  tls.crt: ''' + TLSCerts["master.datawire.io"].k8s_crt + '''
  tls.key: ""
---
apiVersion: v1
kind: Secret
metadata:
  name: {self.path.k8s}.server
  namespace: alt2-namespace
  labels:
    kat-ambassador-id: {self.ambassador_id}
type: kubernetes.io/tls
data:
  tls.crt: ''' + TLSCerts["ambassador.example.com"].k8s_crt + '''
  tls.key: ''' + TLSCerts["ambassador.example.com"].k8s_key + '''
---
apiVersion: getambassador.io/v2
kind: Mapping
metadata:
  name: {self.path.k8s}
  labels:
    kat-ambassador-id: {self.ambassador_id}
spec:
  ambassador_id: [ {self.ambassador_id} ]
  prefix: /
  service: {self.target.path.fqdn}
''') + super().manifests()