diff --git a/Dockerfile.synchronizer b/Dockerfile.synchronizer
index 3609ee2..4b923b5 100644
--- a/Dockerfile.synchronizer
+++ b/Dockerfile.synchronizer
@@ -29,6 +29,14 @@
 COPY api_client.patch /tmp/api_client.patch
 RUN patch -d /usr/local/lib/python2.7/dist-packages/kubernetes/client < /tmp/api_client.patch
 
+ENV KUBECTL_VERSION "1.10.5"
+ENV KUBECTL_SHA256SUM "a9e7f82e516aa8a652bc485620483ea964eb940787cabf890d7eab96eaac294d"
+RUN curl -L -o /tmp/kubectl "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \
+  && echo "$KUBECTL_SHA256SUM  /tmp/kubectl" | sha256sum -c - \
+  && mv /tmp/kubectl /usr/local/bin/kubectl \
+  && chmod a+x /usr/local/bin/kubectl \
+  && rm -f /tmp/kubectl
+
 WORKDIR "/opt/xos/synchronizers/kubernetes"
 
 # Label image
diff --git a/xos/examples/make_resource.xossh b/xos/examples/make_resource.xossh
new file mode 100644
index 0000000..1a507ce
--- /dev/null
+++ b/xos/examples/make_resource.xossh
@@ -0,0 +1,19 @@
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This file is intended to be pasted into an xossh session
+
+rd='apiVersion: v1\nkind: Pod\nmetadata:\n  name: nginx\nspec:\n  containers:\n  - name: nginx\n    image: nginx:1.7.9\n    ports:\n    - containerPort: 80\n'
+k8r = KubernetesResourceInstance(owner=KubernetesService.objects.first(), name="nginx", resource_definition=rd)
+k8r.save()
diff --git a/xos/examples/make_resource.yaml b/xos/examples/make_resource.yaml
new file mode 100644
index 0000000..236deed
--- /dev/null
+++ b/xos/examples/make_resource.yaml
@@ -0,0 +1,56 @@
+---
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Make a pod using Kubernetes Synchronizer
+
+imports:
+  - custom_types/trustdomain.yaml
+  - custom_types/principal.yaml
+  - custom_types/image.yaml
+  - custom_types/site.yaml
+  - custom_types/slice.yaml
+  - custom_types/kubernetesservice.yaml
+  - custom_types/kubernetesresourceinstance.yaml
+
+topology_template:
+  node_templates:
+    service#kubernetes:
+          type: tosca.nodes.KubernetesService
+          properties:
+            name: kubernetes
+            must-exist: true
+
+    demo_resource:
+      type: tosca.nodes.KubernetesResourceInstance
+      properties:
+        name: "demo-pod"
+        resource_definition: |
+          apiVersion: v1
+          kind: Pod
+          metadata:
+            name: nginx
+          spec:
+            containers:
+            - name: nginx
+              image: nginx:1.7.9
+              ports:
+              - containerPort: 80
+      requirements:
+        - owner:
+            node: service#kubernetes
+            relationship: tosca.relationships.BelongsToOne
+
diff --git a/xos/synchronizer/models/kubernetes.xproto b/xos/synchronizer/models/kubernetes.xproto
index 405f1c2..06aae56 100644
--- a/xos/synchronizer/models/kubernetes.xproto
+++ b/xos/synchronizer/models/kubernetes.xproto
@@ -6,6 +6,14 @@
 
 }
 
+message KubernetesResourceInstance (XOSBase){
+     option verbose_name = "Kubernetes Resource Instance";
+     required string name = 1 [db_index = True, max_length = 200, content_type = "stripped", tosca_key=True, unique=True, help_text = "Name of ResourceInstance"];
+     required manytoone owner->Service:kubernetes_resource_instances = 2 [db_index = True, null = False, blank = False];
+     optional string resource_definition = 3 [help_text = "yaml blob"];
+     optional string kubectl_state = 4 [max_length=32, db_index = False, choices = "(('created', 'CREATED'), ('updated', 'UPDATED'), ('deleted', 'DELETED'))", help_text = "Most recent state of kubectl"];
+}
+
 message KubernetesServiceInstance (ComputeServiceInstance){
      option verbose_name = "Kubernetes Service Instance";
      optional string pod_ip = 1 [max_length=32, db_index = False, null = True, blank = True, help_text = "IP address of pod"];
diff --git a/xos/synchronizer/steps/sync_kubernetesresourceinstance.py b/xos/synchronizer/steps/sync_kubernetesresourceinstance.py
new file mode 100644
index 0000000..60174bb
--- /dev/null
+++ b/xos/synchronizer/steps/sync_kubernetesresourceinstance.py
@@ -0,0 +1,80 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+    sync_kubernetesresourceinstance.py
+
+    Synchronize KubernetesResourceInstance.
+
+    This sync_step is instantiates generic resources by executing them with `kubectl`.
+"""
+
+import os
+import subprocess
+import tempfile
+from synchronizers.new_base.syncstep import SyncStep
+from synchronizers.new_base.modelaccessor import KubernetesResourceInstance
+
+from xosconfig import Config
+from multistructlog import create_logger
+
+log = create_logger(Config().get('logging'))
+
+class SyncKubernetesResourceInstance(SyncStep):
+
+    """
+        SyncKubernetesResourceInstance
+
+        Implements sync step for syncing kubernetes resource instances. These objects are basically a yaml blob that
+        is passed to `kubectl`.
+    """
+
+    provides = [KubernetesResourceInstance]
+    observes = KubernetesResourceInstance
+    requested_interval = 0
+
+    def __init__(self, *args, **kwargs):
+        super(SyncKubernetesResourceInstance, self).__init__(*args, **kwargs)
+
+    def run_kubectl(self, operation, recipe):
+        (tmpfile, fn)=tempfile.mkstemp()
+        os.write(tmpfile, recipe)
+        os.close(tmpfile)
+        try:
+            p = subprocess.Popen(args=["/usr/local/bin/kubectl", operation, "-f", fn],
+                                 stdin=None,
+                                 stderr=subprocess.PIPE,
+                                 stdout=subprocess.PIPE,
+                                 close_fds=True)
+            (stdout, stderr) = p.communicate()
+            log.info("kubectl completed", stderr=stderr, stdout=stdout, recipe=recipe)
+            if p.returncode!=0:
+                raise Exception("Process failed with returncode %s" % p.returncode)
+        finally:
+            os.remove(fn)
+
+    def sync_record(self, o):
+        self.run_kubectl("apply", o.resource_definition)
+        if (o.kubectl_state == "created"):
+            o.kubectl_state = "updated"
+        else:
+            o.kubectl_state = "created"
+        o.save(update_fields=["kubectl_state"])
+
+    def delete_record(self, o):
+        if o.kubectl_state in ["created", "updated"]:
+            self.run_kubectl("delete", o.resource_definition)
+            o.kubectl_state="deleted"
+            o.save(update_fields=["kubectl_state"])
diff --git a/xos/synchronizer/tests/test_sync_kubernetesresourceinstance.py b/xos/synchronizer/tests/test_sync_kubernetesresourceinstance.py
new file mode 100644
index 0000000..82d957e
--- /dev/null
+++ b/xos/synchronizer/tests/test_sync_kubernetesresourceinstance.py
@@ -0,0 +1,132 @@
+
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import json
+import os
+import sys
+import unittest
+from mock import patch, PropertyMock, ANY, MagicMock, Mock
+from unit_test_common import setup_sync_unit_test
+
+class ApiException(Exception):
+    def __init__(self, status, *args, **kwargs):
+        super(ApiException, self).__init__(*args, **kwargs)
+        self.status = status
+
+def fake_init_kubernetes_client(self):
+    self.kubernetes_client = MagicMock()
+    self.v1core = MagicMock()
+    self.ApiException = ApiException
+
+class TestSyncKubernetesResourceInstance(unittest.TestCase):
+
+    def setUp(self):
+        self.unittest_setup = setup_sync_unit_test(os.path.abspath(os.path.dirname(os.path.realpath(__file__))),
+                                                   globals(),
+                                                   [("kubernetes-service", "kubernetes.proto")] )
+
+        self.MockObjectList = self.unittest_setup["MockObjectList"]
+
+        sys.path.append(os.path.join(os.path.abspath(os.path.dirname(os.path.realpath(__file__))), "../steps"))
+
+        from sync_kubernetesresourceinstance import SyncKubernetesResourceInstance
+        self.step_class = SyncKubernetesResourceInstance
+
+        self.service = KubernetesService()
+
+    def tearDown(self):
+        sys.path = self.unittest_setup["sys_path_save"]
+
+    @patch('subprocess.Popen')
+    def test_run_kubectl(self, mock_popen):
+        proc = Mock()
+        proc.communicate.return_value = ('output', 'error')
+        proc.returncode = 0
+
+        mock_popen.return_value = proc
+
+        step = self.step_class()
+        step.run_kubectl("create", "foo")
+
+        mock_popen.assert_called()
+
+    @patch('subprocess.Popen')
+    def test_run_kubectl_fail(self, mock_popen):
+        proc = Mock()
+        proc.communicate.return_value = ('output', 'error')
+        proc.returncode = 1
+
+        mock_popen.return_value = proc
+
+        step = self.step_class()
+        with self.assertRaises(Exception) as e:
+          step.run_kubectl("create", "foo")
+
+        self.assertEqual(e.exception.message, "Process failed with returncode 1")
+
+    def test_sync_record_create(self):
+        with patch.object(self.step_class, "run_kubectl") as run_kubectl:
+            xos_ri = KubernetesResourceInstance(name="test-instance", owner=self.service, resource_definition="foo")
+
+            run_kubectl.return_value = None
+
+            step = self.step_class()
+            step.sync_record(xos_ri)
+
+            run_kubectl.assert_called_with("apply", "foo")
+
+            self.assertEqual(xos_ri.kubectl_state, "created")
+
+    def test_sync_record_update(self):
+        with patch.object(self.step_class, "run_kubectl") as run_kubectl:
+            xos_ri = KubernetesResourceInstance(name="test-instance", owner=self.service, resource_definition="foo", kubectl_state="created")
+
+            run_kubectl.return_value = None
+
+            step = self.step_class()
+            step.sync_record(xos_ri)
+
+            run_kubectl.assert_called_with("apply", "foo")
+
+            self.assertEqual(xos_ri.kubectl_state, "updated")
+
+    def test_sync_record_delete(self):
+        with patch.object(self.step_class, "run_kubectl") as run_kubectl:
+            xos_ri = KubernetesResourceInstance(name="test-instance", owner=self.service, resource_definition="foo", kubectl_state="created")
+
+            run_kubectl.return_value = None
+
+            step = self.step_class()
+            step.delete_record(xos_ri)
+
+            run_kubectl.assert_called_with("delete", "foo")
+
+            self.assertEqual(xos_ri.kubectl_state, "deleted")
+
+    def test_sync_record_delete_never_created(self):
+        """ If the object was never saved, then we shouldn't try to delete it """
+        with patch.object(self.step_class, "run_kubectl") as run_kubectl:
+            xos_ri = KubernetesResourceInstance(name="test-instance", owner=self.service, resource_definition="foo")
+
+            run_kubectl.return_value = None
+
+            step = self.step_class()
+            step.delete_record(xos_ri)
+
+            run_kubectl.assert_not_called()
+
+
+if __name__ == '__main__':
+    unittest.main()
