|
1 | 1 | # Application Lifecycle Manager
|
2 | 2 |
|
3 |
| -Hello, world. |
| 3 | +## Goals |
| 4 | + |
| 5 | +The aim of this project is to serve the following purposes: |
| 6 | + |
| 7 | +* CRUD operations on top level service/app types |
| 8 | +* CRUD operations on service/app instances |
| 9 | +* Answer forensic questions and generate audit logs about state transitions for the above |
| 10 | +* To do so in the most kubernetes native way possible |
| 11 | + |
| 12 | +## Usage |
| 13 | + |
| 14 | +**Asumption**: The ALM operator is already installed in the cluster, which defines an app CRD. |
| 15 | + |
| 16 | +```sh |
| 17 | +kubectl get crd |
| 18 | +NAME KIND |
| 19 | +app.stable.coreos.com CustomResourceDefinition.v1beta1.apiextensions.k8s.io |
| 20 | +``` |
| 21 | + |
| 22 | +### Create an instance of an app type |
| 23 | + |
| 24 | +```sh |
| 25 | +kubectl create -f etcdapp.yaml |
| 26 | +``` |
| 27 | + |
| 28 | +```yaml |
| 29 | +apiVersion: app.coreos.com/v1beta1 |
| 30 | +kind: App |
| 31 | +metadata: |
| 32 | + name: etcd |
| 33 | + type: com.tectonic.storage |
| 34 | +spec: |
| 35 | + operator: |
| 36 | + type: helm |
| 37 | + helmChart: |
| 38 | + # This contains the deployment for the controller |
| 39 | + # this will watch the channel on Quay and upgrade the operator when necessary |
| 40 | + template: quay.io/coreos/etcd-operator:stable |
| 41 | + values: |
| 42 | + replicas: 2 |
| 43 | + # This writes out the CRDs for the app type and allows for linking app type instances to the app |
| 44 | + resources: |
| 45 | + - name: cluster.etcd.coreos.com |
| 46 | + spec: |
| 47 | + # group name to use for REST API: /apis/<group>/<version> |
| 48 | + group: etcd.coreos.com |
| 49 | + # version name to use for REST API: /apis/<group>/<version> |
| 50 | + version: v1 |
| 51 | + # either Namespaced or Cluster |
| 52 | + scope: Namespaced |
| 53 | + names: |
| 54 | + # plural name to be used in the URL: /apis/<group>/<version>/<plural> |
| 55 | + plural: etcds |
| 56 | + # singular name to be used as an alias on the CLI and for display |
| 57 | + singular: etcd |
| 58 | + # kind is normally the CamelCased singular type. Your resource manifests use this. |
| 59 | + kind: Etcd |
| 60 | + schema: "Putting something here would be super useful for showing how to interact with the operator" |
| 61 | + outputs: |
| 62 | + - name: service-name |
| 63 | + type: string |
| 64 | + description: The service name at which to contact the newly formed etcd |
| 65 | + - name: client-cert-secret |
| 66 | + type: string |
| 67 | + description: The k8s secret at which to find the credentials to auth with the cluster |
| 68 | + - name: client-cert-key-secret |
| 69 | + type: string |
| 70 | + description: The k8s secret at which to find the private key for authenticating with the cluster |
| 71 | +``` |
| 72 | +
|
| 73 | +### List the app types |
| 74 | +
|
| 75 | +```sh |
| 76 | +kubectl get Apps |
| 77 | +NAME KIND |
| 78 | +etcd Etcd.v1.etcd.coreos.com |
| 79 | +``` |
| 80 | + |
| 81 | +### Create an instance of the app |
| 82 | + |
| 83 | +```sh |
| 84 | +kubectl create -f myetcd.yaml |
| 85 | +``` |
| 86 | + |
| 87 | +```yaml |
| 88 | +apiVersion: etcd.coreos.com/v1 |
| 89 | +kind: Etcd |
| 90 | +metadata: |
| 91 | + name: etcd-purple-ant |
| 92 | + namespace: default |
| 93 | +spec: |
| 94 | + size: 3 |
| 95 | + version: 3.2.2 |
| 96 | + autoMinorVersionUpgrade: True |
| 97 | +``` |
| 98 | +
|
| 99 | +### List instances of the app |
| 100 | +
|
| 101 | +```sh |
| 102 | +kubectl get Etcds |
| 103 | +NAME KIND |
| 104 | +etcd-purple-ant Etcd.v1.etcd.coreos.com |
| 105 | +``` |
| 106 | + |
| 107 | +### Get details about the app |
| 108 | + |
| 109 | +```sh |
| 110 | +kubectl get etcd etcd-purple-ant -o yaml |
| 111 | +``` |
| 112 | + |
| 113 | +```yaml |
| 114 | +apiVersion: etcd.coreos.com/v1 |
| 115 | +kind: Etcd |
| 116 | +metadata: |
| 117 | + creationTimestamp: 2017-07-20T23:52:44Z |
| 118 | + name: etcd-purple-ant |
| 119 | + namespace: default |
| 120 | + resourceVersion: "6964" |
| 121 | + selfLink: /apis/etcd.coreos.com/v1/namespaces/default/etcds/etcd-purple-ant |
| 122 | + uid: 8657f388-6da6-11e7-8ab2-08002787f71a |
| 123 | +spec: |
| 124 | + size: 3 |
| 125 | + version: 3.2.2 |
| 126 | + autoMinorVersionUpgrade: True |
| 127 | +status: |
| 128 | + outputs: |
| 129 | + service-name: etcd-purple-ant.service |
| 130 | + client-cert-secret: etcd-purple-ant-cert |
| 131 | + client-cert-key-secret: etcd-purple-ant-key |
| 132 | +``` |
| 133 | +
|
| 134 | +### Simple deployment of a stateless app |
| 135 | +
|
| 136 | +```sh |
| 137 | +kubectl create -f coreoswebsite.yaml |
| 138 | +``` |
| 139 | + |
| 140 | +```yaml |
| 141 | +apiVersion: app.coreos.com/v1beta1 |
| 142 | +kind: App |
| 143 | +metadata: |
| 144 | + name: coreos-website |
| 145 | + type: com.tectonic.web |
| 146 | +spec: |
| 147 | + operator: |
| 148 | + type: helm |
| 149 | + helmChart: |
| 150 | + template: quay.io/coreos/stateless-app-operator:stable |
| 151 | + values: |
| 152 | + replicas: 2 |
| 153 | + resources: |
| 154 | + - name: coreos-website.web.coreos.com |
| 155 | + spec: |
| 156 | + group: web.coreos.com |
| 157 | + version: v1 |
| 158 | + scope: Namespaced |
| 159 | + names: |
| 160 | + plural: coreos-websites |
| 161 | + singular: coreos-website |
| 162 | + kind: CoreOSWebsite |
| 163 | + shortNames: |
| 164 | + - site |
| 165 | + outputs: |
| 166 | + - name: endpoint |
| 167 | + type: url |
| 168 | + description: The URL at which the website is eventually deployed |
| 169 | +``` |
| 170 | +
|
| 171 | +```sh |
| 172 | +kubectl create -f wwwcoreoscom.yaml |
| 173 | +``` |
| 174 | + |
| 175 | +```yaml |
| 176 | +apiVersion: web.coreos.com/v1 |
| 177 | +kind: CoreOSWebsite |
| 178 | +metadata: |
| 179 | + name: www-coreos-com |
| 180 | + namespace: default |
| 181 | +spec: |
| 182 | + type: helm |
| 183 | + helmChart: |
| 184 | + template: quay.io/coreos/web:stable |
| 185 | + values: |
| 186 | + endpoint: www.coreos.com |
| 187 | + upgrades: |
| 188 | + automatic: True |
| 189 | + strategy: rolling |
| 190 | +``` |
0 commit comments