Giter Site home page Giter Site logo

ansible-role-hello-world-k8s's Introduction

Ansible Role: Hello World Kubernetes

Build Status

Manages a Hello World application in Kubernetes|OpenShift. This project also includes the necessary bits for deploying this role with Ansible Operator in a Kubernetes|OpenShift cluster.

Requirements

Role Variables

See defaults/main.yml.

Dependencies

None

Example Playbook

NOTE The example below assumes that you have a running Kubernetes|OpenShift cluster and that you have sufficient permissions in the my-hello-world-namespace namespace.

- hosts: localhost
  vars:
    name: my-hello-world
    namespace: my-hello-world-namespace
    size: 3
  roles:
    - djzager.hello_world_k8s

Example Operator

NOTE The example below assumes that you are essentially a cluster admin for the Kubernetes|OpenShift cluster. This is because you'll be creating a Role, Service Accounts Role Binding, and a Custom Resource Definition.

First, we build our operator using operator-sdk, link here:

$ operator-sdk build hello-world-operator

Then, we create the important objects our operator needs to run:

$ kubectl create -f deploy/service_account.yaml \
                 -f deploy/role.yaml \
                 -f deploy/role_binding.yaml \
                 -f deploy/crds/examples_v1alpha1_helloworld_crd.yaml \

Then, we start the operator:

# Use the image name from the operator-sdk build step above
# and set the imagePullPolicy to Never
$ sed 's|REPLACE_IMAGE|hello-world-operator|g; s|Always|Never|' deploy/operator.yaml | kubectl create -f -

Finally, create a HelloWorld resource:

$ kubectl create -f deploy/crds/examples_v1alpha1_helloworld_cr.yaml

ansible-role-hello-world-k8s's People

Contributors

djzager avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.