rancher / rio

Application Deployment Engine for Kubernetes
https://rio.io
Apache License 2.0
2.27k stars 228 forks source link

Rio run config file? similar to kubectl create -f [file]? #314

Open nfons opened 5 years ago

nfons commented 5 years ago

Hoping This will get a better answer:

for rio run all guides / help text point to rio run [image]

I see in the docs you can pass in [options] like --app, --ports etc etc. but I’m unsure how to do a multi-container deployment.

I.e:

apiVersion: v1
kind: Pod
metadata:
  name: two-containers
spec:
 volumes:
  - name: shared-data
    emptyDir: {}
  containers:
  - name: nginx-container
    image: nginx
    volumeMounts:
    - name: shared-data
      mountPath: /usr/share/nginx/html

  - name: debian-container
    image: debian
    volumeMounts:
    - name: shared-data
      mountPath: /pod-data
    command: ["/bin/sh"]
    args: ["-c", "echo Hello from the debian container > /pod-data/index.html"]

in vanilla k8s land, I would simply do kubectl create -f deploy.yaml.

how does it work in rio?

StrongMonkey commented 5 years ago

You can create a rio service by following the api docs(https://github.com/rancher/rio/blob/master/api-docs.md#service). Rio run doesn't expose the option to run multi-containers but it is possible to create your manifest for rio service and add multi containers under spec.podconfig.containers.

StrongMonkey commented 5 years ago

An example would be

apiVersion: rio.cattle.io/v1
kind: Service
metadata:
  name: istio-telemetry
  namespace: rio-system
spec:
  args:
  - --monitoringPort=9093
  - --address
  - unix:///sock/mixer.socket
  - --configStoreURL=k8s://
  - --configDefaultNamespace=rio-system
  containers:
  - args:
    - proxy
    - --serviceCluster
    - istio-telemetry
    - --templateFile
    - /etc/istio/proxy/envoy_telemetry.yaml.tmpl
    - --controlPlaneAuthPolicy
    - NONE
    env:
    - name: POD_NAME
      value: $(self/name)
    - name: POD_NAMESPACE
      value: $(self/namespace)
    - name: INSTANCE_IP
      value: $(self/ip)
    image: istio/proxyv2:1.1.3
    name: istio-proxy
    ports:
    - port: 15004
      protocol: TCP
      targetPort: 15004
    - name: grpc
      port: 9091
      protocol: TCP
      targetPort: 9091
    secrets:
    - directory: /etc/certs
      name: identity
    volumes:
    - Name: uds-socket
      Path: /sock
  disableServiceMesh: true
  env:
  - name: GODEBUG
    value: gctrace=2
  globalPermissions:
  - role: cluster-admin
  image: istio/mixer:1.1.3
  imagePullPolicy: Always
  ports:
  - internalOnly: true
    name: monitoring
    port: 9093
    protocol: TCP
    targetPort: 9093
  - internalOnly: true
    name: prometheus
    port: 42422
    protocol: TCP
    targetPort: 42422
  volumes:
  - Name: uds-socket
    Path: /sock