Skip to content

Commit 8620dc0

Browse files
authored
Merge branch 'main' into oig-eh-password-change
2 parents 9dd4c3f + c327f46 commit 8620dc0

File tree

17 files changed

+93
-29
lines changed

17 files changed

+93
-29
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2024 Oracle and/or its affiliates.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any
6+
person obtaining a copy of this software, associated documentation and/or data
7+
(collectively the "Software"), free of charge and under any and all copyright
8+
rights in the Software, and any and all patent rights owned or freely
9+
licensable by each licensor hereunder covering either (i) the unmodified
10+
Software as contributed to or provided by such licensor, or (ii) the Larger
11+
Works (as defined below), to deal in both
12+
13+
(a) the Software, and
14+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
15+
one is included with the Software (each a "Larger Work" to which the Software
16+
is contributed by such licensors),
17+
18+
without restriction, including without limitation the rights to copy, create
19+
derivative works of, display, perform, and distribute the Software and make,
20+
use, sell, offer for sale, import, export, have made, and have sold the
21+
Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
either these or other terms.
23+
24+
This license is subject to the following condition:
25+
The above copyright notice and either this complete permission notice or at
26+
a minimum a reference to the UPL must be included in all copies or
27+
substantial portions of the Software.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.

app-dev/devops-and-containers/devops/azure-devops-oke/README.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,28 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3636
SOFTWARE.
3737
-->
3838

39-
### Author
40-
<a href="https://github.com/mikarinneoracle">mikarinneoracle</a>
41-
42-
## Building and Deploying to OKE with Azure DevOps
39+
# Building and Deploying to OKE with Azure DevOps
4340

44-
There are two ways (at least) to build and deploy to OKE from Azure DevOps:
41+
There are two ways (at least) to build and deploy to Oracle Container Registry (OCIR) and Oracle Kubernetes Engine (OKE) from Azure DevOps:
4542
<ul>
4643
<li>Use OCI VM as Azure parallel job self-hosted build agent that will run as <code>instance-principal</code> and hence no OCI credentials are needed to be shared with Azure DevOps. Here <code>kubectl</code> and OCI native tooling like <code>oci cli</code> can be used in pipelines.</li>
4744
<br>
48-
<li>Use Azure DevOps native <code>tasks</code> that can run as either Azure-hosted or as self-hosted Azure parallel jobs. Credentials will be stored to Azure DevOps.</li>
45+
<li>Use Azure DevOps native <code>tasks</code> that can run as either Azure-hosted or as self-hosted Azure parallel jobs to deploy to OCIR and OKE. Credentials will be stored to Azure DevOps.</li>
4946
</ul>
5047

5148
<p>
52-
For this example I've used the second option. I'm also using a self-hosted agent/runner on OCI but that's just because I can use the <code>always-free</code> VM instance for it as part of the default OCI subscription and I don't have any Azure-hosted agents available in my Azure subscription. Technically that does not matter since the agent is a vanilla Oracle Linux VM instance and does not contain any customizations whatsover to do the pipeline work (it could however, but it does not).
49+
For this example I've used the second option. I'm also using a self-hosted agent/runner on OCI but that's just because I can use the <code>always-free</code> VM instance for it as part of the default OCI subscription and I don't have any Azure-hosted agents available in my Azure subscription. Technically that does not matter since the agent is a vanilla Oracle Linux VM instance and does not contain any customizations whatsover to do the pipeline work (it could however, but it does not).
50+
51+
Reviewed: 29.10.2024
52+
53+
# When to use this asset?
54+
55+
Anyone who wants to do CI/CD from Azure DevOps to deploy and run containers on Oracle Kubernetes Engine (OKE) using Azure DevOps native tasks.
56+
57+
# Author
58+
<a href="https://github.com/mikarinneoracle">mikarinneoracle</a>
59+
60+
# How to use this asset?
5361

5462
## Copy the files to the Azure DevOps repo
5563

@@ -60,7 +68,7 @@ To make this build and deploy to OKE to work is not a big task. First copy the f
6068
Before building the Docker image repo needs to be created under the desired <code>compartment</code>. This can be easily done using OCI Cloud UI. Name the repository as <b><i>Azure-test</i></b>, for example.
6169

6270
<p>
63-
Then modify the <code>deployment.yaml</code> <a href="https://github.com/oracle-devrel/technology-engineering/tree/main/app-dev/devops-and-containers/devops/azure-devops-oke/deployment.yaml#L19">line 19</a> by replacing the &lt;TENANCY_NAMESPACE&gt; with yours and if you gave another name for the OCIR repo then modify also that here, too. Modify also the <code>region</code> if using some other OCI region than <b><i>fra.ocir.io</i></b>.
71+
Then modify the <code>deployment.yaml</code> <a href="https://github.com/oracle-devrel/technology-engineering/tree/main/app-dev/devops-and-containers/devops/azure-devops-oke/files/deployment.yaml#L19">line 19</a> by replacing the &lt;TENANCY_NAMESPACE&gt; with yours and if you gave another name for the OCIR repo then modify also that here, too. Modify also the <code>region</code> if using some other OCI region than <b><i>fra.ocir.io</i></b>.
6472

6573
<p>
6674
To be able to do <code>Docker login</code> to the repo create <code>auth token</code> for your OCI user unless you already have one.
@@ -74,7 +82,7 @@ Once the OKE cluster is up and running with <code>kubectl</code> access setup th
7482
<a href="https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengaddingserviceaccttoken.htm" target="_NEW">https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengaddingserviceaccttoken.htm</a>.
7583

7684
<p>
77-
Name the secret <b><i>oke-kubeconfig-azure-token</i></b> as in <code>azure-token.yaml</code> <a href="https://github.com/oracle-devrel/technology-engineering/tree/main/app-dev/devops-and-containers/devops/azure-devops-oke/azure-token.yaml#L4" target="_NEW">line 4</a>.
85+
Name the secret <b><i>oke-kubeconfig-azure-token</i></b> as in <code>azure-token.yaml</code> <a href="https://github.com/oracle-devrel/technology-engineering/blob/main/app-dev/devops-and-containers/devops/azure-devops-oke/files/azure-token.yaml#L4" target="_NEW">line 4</a>.
7886

7987
## Setup Azure DevOps OCI connections for OKE and OCIR
8088

@@ -93,7 +101,7 @@ To make the Azure DevOps pipeline to work with OCIR and OKE two <code>Service Co
93101
<ul>
94102
<li>Type: Kubernetes</li>
95103
<li>Authentication method: Service Account</li>
96-
<li>Server URL: OKE cluster server address from your <i>~/.kube/config</i> e.g. <i>https://145.144.233.100:6443</i></li>
104+
<li>Server URL: OKE cluster server address from your <i>~/.kube/config</i> e.g. <i>https://xxx.144.233.100:6443</i></li>
97105
<li>Authorization Secret: Get the secret JSON by doing <i>kubectl get secret oke-kubeconfig-azure-token -n kube-system -o json</i> and paste it here</li>
98106
<li>Service connection name: OKE</li>
99107
<li>Grant access permission to all pipelines: YES</li>
@@ -109,22 +117,22 @@ Edit the created pipeline and select <code>Variables</code> to create them as fo
109117

110118
<ul>
111119
<li>CONTAINER_REGISTRY: OCIR</li>
112-
<li>CONTAINER_REPOSITORY: Use the same name as in the <code>deployment.yaml</code> <a href="https://github.com/oracle-devrel/technology-engineering/tree/main/app-dev/devops-and-containers/devops/azure-devops-oke/deployment.yaml#L19">line 19</a> but <b><i>without</i></b> the <code>region</code> and the <code>tag</code> ("1" in the example YAML file) e.g. <b><i>&lt;TENANCY_NAMESPACE&gt;/azure-test</i></b></li>
120+
<li>CONTAINER_REPOSITORY: Use the same name as in the <code>deployment.yaml</code> <a href="https://github.com/oracle-devrel/technology-engineering/tree/main/app-dev/devops-and-containers/devops/azure-devops-oke/files/deployment.yaml#L19">line 19</a> but <b><i>without</i></b> the <code>region</code> and the <code>tag</code> ("1" in the example YAML file) e.g. <b><i>&lt;TENANCY_NAMESPACE&gt;/azure-test</i></b></li>
113121
<li>containerImageFullNameForK8sDeploy: The same as above but with the OCI region e.g. <b><i>fra.ocir.io/&lt;TENANCY_NAMESPACE&gt;/azure-test</i></b></li>
114122
<li>K8S_CONNECTION_NAME: OKE</li>
115123
<li>K8S_NAMESPACE: default</li>
116124
<li>OcirPullSecret: ocirsecret</li>
117125
</ul>
118126

119127
<p>
120-
<img src="pipeline-vars.png" width="800" />
128+
<img src="files/pipeline-vars.png" width="800" />
121129

122130
## Run the pipeline
123131

124132
Pipeline runs automatically after commiting changes and when all of the above are properly set it should complete succesfully.
125133

126134
<p>
127-
<img src="azure-devops-oke.png" width="800" />
135+
<img src="files/azure-devops-oke.png" width="800" />
128136

129137
<p>
130138
Pipeline will create a Kubernetes <b><i>load balancer</i></b> service to provide a public access point to the pod in the OKE cluster:
@@ -133,7 +141,7 @@ Pipeline will create a Kubernetes <b><i>load balancer</i></b> service to provide
133141
<PRE>
134142
kubectl get svc
135143
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
136-
httpd-lb LoadBalancer 10.96.175.74 144.200.51.195 80:32452/TCP 4h1m
144+
httpd-lb LoadBalancer 10.96.175.74 xxx.200.51.195 80:32452/TCP 4h1m
137145
</PRE>
138146

139147
<p>
@@ -145,14 +153,14 @@ curl 144.200.51.195
145153
{
146154
"path": "/",
147155
"headers": {
148-
"host": "144.200.51.195",
156+
"host": "xxx.200.51.195",
149157
"user-agent": "curl/8.4.0",
150158
"accept": "*/*"
151159
},
152160
"method": "GET",
153161
"body": "",
154162
"fresh": false,
155-
"hostname": "144.200.51.195",
163+
"hostname": "xxx.200.51.195",
156164
"ip": "::ffff:10.0.10.220",
157165
"ips": [],
158166
"protocol": "http",
@@ -166,6 +174,13 @@ curl 144.200.51.195
166174
}%
167175
</PRE>
168176

177+
# Useful Links
178+
179+
- [Oracle Kubernetes Engine (OKE)](https://www.oracle.com/uk/cloud/cloud-native/kubernetes-engine/)
180+
- Simplify operations of enterprise-grade Kubernetes at scale. Easily deploy and manage resource-intensive workloads such as AI with automatic scaling, patching, and upgrades.
181+
- [Oracle](https://www.oracle.com/)
182+
- Oracle Website
183+
169184
### License
170185

171186
Copyright (c) 2024 Oracle and/or its affiliates.

app-dev/devops-and-containers/devops/devops-nodejs-vm/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)