cfctl init proxy
proxy, one of the subcommands of cfctl setting init, is a command that initializes the environment using SpaceONE’s domain URL.
01. Flag Types
The proxy subcommand has three flags.
cfctl setting init proxy {endpoint} {-app|--user|--internal}--app: Initialize with application token configurationcfctl setting init proxy http[s]://example.com --app
--user: Initialize with User ID and Password configurationcfctl setting init proxy http[s]://example.com --user
--internal: Use internal endpoint (can be used alone or with the--appflag)cfctl setting init proxy http[s]://example.com --internal
1.1. --app
Here’s an example of initializing the environment using a domain URL provided by SpaceONE .
❯ cfctl setting init proxy https://spaceone.-.com --app
Environment name: spaceone
SUCCESS Successfully initialized proxy connection to https://spaceone.-.com
SUCCESS Environment 'spaceone-app' successfully initialized.
INFO Configuration saved to: /Users/yjinjo/.cfctl/setting.yaml- The
Environment nameis set todefaultby default, but can be changed to any name you want.- In this example, it’s set to
spaceone.
- In this example, it’s set to
- When set with the
--appflag,-appis appended to theEnvironment name.- In this example, since we set the
Environment nametospaceoneand used the--appflag, it’s set tospaceone-app.
- In this example, since we set the
When you initialize the environment using the cfctl setting init command, a configuration file is created and saved in $HOME/.cfctl/setting.yaml.
- setting.yaml
environment: spaceone-app
environments:
cloudone-app:
endpoint: https://spaceone.-.com
proxy: true
token: no_tokenReplace no_token in token: no_token with the app token received through Creating an App.
environment: spaceone-app
environments:
spaceone-app:
endpoint: https://spaceone.-.com
proxy: true
token: eyJ...1.2. --user
The --user flag is used to initialize the environment using User ID and Password after creating a user with Local(ID) or Local(Email) in the Admin page.
Adding Users in Admin Page
Users can be added using either Local(ID) or Local(Email).


After adding a user, initialize the environment using the --user flag.
❯ cfctl setting init proxy https://spaceone.-.com --user
Environment name: spaceone
SUCCESS Successfully initialized proxy connection to https://spaceone.-.com
SUCCESS Environment 'spaceone-user' successfully initialized.
INFO Configuration saved to: /Users/yjinjo/.cfctl/setting.yaml- The
Environment nameis set todefaultby default, but can be changed to any name you want.- In this example, it’s set to
spaceone.
- In this example, it’s set to
- When set with the
--userflag,-useris appended to theEnvironment name.- In this example, since we set the
Environment nametospaceoneand used the--userflag, it’s set tospaceone-user.
- In this example, since we set the
Unlike initializing with the --app flag, when initializing with the --user flag, there is no token key value. You can see that the environment has immediately changed from spaceone-app to spaceone-user.
environment: spaceone-user
environments:
spaceone-app:
endpoint: https://spaceone.-.com
proxy: true
token: eyJ...
spaceone-user:
endpoint: https://spaceone.-.com
proxy: true- When initializing with the
--userflag, there is notokenkey value since it doesn’t use an app token. Instead, you can log in later usingcfctl login. - You can learn more about logging in with User ID and Password when the suffix is
-user(likespaceone-user) in theloginsection.
1.3. --internal
The --internal flag is used when using internal endpoints, for example, when accessing SpaceONE services within a Kubernetes cluster.
Let’s try overwriting an existing environment this time.
❯ cfctl setting init proxy https://spaceone.-.com --internal
Environment name: spaceone
SUCCESS Successfully initialized proxy connection to https://spaceone.-.com
┌─────────── Environment Already Exists ───────────┐
| Environment 'spaceone-app' already exists. |
| Do you want to overwrite it? |
└──────────────────────────────────────────────────┘
INFO Current configuration:
environment: spaceone-app
environments:
spaceone-app:
endpoint: https://spaceone.-.com
proxy: false
token: no_token
Enter (y/n): y
SUCCESS Environment 'spaceone-app' successfully initialized.
INFO Configuration saved to: /Users/yjinjo/.cfctl/setting.yaml- With the
--internalflag,-appis appended to theEnvironment name. - Since the
spaceone-appenvironment already exists, a warning appears, and enteringywill overwrite the existing environment. - The
endpointis set to the internal endpointgrpc:/-.-.:[PORT]. Even if you enter a Domain URL, it’s set to thegrpcprotocol because it uses an internal endpoint. - While we used the same environment name here to demonstrate how overwriting environment information works, it’s recommended to use different environment names in practice. (For example, if you set the Environment name to
spaceone-internal, it will be set asspaceone-internal-app.)
Like environments initialized with the -app flag, environments initialized with the --internal flag also have a token key value.
As with environments initialized through --app, replace token: no_token with the app token received through Creating an App.
environment: spaceone-app
environments:
spaceone-app:
endpoint: grpc://-.-.:[PORT]
proxy: false
token: eyJ...
spaceone-user:
endpoint: https://spaceone.-.com
proxy: true