@@ -14,9 +14,10 @@ Kubernetes configuration:
14
14
1 . The application is deployed using the Kubernetes deployment API (versus the
15
15
the replication controller directly). For more information read
16
16
http://kubernetes.io/docs/user-guide/deployments/
17
- 2 . The tested codebase has a yaml file that describes the Kubernetes deployment
17
+ 2 . The tested codebase has a yaml file (i.e. deployment.yml) that describes the Kubernetes deployment
18
18
parameters and configuration of your application.
19
- 3 . At the moment, only the basic username/pass authentication is supported.
19
+ 3 . The script processes deployment.yml as a simple template where all ` {{ ENV_VARIABLE }} ` are replaced with a value of $ENV_VARIABLE deployment.yml
20
+ 4 . At the moment, only the basic username/pass authentication is supported.
20
21
21
22
# Configuration
22
23
@@ -28,9 +29,59 @@ before failing the build. Defaults to 120 (secs).
28
29
3 . KUBERNETES_PASSWORD - The password for the Kubernetes cluster. Mandatory.
29
30
4 . KUBERNETES_SERVER - The server (HTTPS endpoint) of the Kubernetes cluster's
30
31
API. Mandatory.
31
- 5 . DOCKER_IMAGE_TAG - The docker tag to use for the deployment. Requires the
32
- ` deployment.yml ` file to specify a ` $DOCKER_IMAGE_TAG ` variable so it can be
33
- substitutes at deployment time.
34
- 6 . FORCE_RE_CREATE_RESOURCE - Will force re-creation of the deployment
35
32
33
+ # Usage in codefresh
36
34
35
+ ### deployment.yml
36
+
37
+ ``` yaml
38
+ ---
39
+ apiVersion : extensions/v1beta1
40
+ kind : Deployment
41
+ metadata :
42
+ name : api-svc
43
+ spec :
44
+ replicas : 1
45
+ template :
46
+ metadata :
47
+ annotations :
48
+ revision : " {{CF_REVISION}}"
49
+ labels :
50
+ app : api-svc
51
+ spec :
52
+ containers :
53
+ - name : apisvc
54
+ image : myrepo/apisvc:{{CF_BRANCH}}
55
+ ports :
56
+ - containerPort : 80
57
+ name : http
58
+
59
+ ```
60
+
61
+ ### codefresh.yml
62
+ ``` yaml
63
+ ---
64
+ version : ' 1.0'
65
+
66
+ steps :
67
+ build :
68
+ type : build
69
+ working-directory : ${{initial-clone}}
70
+ image-name : $docker-image
71
+ tag : ${{CF_BRANCH}}
72
+ push :
73
+ type : push
74
+ candidate : ${{build}}
75
+ tag : ${{CF_BRANCH}}
76
+
77
+ deploy-to-kubernetes :
78
+ image : codefresh/cf-deploy-kubernetes
79
+ tag : latest
80
+ working-directory : ${{initial-clone}}
81
+ commands :
82
+ - /cf-deploy-kubernetes deployment.yml
83
+ environment :
84
+ - KUBERNETES_USER=${{KUBERNETES_USER}}
85
+ - KUBERNETES_PASSWORD=${{KUBERNETES_PASSWORD}}
86
+ - KUBERNETES_SERVER=${{KUBERNETES_SERVER}}
87
+ ` ` `
0 commit comments