Skip to content

Instantly share code, notes, and snippets.

@goern
Last active October 31, 2017 08:52

Revisions

  1. goern revised this gist Oct 20, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -111,6 +111,7 @@ cat >apache.json <<EOT
    EOT
    sudo kubecfg -c apache.json create pods
    sudo kubecfg -c apache.json list pods
    curl localhost
    ```
  2. goern revised this gist Oct 20, 2014. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -81,6 +81,11 @@ sudo systemctl start kube-proxy.service
    sudo systemctl start kube-controller-manager.service
    sudo systemctl start kube-scheduler.service
    sudo systemctl enable etcd.service
    sudo systemctl enable kube-apiserver.service
    sudo systemctl enable kubelet.service
    sudo systemctl enable kube-proxy.service
    sudo systemctl enable kube-controller-manager.service
    sudo systemctl enable kube-scheduler.service
    cat >apache.json <<EOT
    {
  3. goern revised this gist Oct 20, 2014. 1 changed file with 37 additions and 0 deletions.
    37 changes: 37 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -73,6 +73,43 @@ gcloud compute firewall-rules create allow-http --description "Incoming http all

    start all Kubernetes Services and pull your docker images, or build a new one on the host...

    ```
    sudo systemctl start etcd.service
    sudo systemctl start kube-apiserver.service
    sudo systemctl start kubelet.service
    sudo systemctl start kube-proxy.service
    sudo systemctl start kube-controller-manager.service
    sudo systemctl start kube-scheduler.service
    sudo systemctl enable etcd.service
    cat >apache.json <<EOT
    {
    "id": "apache",
    "desiredState": {
    "manifest": {
    "version": "v1beta1",
    "id": "apache-1",
    "containers": [{
    "name": "master",
    "image": "fedora/apache",
    "ports": [{
    "containerPort": 80,
    "hostPort": 80
    }]
    }]
    }
    },
    "labels": {
    "name": "apache"
    }
    }
    EOT
    sudo kubecfg -c apache.json create pods
    curl localhost
    ```

    # References

    * [RHEL](http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux)
  4. goern revised this gist Oct 20, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -42,16 +42,18 @@ Upload the tar file into a Google Storage bucket.
    ```
    gsutil mb gs://<bucket-name>
    gsutil cp rhel-atomic-host-image.tar.gz gs://<bucket-name>
    gcloud compute images create rhel-7-atomic-host --source-uri gs://<bucket-name>/rhel-atomic-host-image.tar.gz
    ```

    ### convert
    After upload, the tar file is converted to a GCE image.

    ```
    gcloud compute images create rhel-7-atomic-host --source-uri gs://<bucket-name>/rhel-atomic-host-image.tar.gz
    gcloud compute images list
    ```

    Done.

    ## instantiate a new instance on GCE using the image

    ```
  5. goern revised this gist Oct 20, 2014. 1 changed file with 16 additions and 4 deletions.
    20 changes: 16 additions & 4 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -40,25 +40,37 @@ tar -Szcf rhel-atomic-host-image.tar.gz disk.raw
    Upload the tar file into a Google Storage bucket.

    ```
    gsutil mb gs://dingsbums
    gsutil cp rhel-atomic-host-image.tar.gz gs://dingsbums
    gsutil mb gs://<bucket-name>
    gsutil cp rhel-atomic-host-image.tar.gz gs://<bucket-name>
    gcloud compute images create rhel-7-atomic-host --source-uri gs://<bucket-name>/rhel-atomic-host-image.tar.gz
    ```

    ### convert
    After upload, the tar file is converted to a GCE image.

    ```
    gcloud compute images create rhel-7-atomic-host --source-uri gs://dingsbums/rhel-atomic-host-image.tar.gz
    gcloud compute images list
    ```

    ## instantiate a new instance on GCE using the image

    ```
    gcloud compute images list
    gcutil addinstance <project-name>-instance --machine_type=n1-standard-1 --image=rhel-7-atomic-host --zone=europe-west1-a --wait_until_running --auto_delete_boot_disk
    gcloud compute ssh cloud-user@<project-name>-instance --zone europe-west1-a
    ```

    This is it, you should be on a fresh Atomic Host on Google Compute Engine.

    ## follow a known path

    After logging in, use your new Atomic Host. Don't forget to open up the firewall

    ```
    gcloud compute firewall-rules create allow-http --description "Incoming http allowed." --allow tcp:80
    ```

    start all Kubernetes Services and pull your docker images, or build a new one on the host...

    # References

    * [RHEL](http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux)
  6. goern revised this gist Oct 20, 2014. 1 changed file with 24 additions and 1 deletion.
    25 changes: 24 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -20,20 +20,43 @@ That's it for the first step...
    ### download and prepare Atomic Host image

    download the current cloud image of Atomic Host and store it in your project directory.
    ```
    cd <project-dir>
    curl <URL of Atomic Host> -o rhel-atomic-host-cloud.qcow2.xz
    ```

    ### convert

    Convert the Atomic Host qcow2 to a raw file and package it with tar

    ```
    xz --decompress rhel-atomic-host-cloud.qcow2.xz
    qemu-img convert -S 4096 -f qcow2 -O raw rhel-atomic-host-cloud.qcow2 disk.raw
    tar -Szcf rhel-atomic-host-image.tar.gz disk.raw
    ```

    ### publish (upload) the tar

    Upload the tar file into a Google Storage bucket
    Upload the tar file into a Google Storage bucket.

    ```
    gsutil mb gs://dingsbums
    gsutil cp rhel-atomic-host-image.tar.gz gs://dingsbums
    ```

    ### convert
    After upload, the tar file is converted to a GCE image.

    ```
    gcloud compute images create rhel-7-atomic-host --source-uri gs://dingsbums/rhel-atomic-host-image.tar.gz
    ```

    ## instantiate a new instance on GCE using the image

    ```
    gcloud compute images list
    ```

    ## follow a known path

    # References
  7. goern revised this gist Oct 20, 2014. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,21 @@ That's it for the first step...

    ## upload and generate a new GCE image for your project

    ### download and prepare Atomic Host image

    download the current cloud image of Atomic Host and store it in your project directory.

    ### convert

    Convert the Atomic Host qcow2 to a raw file and package it with tar

    ### publish (upload) the tar

    Upload the tar file into a Google Storage bucket

    ### convert
    After upload, the tar file is converted to a GCE image.

    ## instantiate a new instance on GCE using the image

    ## follow a known path
  8. goern revised this gist Oct 20, 2014. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,21 @@ Basically four steps:
    3. instantiate a new instance on GCE using the image
    4. follow a known path

    ## install SDK and initialize a new project via console
    * Sign up for Google Compute Engine
    * Download and install the Cloud SDK
    * Authenticate your client
    * Set your project ID - "A project ID is the customized name you chose when you created the project, or when you activated an API that required you to create a project ID. It can be found in the Dashboard of the project ... ", see [GCE doc](https://cloud.google.com/compute/docs/overview#projectids)

    That's it for the first step...


    ## upload and generate a new GCE image for your project

    ## instantiate a new instance on GCE using the image

    ## follow a known path

    # References

    * [RHEL](http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux)
  9. goern revised this gist Oct 20, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ Basically four steps:

    # References

    [RHEL](http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux)
    [Atomic](http://www.projectatomic.io/)
    [Atomic and RHEL Beta](http://rhelblog.redhat.com/2014/07/10/going-atomic-with-the-red-hat-enterprise-linux-7-high-touch-beta/)
    [GCE](https://cloud.google.com/compute/)
    * [RHEL](http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux)
    * [Atomic](http://www.projectatomic.io/)
    * [Atomic and RHEL Beta](http://rhelblog.redhat.com/2014/07/10/going-atomic-with-the-red-hat-enterprise-linux-7-high-touch-beta/)
    * [GCE](https://cloud.google.com/compute/)
  10. goern revised this gist Oct 20, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ Basically four steps:

    # References

    http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux
    http://www.projectatomic.io/
    http://rhelblog.redhat.com/2014/07/10/going-atomic-with-the-red-hat-enterprise-linux-7-high-touch-beta/
    https://cloud.google.com/compute/
    [RHEL](http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux)
    [Atomic](http://www.projectatomic.io/)
    [Atomic and RHEL Beta](http://rhelblog.redhat.com/2014/07/10/going-atomic-with-the-red-hat-enterprise-linux-7-high-touch-beta/)
    [GCE](https://cloud.google.com/compute/)
  11. goern revised this gist Oct 20, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    # Overview

    Basically four steps:
    1. install SDK and initialize a new project via console
    2. upload and generate a new GCE image for your project
    3. instantiate a new instance on GCE using the image
    4. follow a known path
    1. install SDK and initialize a new project via console
    2. upload and generate a new GCE image for your project
    3. instantiate a new instance on GCE using the image
    4. follow a known path

    # References

  12. goern revised this gist Oct 20, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    = Overview =
    # Overview

    Basically four steps:
    1. install SDK and initialize a new project via console
    2. upload and generate a new GCE image for your project
    3. instantiate a new instance on GCE using the image
    4. follow a known path

    References
    # References

    http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux
    http://www.projectatomic.io/
  13. goern revised this gist Oct 20, 2014. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,11 @@
    = Overview =

    Basically four steps:
    1. install SDK and initialize a new project via console
    2. upload and generate a new GCE image for your project
    3. instantiate a new instance on GCE using the image
    4. follow a known path

    References

    http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux
  14. goern revised this gist Oct 20, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    = References =
    References

    http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux
    http://www.projectatomic.io/
  15. goern renamed this gist Oct 20, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  16. goern created this gist Oct 20, 2014.
    6 changes: 6 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    = References =

    http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux
    http://www.projectatomic.io/
    http://rhelblog.redhat.com/2014/07/10/going-atomic-with-the-red-hat-enterprise-linux-7-high-touch-beta/
    https://cloud.google.com/compute/