Commit Graph

110 Commits

Author SHA1 Message Date
Jeffrey Zhang 434b65c6ef Retire kolla-kubernetes project - step 3 remove project content
Depends-On: https://review.openstack.org/567779
Needed-By: https://review.openstack.org/568174
Change-Id: If5bdd602d5f5c8addba70235ac41c0a52cef2c11
2018-05-14 02:54:20 +00:00
Justin Scott 29461d6850 Deploy with ansible inside orchestration container
* Add deploy playbook
  * Add Dockerfile
  * Also uses regular filenames with underscores as key in configmaps
    since kubectl creates them from file this way

Change-Id: I8c7ceddacc7be1262f6ad565003ff14bb4d60af0
2018-01-04 22:59:22 -08:00
Haikel Guemar 307d543761 Drop pycrypto from utility genpwd.py
pycrypto is unmaintained for a while and requirements team advises using
pycryptodome or cryptography libraries instead (see openstack-dev thread
[0]).

genpwd.py uses pycrypto to generate RSA keypair. This commit rewrite
generate_RSA function using python-cryptography while keeping strict 1:1
compatibility with previous code.

[0] http://lists.openstack.org/pipermail/openstack-dev/2017-March/113568.html

Change-Id: I13f468c35adb7b2cf76b3d04d9d700aa8ea54a85
2017-09-20 14:05:59 -07:00
Doug Hellmann e65eab6639 pass the correct app type when initializing command in tests
The first argument to a Command class should be the App that is
loading the command.

Change-Id: I8ad67accb5bd3c377dda31fde49447f68f608a48
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-07-12 21:04:43 +00:00
Sam Betts b8d4f1ef36 Make sure pathfinder can find passwords.yml in etc/kolla
Change-Id: I9e97950e77424bd0da944ac15e730c98e5c22dea
2017-05-23 17:45:37 +01:00
Sam Betts df177f8429 Remove kolla-ansible dependencies
The secrets generator still fails if kolla-ansible isn't installed
because it continues to look for files installed from that package. This
patch changes the code to look at the ansible code location in the
kolla-kubernetes package.

Change-Id: Idd3e35b198ebf0d4c109906b18234bd06e74d48f
2017-05-18 12:03:31 +01:00
Jenkins b195d41cf9 Merge "Import generate_passwords.py from kolla-ansible" 2017-04-15 01:11:07 +00:00
Steven Dake 1cb01ebb03 Make pathfinder compatible with a pip install
Pathfinder is not compatible as is with a pip install of
kolla-ansible.  Since a pip install is the main expected
way for operators to consume kolla-kubernetes, this hack
is necessary until kolla-ansible is ejected as a dependency.

Change-Id: I727b7961f25eff6d1e52b4abb90624fb8bc7a9dc
2017-04-14 19:44:54 -04:00
Steven Dake a1e0d65270 Import generate_passwords.py from kolla-ansible
This is a direct copy of generate_passwords.py from kolla-ansible to
remove the kolla-ansible dependency.

Change-Id: Ia8a19ee4e196c4bd5f6d42fe0f6ccfc36f0bfb7f
Partially-Implements: blueprint remove-deps
2017-04-14 19:03:04 -04:00
Jenkins 616d99c5aa Merge "Installation path added for ubuntu to pathfinder.py" 2017-04-14 19:09:28 +00:00
Steven Dake e3d9454ce1 Remove services/cinder
Partially-Implements: blueprint services-redux
Change-Id: Ib51dadbfe55a02989ee941c9704cacfeaac6a311
2017-04-03 16:30:41 -07:00
Ryan Hallisey 1334344d56 Add cleanup for all of a resource
Add into the CLI the ability to cleanup an entire resource.
This will help when you need to cleanup all of a particular
resource in your environment.

To delete all configmaps run:
   kolla-kubernetes resource delete configmap all

Change-Id: Ia6149303230b131bf19b81206b97ecc36b3ee616
2017-03-06 01:19:32 +00:00
zhuzeyu e01ef2a59d Using yaml.safe_load instead of yaml.load
It is not safe to call yaml.load with any data received from
an untrusted source, we'd better use yaml.safe_load

Reference:
https://security.openstack.org/guidelines/dg_avoid-dangerous-input-parsing-libraries.html

Change-Id: I175ab89d408b38d5370621c0fd2cf78685e951f7
2017-02-07 12:12:27 +08:00
Kevin Fox d350e0a156 Ensure all containers have imagePullPolicy
This PS adds the imagePullPolicy to all containers
and provides a test to ensure it is always there.

Implements: blueprint image-pull-policy

Change-Id: I9a94e3a1ab909dcea0960b490aa57a5432780961
2017-01-31 08:44:37 -08:00
Kevin Fox e8b988469e Helm template testing
This PS lays the groundwork for testing helm packages
rendered yaml in the gate. This should allow us to test
many more configurations much more quickly.

It also fixes a problem it discovered. A broken
cinder-backup template.

Change-Id: I24a70fb4dbdbf06f8340abe3b7e72f794e09a5d9
2017-01-30 19:04:37 -08:00
Jenkins f43e2cde8d Merge "Removes unnecessary utf-8 encoding" 2017-01-23 16:33:08 +00:00
Jenkins 01f14dfc95 Merge "Improve file handling with context manager" 2017-01-23 16:19:09 +00:00
Cuong Nguyen ff93e3a082 Improve file handling with context manager
Also, json.dumps with `indent` adds trailing space at EOL, use `seperators` to fix
that

Change-Id: Ifc23c981b2b31d03b838ca7f41d573ce976ba1a0
2017-01-23 11:58:07 +07:00
Cuong Nguyen 60fb78791a Remove unnecessary f.close()
Context manager automatically handles file closing. No need to use
f.close()

Change-Id: I48222bd0d3c84819ead84ada33c000d95da21a9d
2017-01-23 11:46:46 +07:00
prameswar 97355d144a Installation path added for ubuntu to pathfinder.py
For centos system, installation path is /usr/share/kolla and
/usr/share/kolla-kubernetes and for ubuntu system, installation
path is /usr/local/share/kolla and /usr/local/share/kolla-kubernetes.

So, kolla_kubernetes/pathfinder.py not able to search installation path.

Closes-Bug: #1657852

Change-Id: I875c214eece3a3365285a9534744e8ff29e34a08
2017-01-19 18:50:56 +00:00
Jenkins fea7c207f1 Merge "Use assertGreater(len(x), 0) instead of assertTrue(len(x) > 0)" 2017-01-02 08:12:21 +00:00
Cao Xuan Hoang bb51257a53 Removes unnecessary utf-8 encoding
The following file(s) added utf-8 encoding but never used. So we can
remove them at all.

kolla_kubernetes/__init__.py

Change-Id: I9792d39e7b364bda426dc20d55e593c057e00ce9
2016-12-22 10:53:47 +07:00
Kevin Fox e9ad4c7c3b Switch to helm 2.1.0 and kubernetes 1.5+
This ps swiches the gate to use helm 2.1.0 and kubernetes 1.5+

Change-Id: Ic9ecf6480f3890988e6bb73f279887bf8c76991a
2016-12-14 20:29:01 -08:00
gecong1973 97b5bbf578 Use assertGreater(len(x), 0) instead of assertTrue(len(x) > 0)
assertGreater provides a nicer error message if it fails.

Change-Id: Ib4c20f96d9af63a3c49b4875e550ef1ef42e2527
2016-11-24 15:31:51 +08:00
Jenkins f55b6351e3 Merge "Clean imports in code" 2016-11-18 09:40:50 +00:00
Jenkins f6c95aa318 Merge "TrivialFix: Remove unused code" 2016-11-18 09:40:36 +00:00
gecong1973 a2c925e44d Replace LOG.warn with LOG.warning
logging.warn is deprecated in Python 3.[1]
[1] https://docs.python.org/3/library/logging.html#logging.warning

Change-Id: I05f6f184347f579689e44c5d87cc2257caf4cf44
2016-10-04 14:26:31 +08:00
Kevin Fox b8054c6a21 Kolla Kubernetes Gate Test
This PS creates a gate test for kolla-kubernetes. It does an all in
one deployment backed with ceph.

In addition, it:
 * Adds a bindep.txt file to give our tests quicker install times.
 * Adds a bashate tox test for linting bash.
 * Fixes a bug with multiple pods passed on the command line at
   once.

Change-Id: I29d928b9864e268542a8a51d86b566e4933557bf
2016-10-01 18:41:18 -07:00
Serguei Bezverkhi 04bb274d5b Adds sidecar logging container to common-deployment pod
This PS introduce a sidecar container running fleuntd's td-agent.
This agent does "tail" on /var/log/kolla/*/*.log files and transfer
then to elasticsearch for centralized storage. Idea is that each
OpenStack pod will have its own sidecar logging container.

Author:    Serguei Bezverkhi <sbezverk@cisco.com>
Co-Authored-By: Kevin Fox <kevin@efox.cc>

Partially-Implements: blueprint centralized-logging

Change-Id: I14826d9cb2376e61966e67ef38c4c78889374c26
2016-09-26 10:35:50 -07:00
Kevin Fox a4d268e1f1 Basic ceph backend support
This PS adds support for scalable glance backed by ceph. It adds
supports for cinder backed by ceph. It also adds an implementation
of ceph in k8s that can be used for testing when no other ceph
option is available. The k8s managed ceph is intended mostly just
for testing with minikube.

Change-Id: I5332c5b5ee4d6d1ec90cec6abffe88f20fb1373d
2016-09-26 08:54:21 -07:00
Kevin Fox 30109cc533 More deployments merged
This PS merges most of the remaining deployment template into the
common-deployment.

Change-Id: I1f149d5b0e82ef6b1091c8db4e67c6279d4d4af0
2016-09-24 08:51:38 -07:00
Nguyen Hung Phuong 3d80a2fee8 Clean imports in code
In some part in the code we import objects. In the Openstack style
guidelines they recommend to import only modules.

http://docs.openstack.org/developer/hacking/#imports

TrivialFix

Change-Id: I8bd10114b9771637dcca9af04d6970afc9c36ad0
2016-09-23 03:44:21 +00:00
Nguyen Hung Phuong a488ca210a TrivialFix: Remove unused code
This patch removes unused code in

kolla_kubernetes/commands/cmd_resource.py
kolla_kubernetes/commands/cmd_service.py
kolla_kubernetes/pathfinder.py
kolla_kubernetes/service_resources.py

Change-Id: I60e163628bda205299b787889defd1fdba508539
2016-09-23 10:03:08 +07:00
Kevin Fox 6b48695d90 CLI rework.
This Patch Set reworks the cli. For now, instead of replacing the
'kolla-kubernetes' tool it makes a new tool called 'kollakube'.
This new command requires less typing. Operators who will need to
type the command a lot, so shortening the cli will help over time.
In a future PS the old 'kolla-kubernetes' command will be removed.

It reworks the resource and template system to allow the operator
to specify multiple entries to be processed at once. This aligns
kollakube with kubectl behavior.

The 'resource-template' subcommand is renamed to just 'template'.

The 'resource-map' subcommand is renamed to just 'map'.

The 'template' subcommand drops the action argument as it has no
effect.

Aliases are added from 'resource' to 'res' and 'template' to 'tmpl'.

The 'kollakube' cli removes any workflow related subcommands as they
are unlikely to work well moving forward and will be replaced
shortly with an ansible workflow.

Change-Id: Ide7b5d391a4ac0a514c027cf761033d9eb94d152
2016-09-22 10:42:34 -07:00
Kevin Fox 09515e716f Add container debug feature
Adds a -d flag to the resource-template and resource commands
that override the specified container's command with
[/bin/bash, -c, 'while; true; do sleep 1000; done'] to aid
in debugging container issues.

Change-Id: I4f1f5422e1d47a013af9137c062a53282128ffd0
Partially-implements: blueprint kolla-kubernetes-resource-debug
2016-09-22 09:34:54 -07:00
Kevin Fox 51c8b7df96 net=host + resolv.conf workaround.
We're using service discovery with our net=host pods but resolv.conf
doesn't point at kube-dns when net=host. This provides a workaround.
You can do this by creating a configmap called resolv-conf with a
resolv.conf from a non net=host pod, and you set:

enable_resolve_conf_net_host_workaround="yes"

Change-Id: Ic2ac1725f42ba66b89cd5869f3ec3a751aa66df8
2016-09-14 16:36:55 -07:00
Kevin Fox 3370294354 Fix some openvswitch issues
TrivialFix

Change-Id: Ida02cec5b1897f7ed567dda4e8d29b1508f2fb7e
2016-09-13 18:47:50 -07:00
Kevin Fox e2ac17d0ff fix rabbitmq, glance-api, and haproxy
Fixes the pvc name for glance api and reverts the name of the
rabbit service to match whats in kolla. fixes the tests to
ignore the rabbit name conflict too... fix to make older haproxy
work.

Change-Id: I9949d8fe54eb043d8240ed6b109884d8525de9cb
2016-09-13 10:27:37 -07:00
Takashi Sogabe 8cc659e27d This patch fixes the naming convention of configmaps as follows.
https://review.openstack.org/#/c/368460/

Change-Id: Ie82cd0440b462ef3e1f69a0a230916b4a0def17d
Closes-Bug: #1622841
2016-09-13 14:38:46 +09:00
Kevin Fox f839e5f4aa remove redundant -configmap from names
And fix pv/pvc issues.

Partially-Implements: blueprint redundant-cli-info

Change-Id: I7c6b55a95f576f351fd14918d2e3421ac6b43181
2016-09-11 18:17:44 -07:00
Kevin Fox cc5ced6f8a l3/metadata DaemonSets + DVR, & labels
Move neutron-l3-agent and neutron-metadata-agent to its own DaemonSet
templates and add DVR support. Also add multi node support with
nodeSelectors.

Fix some invalid yaml issues (tabs -> spaces)

Partially-Implements: blueprint hostlabels
Partially-Implements: blueprint deployments
Partially-Implements: blueprint consistent-namespace

Change-Id: Ic485f583b16d40b55c136d79f04edb3af44f4f03
2016-09-11 18:02:37 -07:00
Ryan Hallisey bae09a41e5 Add the ability to create services from the CLI
Change-Id: Ia00d97859799ead4648162c599a279aa6f3c5473
2016-09-11 21:54:51 -04:00
Kevin Fox fec0ff534b Check for service name in resource name
Now that service names are optional, the service name
should always be in the resource name. This checks for
it and fixes the few cases that didn't have it.

Change-Id: I0b72d49f3669cdc408ded29e0ebcb5f52b34b184
2016-09-11 07:31:42 -07:00
Kevin Fox 8ffcff8b98 Fix all name in template metadata issues
Change-Id: Ic590e85e2f0db8eff2c205735e197e4501ca2211
2016-09-11 07:17:05 -07:00
Kevin Fox d0df66ade9 Cleanup container names
This ensures that all containers that have a main container are
named 'main' to make it easier on operators to enter them or get
logs from them. The Pod name stays unique so there will never
be conflicts.

This also modifies the 'main' container check to ignore Jobs
with multiple containers. A few Jobs don't really have a main.

Change-Id: Ia10718141064752d1aea280dc7663a3b0ed87dfa
Implements: blueprint container-names
2016-09-11 07:08:44 -07:00
Kevin Fox a418140cd6 More Resource Cleanup
This fixes most of the issues of the following types:
 * resource_type in resource_name
 * k8s object name != resource_name

Change-Id: I765faee820c16e6f9ddf819783d6bd6d00b00da5
2016-09-11 06:58:05 -07:00
Jenkins 053c4d4bc5 Merge "More Tests" 2016-09-11 13:34:54 +00:00
Jenkins 084a93ed42 Merge "Resource type configmap" 2016-09-11 13:31:16 +00:00
Kevin Fox da9257052c Resource type configmap
So far, configmap has been a separate, special type and we've had to
add some configmaps to pods just to work around the lack of support.
This patch set makes configmaps regular types and they now work with
both resource-template and resource like any other. The pod
configmaps have also been converted to regular configmaps.

Change-Id: I236c52c69be674b55c039859558f2cdab2de4dba
2016-09-10 20:15:53 -07:00
Kevin Fox b1ec1d1cfb More Tests
This patch set adds tests for 4 more types of issues and white lists
existing occurances of them:
 * If its a pod or has a pod templated type, there is a container named 'main'
 * If the resource_name and the name of the object don't match.
 * If it is a pod templated type and there is a name in the template. (Dead code)
 * If there is a k8s type in the resource_name. (Redundant cli)

Change-Id: I0ab834ce99fbac9a7b2375a91076eebcbbc39875
Partially-Implements: blueprint redundant-cli-info
2016-09-10 13:16:51 -07:00