appsody / appsody-operator

An Operator for deploying Appsody based applications to Kubernetes. This repo will be archived soon.
Apache License 2.0
18 stars 15 forks source link

Ensure Appsody operator tolerates Knative > v0.6.0 #149

Closed navidsh closed 5 years ago

navidsh commented 5 years ago

As of now, the operator only works with Knative Serving v1alpha1. Given that there are newer versions of Knative Serving (v1beta1 and v1), we need to see if we can change the operator to tolerate newer API versions. This would be a hard requirement once Kabanero installs a newer Knative Serving operator.

JusteenR commented 5 years ago

Currently the Appsody operator tolerates Knative v0.8.0, this is the version Kabanero will be using, to test the pod starts I conducted the following steps on a OpenShift 4.2 cluster:


Manually installing Knative

  1. Logged on to the OpenShift console and went to the OperatorHub under Operators
  2. Downloaded the Red Hat OpenShift Service Mesh, Serverless Operator, and the Appsody Operator
  3. Manually installed Knative v0.8.0 by running the following commands:
    kubectl apply --selector knative.dev/crd-install=true \
    --filename https://github.com/knative/serving/releases/download/v0.8.0/serving.yaml \
    --filename https://github.com/knative/eventing/releases/download/v0.8.0/release.yaml \
    --filename https://github.com/knative/serving/releases/download/v0.8.0/monitoring.yaml
kubectl apply --filename https://github.com/knative/serving/releases/download/v0.8.0/serving.yaml \
   --filename https://github.com/knative/eventing/releases/download/v0.8.0/release.yaml \
   --filename https://github.com/knative/serving/releases/download/v0.8.0/monitoring.yaml

As per: https://knative.dev/v0.8-docs/install/knative-with-any-k8s/

  1. Created a Service CR, created the file:
    kind: Service
    metadata:
    name: example-appsodyapplication # The name of the app
    namespace: randevj # The namespace the app will use
    spec:
    template:
    spec:
      containers:
        - image: navidsh/demo-day # The URL to the image of the app
          env:
            - name: TARGET # The environment variable printed out by the sample app
              value: "Test Sample"

And then ran the command: oc apply -f service.yaml to create the Service resource

  1. Then created an Appsody Application and waited for the pods to start.
apiVersion: appsody.dev/v1beta1
kind: AppsodyApplication
metadata:
  name: example-appsodyapplication
spec:
  # Add fields here
  applicationImage: navidsh/demo-day
  stack: nodejs-express
  createKnativeService: true
  service:
    type: ClusterIP
    port: 3000
  expose: true

Installing Knative using the Operator

  1. Logged on to the OpenShift console and went to the OperatorHub under Operators
  2. Downloaded the Red Hat OpenShift Service Mesh, Serverless Operator, and the Appsody Operator
  3. Installed Knative using the operator by running the following command:
    cat <<-EOF | kubectl apply -f -
    apiVersion: v1
    kind: Namespace
    metadata:
    name: knative-serving
    ---
    apiVersion: serving.knative.dev/v1alpha1
    kind: KnativeServing
    metadata:
    name: knative-serving
    namespace: knative-serving
    spec:
    config:
    defaults:
      revision-timeout-seconds: "300"  # 5 minutes
    autoscaler:
      stable-window: "60s"
    deployment:
      registriesSkippingTagResolving: "ko.local,dev.local"
    logging:
      loglevel.controller: "debug"
    EOF

As per: https://github.com/knative/serving-operator and https://access.redhat.com/documentation/en-us/openshift_container_platform/4.1/pdf/serverless/OpenShift_Container_Platform-4.1-Serverless-en-US.pdf

  1. Then created an Appsody Application and waited for the pods to start.
apiVersion: appsody.dev/v1beta1
kind: AppsodyApplication
metadata:
  name: example-appsodyapplication
spec:
  # Add fields here
  applicationImage: navidsh/demo-day
  stack: nodejs-express
  createKnativeService: true
  service:
    type: ClusterIP
    port: 3000
  expose: true
navidsh commented 5 years ago

Thanks @JusteenR. Closing this one.