-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
443 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
# Kubernetes Location | ||
|
||
Brooklyn Container Location has an extensive support for Kubernetes deployments | ||
In particular, it supports | ||
|
||
- KubernetesResource | ||
- KubernetesHelmChart | ||
- KubernetesContainer | ||
|
||
## Kubernets Helm Chart | ||
|
||
Here's an example of an Helm based blueprint | ||
|
||
```YAML | ||
location: | ||
kubernetes: | ||
endpoint: https://localhost:6443 | ||
kubeconfig: /home/user/.kube/config | ||
services: | ||
- type: org.apache.brooklyn.container.entity.kubernetes.KubernetesHelmChart | ||
name: jenkins-helm | ||
chartName: jenkins | ||
``` | ||
Notice, in this case, it is pointing at a local k8s cluster (created using Docker on Mac) and specify a `kubeconfig` | ||
file for connection details. | ||
|
||
The `KubernetesHelmChart` entity will install the latest version of the `chart` named `jenkins` from the Chart repository `stable` at `https://kubernetes-charts.storage.googleapis.com/` | ||
You can install a specific version of the chart by using `chartVersion` config key. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...er/src/main/java/org/apache/brooklyn/container/entity/kubernetes/KubernetesHelmChart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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. | ||
*/ | ||
package org.apache.brooklyn.container.entity.kubernetes; | ||
|
||
import org.apache.brooklyn.api.entity.ImplementedBy; | ||
import org.apache.brooklyn.config.ConfigKey; | ||
import org.apache.brooklyn.core.config.ConfigKeys; | ||
import org.apache.brooklyn.entity.software.base.SoftwareProcess; | ||
import org.apache.brooklyn.util.core.ResourcePredicates; | ||
|
||
@ImplementedBy(KubernetesHelmChartImpl.class) | ||
public interface KubernetesHelmChart extends SoftwareProcess { | ||
|
||
ConfigKey<String> CHART_NAME = ConfigKeys.builder(String.class) | ||
.name("chartName") | ||
.description("Helm Chart name") | ||
.build(); | ||
|
||
ConfigKey<String> CHART_VERSION = ConfigKeys.builder(String.class) | ||
.name("chartVersion") | ||
.description("Helm Chart version") | ||
.build(); | ||
} |
35 changes: 35 additions & 0 deletions
35
...rc/main/java/org/apache/brooklyn/container/entity/kubernetes/KubernetesHelmChartImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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. | ||
*/ | ||
package org.apache.brooklyn.container.entity.kubernetes; | ||
|
||
import org.apache.brooklyn.core.entity.BrooklynConfigKeys; | ||
import org.apache.brooklyn.entity.software.base.EmptySoftwareProcessImpl; | ||
|
||
public class KubernetesHelmChartImpl extends EmptySoftwareProcessImpl implements KubernetesHelmChart { | ||
|
||
@Override | ||
public void init() { | ||
super.init(); | ||
|
||
config().set(BrooklynConfigKeys.SKIP_ON_BOX_BASE_DIR_RESOLUTION, true); | ||
config().set(PROVISIONING_PROPERTIES.subKey("useJcloudsSshInit"), false); | ||
config().set(PROVISIONING_PROPERTIES.subKey("waitForSshable"), false); | ||
config().set(PROVISIONING_PROPERTIES.subKey("pollForFirstReachableAddress"), false); | ||
config().set(EmptySoftwareProcessImpl.USE_SSH_MONITORING, false); | ||
} | ||
|
||
} |
Oops, something went wrong.